Commit Graph

127 Commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko a6393224c4 Make 'make check' work on emu. 2013-04-27 02:00:16 +02:00
Vladimir 'phcoder' Serbinenko 0467a5ddf0 Move GRUB_CHAR_BIT to types.h. 2013-04-05 10:31:12 +02:00
Vladimir 'phcoder' Serbinenko 1a78d573c7 * grub-core/commands/verify.c: Save verified file to avoid it being
tampered with after verification was done.
2013-04-03 17:32:33 +02:00
Vladimir Testov c3578acfbb * grub-core/gfxmenu/gui_circular_progress.c: Take both width and height
into account when calculating radius.
2013-04-03 09:20:29 +02:00
Vladimir 'phcoder' Serbinenko e744219bb6 Implement boot time analysis framework. 2013-03-19 20:25:09 +01:00
Vladimir 'phcoder' Serbinenko 19ce697dfd Remove all trampoline support. Add -Wtrampolines when
present. Remove symbols used for trampolines to make
	link fail if trampolines are present.
2013-03-03 15:57:30 +01:00
Vladimir 'phcoder' Serbinenko 4a5a3c4abc * include/grub/list.h (grub_bad_type_cast_real): Remove return.
* include/grub/misc.h (ATTRIBUTE_ERROR): Make into noreturn attribute
	on older compiler.
2012-05-28 17:45:53 +02:00
Vladimir 'phcoder' Serbinenko f7194551c4 * include/grub/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.
	(memmove) [__APPLE__]: Likewise.
	(memcpy) [__APPLE__]: Likewise.
	(memset) [__APPLE__]: Likewise.
