Commit graph

606 commits

Author SHA1 Message Date
Vladimir Serbinenko
2bdd07195c * grub-core/kern/arm/cache.c (probe_caches): Move asm part to ...
* grub-core/kern/arm/cache_armv6.S: ... here. This allows this
	asm to stay in arm even if surrounding is thumb.
2013-11-13 09:58:52 +01:00
Vladimir Serbinenko
5e77d9cfc1 * grub-core/kern/arm/misc.S: Add __muldi3 and __aeabi_lmul. Those
helper functions are needed for thumb.
2013-11-13 09:52:33 +01:00
Vladimir Serbinenko
16a22c3851 * grub-core/kern/uboot/init.c: Move grub_uboot_machine_type and
grub_uboot_boot_data to asm part.
2013-11-13 06:28:15 +01:00
Vladimir Serbinenko
c9cd02c965 * grub-core/kern/arm/uboot/startup.S: Remove = by replacing with
literal load.
	(grub_uboot_syscall): Save/restore r9 and align stack.
2013-11-13 06:27:03 +01:00
Vladimir Serbinenko
8149861554 * grub-core/kern/arm/cache.S: Replace = with explicit litteral load. 2013-11-13 06:23:32 +01:00
Vladimir Serbinenko
ea57de18f8 * include/grub/symbol.h (END) [__arm__]: New macros. Replace all .end
occurencies with END.
2013-11-13 05:19:30 +01:00
Vladimir Serbinenko
c773faf05e Revert " * include/grub/symbol.h (ADDR): New macro. Replace all occurences of"
This reverts commit 286551b4eb.
2013-11-13 02:17:20 +01:00
Vladimir Serbinenko
513eeb61dd * grub-core/kern/arm/cache_armv6.S [__clang__]: Don't add .armv6 when
compiling with clang.
2013-11-13 01:08:47 +01:00
Vladimir Serbinenko
bc379c1aa1 * grub-core/kern/arm/uboot/startup.S: Use .org rather than assigning
".".
2013-11-13 01:06:30 +01:00
Vladimir Serbinenko
286551b4eb * include/grub/symbol.h (ADDR): New macro. Replace all occurences of
=x with ADDR(x) in arm assembly.
	(END): New macro. Replace all .end with END.
2013-11-13 01:04:56 +01:00
Vladimir Serbinenko
16057d6bbb Redirect all divisions to grub_divmod64. 2013-11-13 00:53:53 +01:00
Vladimir Serbinenko
ef28ee8bc1 Add missing includes of loader.h. 2013-11-13 00:43:03 +01:00
Vladimir Serbinenko
8506a64149 * include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64.
* grub-core/kern/misc.c (__bzero) [__APPLE__]: New function.
2013-11-11 22:53:30 +01:00
Vladimir Serbinenko
631187be8c Add missing includes of loader.h. 2013-11-11 02:30:09 +01:00
Vladimir Serbinenko
33690255c5 Fix grub_machine_fini bitrot.
Reported by: Glenn Washburn.
2013-11-10 13:33:26 +01:00
Vladimir Serbinenko
9612ebc00e Add new ports: i386-xen and x86_64-xen. This allows running GRUB in
XEN PV environment and load kernels.
2013-11-09 21:29:11 +01:00
Vladimir Serbinenko
c6b755df45 * grub-core/kern/mm.c (grub_real_malloc): Use AND rather than MOD
for alignment.
2013-11-08 09:43:26 +01:00
Vladimir Serbinenko
c4f11a2a99 * grub-core/kern/misc.c (grub_divmod64): Don't fallback to
simple division on arm and ia64.
2013-11-08 09:07:33 +01:00
Vladimir Serbinenko
e0a7bffa1e * grub-core/kern/arm/misc.S (__aeabi_unwind_cpp_pr0): Add dummy to
link with libgcc.
2013-11-08 07:35:13 +01:00
Vladimir Serbinenko
7a3f4a18d1 * grub-core/kern/powerpc/dl.c: Add missing pragma to silence cast-align
warnings.
2013-11-07 19:33:00 +01:00
Vladimir Serbinenko
60375a88fe Allow compiling with clang (not really supported though).
* conf/Makefile.common (CFLAGS_PLATFORM): Don't add -mrtd -mregparm=3
	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.
