[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 13/23] Add 64bit support to powerpc startup code
From: |
Ram Pai |
Subject: |
[RFC PATCH 13/23] Add 64bit support to powerpc startup code |
Date: |
Wed, 26 Feb 2014 10:31:12 -0800 |
From: Anton Blanchard <address@hidden>
Add 64bit support to powerpc startup code
Signed-off-by: Ram Pai <address@hidden>
From: Anton Blanchard <address@hidden>
---
grub-core/kern/powerpc/ieee1275/startup.S | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/grub-core/kern/powerpc/ieee1275/startup.S
b/grub-core/kern/powerpc/ieee1275/startup.S
index 21c884b..d93682e 100644
--- a/grub-core/kern/powerpc/ieee1275/startup.S
+++ b/grub-core/kern/powerpc/ieee1275/startup.S
@@ -19,15 +19,26 @@
#include <grub/symbol.h>
#include <grub/offsets.h>
+#include <ppc-asm.h>
.extern __bss_start
.extern _end
.text
- .align 2
- .globl start, _start
-start:
-_start:
+
+FUNC_START(_start)
+
+#if defined(_CALL_ELF) && _CALL_ELF == 2 /* Little endian */
+ .long 0x05009f42 /* bcl 20,31,$+4 */
+ .long 0xa602487d /* mflr r10 */
+ .long 0x1c004a39 /* addi r10,r10,28 */
+ .long 0xa600607d /* mfmsr r11 */
+ .long 0x01006b69 /* xori r11,r11,1 */
+ .long 0xa6035a7d /* mtsrr0 r10 */
+ .long 0xa6037b7d /* mtsrr1 r11 */
+ .long 0x2400004c /* rfid */
+#endif
+
li 2, 0
li 13, 0
@@ -61,7 +72,18 @@ _start:
/* Store r5 in grub_ieee1275_entry_fn. */
lis 9, address@hidden
+
+#if defined( __powerpc64__ ) || defined ( __powerpc64le__ )
+ std 5, address@hidden(9)
+ /* Set up the TOC */
+ bl 3f
+3: mflr 9
+ addis 2,9,address@hidden
+ addi 2,2,address@hidden
+#else
stw 5, address@hidden(9)
+#endif
bl grub_main
1: b 1b
+FUNC_END(_start)
--
1.8.5.3
- [RFC PATCH 03/23] ignore .TOC. symbol, (continued)
- [RFC PATCH 03/23] ignore .TOC. symbol, Ram Pai, 2014/02/26
- [RFC PATCH 04/23] grub-install can now recognize and install a LE grub boot loader, Ram Pai, 2014/02/26
- [RFC PATCH 06/23] Add IEEE1275_ADDR helper, Ram Pai, 2014/02/26
- [RFC PATCH 05/23] set ABI version in e_flag of the PPC64LE ELF image., Ram Pai, 2014/02/26
- [RFC PATCH 07/23] Fix some more warnings when casting., Ram Pai, 2014/02/26
- [RFC PATCH 08/23] Add powerpc64 types, Ram Pai, 2014/02/26
- [RFC PATCH 09/23] Fix warnings when building powerpc linux loader 64bit, Ram Pai, 2014/02/26
- [RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues, Ram Pai, 2014/02/26
- [RFC PATCH 10/23] GRUB_ELF_R_PPC_* processing is applicable only for 32 bit bootloader., Ram Pai, 2014/02/26
- [RFC PATCH 12/23] Add powerpc64 ieee1275 trampoline, Ram Pai, 2014/02/26
- [RFC PATCH 13/23] Add 64bit support to powerpc startup code,
Ram Pai <=
- [RFC PATCH 14/23] Add grub_dl_find_section_addr, Ram Pai, 2014/02/26
- [RFC PATCH 15/23] Add ppc64 relocations, Ram Pai, 2014/02/26
- [RFC PATCH 17/23] Use FUNC_START/FUNC_END for powerpc function definitions, Ram Pai, 2014/02/26
- [RFC PATCH 16/23] ppc64 doesn't need libgcc routines, Ram Pai, 2014/02/26
- [RFC PATCH 19/23] align .toc section on 4byte boundary., Ram Pai, 2014/02/26
- [RFC PATCH 18/23] .TOC. symbol is special in ppc64le, Ram Pai, 2014/02/26
- [RFC PATCH 20/23] fix parameter to firmware calls, Ram Pai, 2014/02/26
- [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :), Ram Pai, 2014/02/26
- [RFC PATCH 22/23] fix segfaults if initrd, Ram Pai, 2014/02/26
- [RFC PATCH 23/23] Optional: Power7 VSX instructions workaround., Ram Pai, 2014/02/26