2012-05-28 17:37:18 +02:00
Vladimir 'phcoder' Serbinenko ce41ab7aab * grub-core/kern/misc.c (grub_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.
	* Makefile.util.def (cmp_test): New test.
	(grub_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.
2012-05-04 12:08:22 +02:00
Vladimir 'phcoder' Serbinenko 1a2fd1e674 * 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.
2012-03-05 01:17:55 +01:00
Vladimir 'phcoder' Serbinenko 10133b5ff3 * grub-core/kern/misc.c (grub_stpcpy): Move from here ...
* include/grub/misc.h (grub_stpcpy): ... to here. Inlined.
2012-02-26 23:55:18 +01:00
Vladimir 'phcoder' Serbinenko f991dd3c32 * include/grub/misc.h (grub_error_save): Fix cleaning grub_errno. 2012-02-12 17:21:09 +01:00
Vladimir 'phcoder' Serbinenko d61386e21d Improve string. Gettextize. 2012-02-12 15:25:25 +01:00
Vladimir 'phcoder' Serbinenko 44318d6168 * include/grub/misc.h: Avoid evaluationg NEED_ENABLE_EXECUTE_STACK and
NEED_REGISTER_FRAME_INFO in GRUB_UTIL.
2012-02-10 12:45:32 +01:00
Vladimir 'phcoder' Serbinenko 9c4b5c13e6 Improve gettext support. Stylistic fixes and error handling fixes while
on it.
2012-02-08 19:26:01 +01:00
Vladimir 'phcoder' Serbinenko aca002f7e4 * 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.
	(tftp_receive): Save error.
	(tftp_open): Restore error.
2012-02-05 10:24:53 +01:00
Vladimir 'phcoder' Serbinenko 9c2710789f Eliminate grub_min/grub_max prone to overflow usage.
* grub-core/bus/usb/usbhub.c (grub_usb_add_hub): Eliminate grub_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.
	(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.
2012-01-14 15:44:34 +01:00
Vladimir 'phcoder' Serbinenko bd67ad0f70 merge mainline into net 2011-12-15 20:51:35 +01:00
Vladimir 'phcoder' Serbinenko 0d51ee20ee * 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.
2011-12-13 14:51:41 +01:00
Vladimir 'phcoder' Serbinenko c5fc563aff 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.
	(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.
2011-12-13 00:50:49 +01:00
Vladimir 'phcoder' Serbinenko 067fdf0055 * grub-core/kern/misc.c (grub_strstr): Moved from here ...
* include/grub/misc.h (grub_strstr): ... here. Make static and inline.
2011-11-11 20:02:51 +01:00
Vladimir 'phcoder' Serbinenko 57b0125004 * include/grub/misc.h (grub_strncat): Fix the order of conditionals to
avoid accessing beyond the array.
2011-11-09 14:47:45 +01:00
Vladimir 'phcoder' Serbinenko 4e94ae6575 * include/grub/misc.h (grub_memcpy): Declare grub_memcpy with static
inline function rather than a define.
2011-10-23 23:25:06 +02:00
Vladimir 'phcoder' Serbinenko 544c24876e Move grub_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.
2011-10-19 16:53:18 +02:00
Vladimir 'phcoder' Serbinenko 0eb8ffb1f5 * 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
	number starting with a letter.
2011-10-14 19:16:37 +02:00
Vladimir 'phcoder' Serbinenko 80e722366d First attempt at http 2011-07-23 03:49:02 +02:00
Vladimir 'phcoder' Serbinenko bf947d36e3 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
	version.
2011-05-18 15:35:19 +02:00
Vladimir 'phcoder' Serbinenko 93a777e388 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.
2011-04-18 23:03:52 +02:00
BVK Chaitanya 7955bea0d8 fix changelog and doc 2010-11-25 19:05:16 +05:30
BVK Chaitanya 5b08062083 replaced with grub_strchrsub function 2010-11-25 18:56:20 +05:30
Vladimir 'phcoder' Serbinenko 742f9232e3 Split config.h for util and core.
* acinclude.m4 (HAVE_ASM_USCORE): Transformed into a variable.
	(ADDR32): Likewise.
	(DATA32): Likewise.
	(BSS_START_SYMBOL): Likewise.
	(END_SYMBOL): Likewise.
	(NEED_ENABLE_EXECUTE_STACK): Likewise. All users updated.
	(grub_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.
	(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.
	(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.
2010-09-19 22:22:43 +02:00
Vladimir 'phcoder' Serbinenko b0ea3a5a93 Add missing noreturn 2010-08-30 16:25:39 +02:00
Vladimir 'phcoder' Serbinenko 069c9c5fda merge mainline into intwrap 2010-08-29 23:21:21 +02:00
Vladimir 'phcoder' Serbinenko afba9f98ec MErge mainline into intwrap 2010-08-25 23:39:42 +02:00
Vladimir 'phcoder' Serbinenko 16bd6cfab2 Merge mainline into newreloc. For now without boot tests 2010-08-25 03:25:18 +02:00
BVK Chaitanya 2be24791dd merge with mainline 2010-08-21 00:49:29 +05:30
BVK Chaitanya fd324286d4 merge with mainline 2010-08-12 09:30:26 +05:30
Robert Millan f7790cdd5d 2010-07-30 Robert Millan <rmh@gnu.org>
* include/grub/emu/misc.h (grub_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.
2010-07-30 11:27:02 +02:00
BVK Chaitanya 9ec82092f1 merge with mainline 2010-07-11 21:40:25 +05:30
BVK Chaitanya e57a453ad1 merge with mainline 2010-07-11 17:55:26 +05:30
Vladimir 'phcoder' Serbinenko e8d0a8f85c Merge mainline into bidi 2010-07-02 19:35:07 +02:00
Colin Watson e03ed6c1ee * include/grub/misc.h (grub_reboot): Declare as noreturn.
* kern/efi/efi.c (grub_reboot): Don't return, even if reset_system
fails.
(grub_halt): Likewise.
* kern/ieee1275/openfw.c (grub_reboot): Don't return, even if
reset-all fails.
(grub_halt): Don't return, even if all of shut-down, power-off, and
poweroff fail.
2010-07-02 13:47:14 +01:00
BVK Chaitanya 6d6f139349 review fixes 2010-06-02 14:45:07 +05:30
BVK Chaitanya e508977630 review fixes 2010-06-02 13:51:05 +05:30
Vladimir 'phcoder' Serbinenko e34b610d49 merge mainline into yeeloongfw 2010-05-22 16:58:45 +02:00
BVK Chaitanya 8f6a910b23 fixed n > active_loops case 2010-05-06 09:55:06 +05:30
Vladimir 'phcoder' Serbinenko 99bfe57386 merge mainline into bidi 2010-05-05 16:28:52 +02:00
Vladimir 'phcoder' Serbinenko 8496927478 move grub_halt out of kernel on most platforms 2010-05-04 17:15:36 +02:00
Vladimir 'phcoder' Serbinenko 4dff488793 merge mainline into intwrap 2010-05-04 15:57:37 +02:00
BVK Chaitanya 725396942e replace --enable-grub-emu-modules with grub-emu-lite 2010-05-04 09:47:48 +05:30