2013-11-07 11:44:40 +01:00
Vladimir Serbinenko
dd07e0c4cf * grub-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.
2013-11-07 10:30:32 +01:00
Vladimir Serbinenko
ac319fbc90 * grub-core/kern/parser.c (grub_parser_split_cmdline): Remove nested
function.
2013-11-07 02:53:43 +01:00
Vladimir Serbinenko
4bfe934cd1 * grub-core/kern/misc.c (grub_vsnprintf_real): Remove nested functions. 2013-11-07 02:49:50 +01:00
Vladimir Serbinenko
cb72aa1809 Rewrite blocklist functions in order to get progress when
reading large extents and decrease amount of blocklist hook calls.
2013-11-01 23:28:03 +01:00
Vladimir Serbinenko
eb03ede014 * grub-core/fs/ext2.c (grub_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
	+ strcpy rather than strncpy.
2013-11-01 18:44:46 +01:00
Vladimir Serbinenko
fa9b3dcae2 * grub-core/kern/efi/efi.c (grub_efi_get_filename): Avoid inefficient
realloc.
2013-11-01 16:06:51 +01:00
Vladimir Serbinenko
80e8b13ac4 * grub-core/kern/dl.c: Unify section-finding algorithm. Saves 30 bytes
on core size.
2013-11-01 15:20:14 +01:00
Vladimir Serbinenko
b61599aca4 * grub-core/kern/mm.c (grub_realloc): Don't copy more data than we have. 2013-11-01 14:39:33 +01:00
Vladimir Serbinenko
5177391ebe * include/grub/emu/hostdisk.h: Add proper declaration for grub_host_init
and grub_hostfs_init.
2013-10-28 13:33:12 +01:00
Vladimir Serbinenko
64db14b0cb * grub-core/kern/emu/hostdisk.c (grub_util_check_file_presence): Use
windows method on other platforms without good stat as well.
2013-10-28 02:17:56 +01:00
Vladimir Serbinenko
442b86de32 Move grub_disk_write out of kernel into disk.mod. 2013-10-27 15:44:55 +01:00
Vladimir Serbinenko
04dea7e6c2 * grub-core/kern/misc.c (grub_vsnprintf_real): Unify int and wchar
handling.
2013-10-27 14:47:04 +01:00
Vladimir Serbinenko
a8f15bceea * grub-core/kern/misc.c (grub_abort): Make static 2013-10-27 14:13:39 +01:00
Vladimir Serbinenko
a60dae7e4e * grub-core/kern/misc.c (grub_vsnprintf_real): Don't attempt to
transform invalid unicode codepoints.
2013-10-27 13:34:46 +01:00
Vladimir Serbinenko
891b713be3 * grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit
\0 checking.
2013-10-27 13:20:50 +01:00
Vladimir Serbinenko
c81acb7ff3 Consolidate cpuid code. 2013-10-27 00:02:01 +02:00
Vladimir Serbinenko
c1bee64676 Move cpuid code to cpuid.h and TSC code to tsc.c. 2013-10-26 23:39:10 +02:00
Paulo Flabiano Smorigo
84a0e9699f Add progress module to display 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):
	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.
2013-10-22 16:42:20 -02:00
Vladimir 'phcoder' Serbinenko
f8401f760c * grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit
\0 checking.

	Saves 70 bytes on compressed image.
2013-10-21 14:02:24 +02:00
Vladimir 'phcoder' Serbinenko
ac1feb61d2 * grub-core/kern/misc.c (grub_strtoull): Remove needless *ptr != 0
check.

	Saves 10 bytes on compressed image.
2013-10-21 13:40:05 +02:00
Vladimir 'phcoder' Serbinenko
00f72e890b * grub-core/kern/misc.c (grub_isprint): Move to ...
* include/grub/misc.h (grub_isprint): ... here. Make inline.

	Saves 20 bytes on compressed image due to remving exporting.
2013-10-21 13:25:56 +02:00
Vladimir 'phcoder' Serbinenko
2cc679adae * grub-core/kern/disk.c (grub_disk_write): Use malloc/free instead of
variable length arrays.

	Saves 50 bytes on compressed image.
2013-10-21 00:10:34 +02:00
Vladimir 'phcoder' Serbinenko
e89c2d48a9 Lift 255x255 erminal sie restriction to 65535x65535. Also change from
bitmasks to small structures of size chosen to fit in registers.
2013-10-19 23:59:32 +02:00
Vladimir 'phcoder' Serbinenko
bbd2b5396b * grub-core/kern/misc.c (grub_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 23:52:09 +02:00
Vladimir 'phcoder' Serbinenko
887c0bb61a * grub-core/kern/emu/hostdisk.c: Remove few leftover includes. 2013-10-19 16:32:28 +02:00
Vladimir 'phcoder' Serbinenko
fc3182c799 * grub-core/kern/i386/pc/mmap.c (grub_machine_mmap_iterate): Pass
unknown types through.
2013-10-19 01:01:36 +02:00
Vladimir 'phcoder' Serbinenko
3cd910a212 * grub-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.
2013-10-18 16:54:57 +02:00
Vladimir 'phcoder' Serbinenko
df1e64c98e Define grub_util_is_directory/regular/special_file and
use OS-dependent versions rather than to rely on stat().
2013-10-15 20:27:58 +02:00
Vladimir 'phcoder' Serbinenko
f4e0adc0f9 Remove leftover references to some of the system headers. 2013-10-15 17:59:54 +02:00