Commit graph

111 commits

Author SHA1 Message Date
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
Vladimir 'phcoder' Serbinenko
298ffd54b0 merge mainline into newreloc 2010-04-11 22:44:31 +02:00
Vladimir 'phcoder' Serbinenko
4b0cd8f813 Fix cygwin compilation.
* configure.ac: Define NEED_REGISTER_FRAME_INFO.
	* include/grub/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)
	[NEED_REGISTER_FRAME_INFO && !UTIL]: New empty function.
	(__deregister_frame_info) [NEED_REGISTER_FRAME_INFO && !UTIL]: Likewise.
2010-04-11 21:24:21 +02:00
Vladimir 'phcoder' Serbinenko
9e71201f48 merge mainline into bidi 2010-04-09 19:31:43 +02:00
Vladimir 'phcoder' Serbinenko
a6132b9f3f Merge mainline into yeeloongfw 2010-04-05 17:35:03 +02:00
Vladimir 'phcoder' Serbinenko
42c4f00016 intwrapped halt 2010-04-04 18:42:48 +02:00
Grégoire Sutre
187bbe3d9c * kern/misc.c: Disable the __enable_execute_stack hack for utilities.
* include/grub/misc.h: Likewise.
2010-04-03 21:00:21 +02:00
Vladimir 'phcoder' Serbinenko
8b0800f66f merge mainline into newreloc 2010-04-01 22:17:26 +02:00
Vladimir 'phcoder' Serbinenko
f651947b58 Merge mainline into bidi 2010-03-30 11:24:28 +02:00
Vladimir 'phcoder' Serbinenko
dfed5c6bb4 Removed grub_putchar 2010-03-15 11:49:27 +01:00
Vladimir 'phcoder' Serbinenko
f9ef05770a Shutdown and reboot on yeeloong 2010-03-12 14:07:33 +01:00
Vladimir 'phcoder' Serbinenko
2d2a9cd5b6 GRUB_FILE implementation 2010-02-09 15:32:42 +01:00
Vladimir 'phcoder' Serbinenko
1f534b6908 Merge mainline into gfxmenu 2010-02-03 01:24:07 +01:00
Vladimir 'phcoder' Serbinenko
3c83bc50db merge bootcheck and mainline into newreloc 2010-01-20 11:48:36 +01:00
Vladimir 'phcoder' Serbinenko
61eb45eee7 Rename asprint into xasprintf and avsprintf into xvasprintf 2010-01-20 09:12:47 +01:00
Vladimir 'phcoder' Serbinenko
2d49abe9e7 merge mainline into asprintf 2010-01-20 07:36:17 +01:00
Vladimir 'phcoder' Serbinenko
6b60576149 merge mainline into newreloc 2010-01-10 01:56:47 +01:00