Vladimir Serbinenko
30d0053799
* grub-core/kern/ia64/dl.c (grub_arch_dl_relocate_symbols): Add checks
...
for relocation range.
2013-12-11 11:29:35 +01:00
Vladimir Serbinenko
979742bc7e
* grub-core/kern/ia64/dl.c (grub_arch_dl_relocate_symbols): Handle
...
non-function pcrel21b relocation. It happens with .text.unlikely
section.
2013-12-11 11:28:48 +01:00
Leif Lindholm
16c8f78513
efi: mm: make MAX_USABLE_ADDRESS platform-specific
2013-12-10 18:05:29 +00:00
Vladimir Serbinenko
7a148da6dd
Implement sparc64 trampolines (needed for sparc64-emu).
2013-12-10 00:01:27 +01:00
Vladimir Serbinenko
21eee750b7
* grub-core/kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Check
...
range of R_SPARC_HI22.
Implement R_SPARC_LM22.
2013-12-09 15:51:12 +01:00
Vladimir Serbinenko
7b54b62682
* grub-core/kern/powerpc/dl_helper.c (grub_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 15:43:27 +01:00
Vladimir Serbinenko
9a945e2a24
* grub-core/kern/emu/cache.c [__ia64__]: Use our cache cleaning routine
...
on ia64 as __clear_cache is a dummy on ia64.
2013-12-09 14:24:56 +01:00
Vladimir Serbinenko
4f4ea1b449
* grub-core/kern/ia64/dl_helper.c (grub_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 14:22:31 +01:00
Vladimir Serbinenko
78b2b0a1a0
* grub-core/kern/ia64/efi/init.c (grub_arch_sync_caches): Move to ...
...
* grub-core/kern/ia64/cache.c (grub_arch_sync_caches): ... here.
2013-12-08 18:27:40 +01:00
Vladimir Serbinenko
d14772c455
* grub-core/kern/emu/main.c: Silence missing prototypes to allow emu
...
compilation with GCC <= 4.2.
* grub-core/kern/emu/argp_common.c: Likewise.
2013-12-08 18:21:10 +01:00
Vladimir Serbinenko
fa7eb63dec
* grub-core/kern/emu/lite.c: Add missing include of ../ia64/dl_helper.c.
2013-12-08 18:14:32 +01:00
Vladimir Serbinenko
50b3a68db9
Remove grub_memalign on emu.
2013-12-08 18:12:20 +01:00
Vladimir Serbinenko
fbbfb6ab11
* grub-core/kern/ia64/efi/init.c: Fix alignment code so it doesn't
...
truncate incomplete lines but instead flushes them.
2013-12-08 18:10:05 +01:00
Vladimir Serbinenko
a19293cb75
Move OS-dependent mprotect for module loading to grub-core/osdep/*/dl.c
...
and implement windows variant.
2013-12-08 18:08:23 +01:00
Vladimir Serbinenko
d5c14e1e26
Fix mips-emu compilation.
2013-12-08 17:49:02 +01:00
Vladimir Serbinenko
c311ced5d7
Make arm-emu work.
2013-12-08 02:59:21 +01:00
Vladimir Serbinenko
8c534b85f1
Revamp relocation handling.
...
Move more code to common dl.c. Add missing veneers for arm and arm64.
Decreases kernel size by 70 bytes on i386-pc (40-50 compressed)
2013-12-06 09:18:55 +01:00
Vladimir Serbinenko
e5ed2f6947
Handle unaligned .bss on sparc64.
...
Current code improperly assumes that both __bss_start and _end are
aligned to 8-bytes. Eliminating this assumption and explicitly align
modules.
2013-12-05 06:35:19 +01:00
Vladimir Serbinenko
8a3f0a24b5
* grub-core/kern/emu/main.c: Ignore missing prototype for main.
2013-12-04 10:28:23 +01:00
Vladimir Serbinenko
bb6e299ccb
* grub-core/kern/i386/qemu/init.c: Remove variable length arrays.
2013-12-04 09:48:36 +01:00
Vladimir Serbinenko
47f88cc94e
* grub-core/kern/efi/efi.c: Remove variable length arrays.
2013-12-04 08:39:22 +01:00
Vladimir Serbinenko
40b5739ff9
* grub-core/kern/uboot/init.c (uboot_timer_ms): Fix overflow after 71
...
minutes.
2013-12-04 08:26:39 +01:00
Andrey Borzenkov
5037aa9a7b
fix libgrub.pp build post arm64 merge
...
grub-core/kern/arm64/dl_helper.c:26:28: fatal error: grub/cpu/reloc.h: No such file or directory
2013-11-30 22:36:10 +04:00
Leif Lindholm
b29b77fee2
New port arm64-efi
2013-11-30 16:50:31 +01:00
Vladimir Serbinenko
ce55ed0389
Remove leftover GRUB_IA64_DL_TRAMP_SIZE.
2013-11-30 11:14:30 +01:00
Vladimir Serbinenko
eec893ae49
* grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays.
2013-11-29 05:52:20 +01:00
Vladimir Serbinenko
2d76b4d81e
Eliminate variable length arrays in grub_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
but make all stack references use 32-bit offset rather than 8-bit one.
So split va_args preparsing to separate function and put the prealloc
into the caller.
2013-11-27 15:16:09 +01:00
Vladimir Serbinenko
d2f7902af0
Make arm64 compileable with clang
2013-11-25 13:06:56 +01:00
Vladimir Serbinenko
1005bed722
Use b.ge form for instructions
2013-11-25 13:04:44 +01:00
Vladimir Serbinenko
d6c92cdc34
Merge branch 'master' into leiflindholm/arm64
...
Conflicts:
include/grub/util/install.h
2013-11-25 13:02:27 +01:00
Vladimir Serbinenko
9eec9699b9
* grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation):
...
Add missing cast to silence warning.
2013-11-23 15:35:01 +01:00
Vladimir Serbinenko
1bba40f578
Move common BIOS/coreboot memory map declarations to
...
include/grub/i386/memory_raw.h and eliminate duplicate declarations.
2013-11-23 12:39:21 +01:00
Vladimir Serbinenko
e1c22419ac
* grub-core/kern/xen/init.c: Do not map more pages than we can address.
2013-11-22 13:04:29 +01:00
Vladimir Serbinenko
189090cee9
* grub-core/kern/efi/mm.c: Limit allocations to 2GiB when not compiling
...
with -mcmodel=large.
2013-11-22 13:03:19 +01:00
Vladimir Serbinenko
1a5b7b404f
* grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Add
...
range-checking for 32-bit quantities.
2013-11-22 13:01:14 +01:00
Vladimir Serbinenko
4a0aaad022
clang emits calls to abort () under some unknown conditions.
...
Export abort () when compiling with clang.
2013-11-22 12:42:58 +01:00
Vladimir Serbinenko
4e42521d8c
* grub-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
in callwrap.S. startup.S part was committed few commits before. This
takes care of callwrap.S.
Reported by: Gary Lin.
2013-11-22 05:40:32 +01:00
Vladimir Serbinenko
a0e1befb57
On MIPS handle got16 relocations to local symbols in an ABI-compliant
...
way.
2013-11-22 05:03:17 +01:00
Vladimir Serbinenko
c36c73f681
Add support for a new magic symbol _gp_disp on mips to handle PIC
...
binaries.
2013-11-22 04:56:10 +01:00
Vladimir Serbinenko
6f4a19f59f
Use $t9 for indirect calls from asm to C as PIC ABI requires.
2013-11-22 04:45:05 +01:00
Vladimir Serbinenko
0d8f04cd83
Remove -march=mips3 from TARGET_CCASFLAGS as it creates linking problem
...
when rest of GRUB is compiled for hisher stepping. Instead use
.set mips3/.set mips1 around cache and sync opcodes.
2013-11-22 04:36:53 +01:00
Vladimir Serbinenko
4906052019
Unify GOT/trampoline handling between PPC, MIPS and IA64 as they
...
do essentially the same thing, do it in similar way.
2013-11-21 21:54:33 +01:00
Josh Triplett
7960d3e182
* grub-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
alignment, which crashes if not aligned. The EFI firmware is also
entitled to assume that stack alignment without checking.
2013-11-19 14:31:40 +01:00
Leif Lindholm
8a07b55a04
arm64: cache maintenance code rework + bugfix
2013-11-19 10:05:23 +00:00
Vladimir Serbinenko
96fa2d9d02
Merge branch 'master' into leiflindholm/arm64
2013-11-18 17:51:28 +01:00
Vladimir Serbinenko
45bf8b3a75
* grub-core/kern/mm.c (grub_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 17:41:37 +01:00
Vladimir Serbinenko
39ff43c579
* grub-core/kern/mm.c (grub_real_malloc): Don't update the pointer to
...
current memory when allocating large chunks. This significantly
decreases memory fragmentation.
2013-11-18 16:58:55 +01:00
Vladimir Serbinenko
74e632fea8
* grub-core/kern/mips/qemu_mips/init.c (grub_machine_init): Update
...
clock frequency to 200 MHz,
2013-11-18 16:39:45 +01:00
Vladimir Serbinenko
33d02a42d6
* grub-core/kern/file.c (grub_file_open): Free file->name on failure.
...
(grub_file_close): Free file->name.
2013-11-18 02:41:42 +01:00
Leif Lindholm
15a463d742
ARM 64 port by Leif Lindholm
2013-11-16 20:52:55 +01:00
Vladimir Serbinenko
cd46aa6cef
Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-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 20:21:16 +01:00
Vladimir Serbinenko
9ef81064a3
* grub-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.
2013-11-16 17:37:06 +01:00
Leif Lindholm
11a7793221
arm: delete superflouous save of r8 in grub_uboot_syscall
2013-11-16 15:56:09 +00:00
Leif Lindholm
593865b907
arm: fix u-boot port syscall interface va_arg handling
...
Commit c9cd02c
broke the u-boot syscall API for va_args that spill over
to the stack, causing the disk support to stop working. This patch
resolves the problem, while keeping the new, cleaner transition_space
handling.
2013-11-16 14:12:12 +00:00
Andrey Borzenkov
9e18dfe277
MIPS grub_machine_get_bootlocation arguments are used
2013-11-16 16:59:07 +04:00
Vladimir Serbinenko
6fcec43954
Replace libgcc version of ctz with our own.
...
On upcoming arm64 port libgcc ctz* are not usable in standalone
environment. Since we need ctz* for this case and implementation is
in C we may as well use it on all concerned platforms.
2013-11-15 03:28:34 +01:00
Vladimir Serbinenko
e1aa5b6620
* grub-core/kern/xen/init.c (grub_xenstore_write_file): Don't add
...
\0 to all files.
Reported by: M A Young.
2013-11-14 22:40:50 +01:00
Matthew Garrett
1fe26ab4a0
* grub-core/kern/main.c (grub_set_prefix_and_root): Set variable
...
cmdpath to firmware directory.
2013-11-14 15:53:32 +01:00
Vladimir Serbinenko
83e9c273e5
* grub-core/kern/efi/efi.c (grub_efi_get_filename): Reset the pointer
...
at the start of second iteration.
2013-11-14 15:50:43 +01:00
Vladimir Serbinenko
57ffe93485
* grub-core/kern/arm/cache_armv6.S: Remove special handling for
...
clang (not necessarry with -no-integrated-as).
* include/grub/symbol.h [__arm__]: Likewise.
2013-11-14 10:05:19 +01:00
Leif Lindholm
035a26c16a
* grub-core/kern/arm/misc.S: Make thumb2-compatible.
2013-11-14 01:33:06 +01:00
Colin Watson
81a2e438dc
* grub-core/kern/misc.c: Don't redirect divisions in the
...
GRUB_UTIL case.
* include/grub/misc.h: Likewise.
2013-11-13 14:47:23 +00:00
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