diff --git a/genprotimg/boot/head.S b/genprotimg/boot/head.S index 8fae4604..bfa35f6e 100644 --- a/genprotimg/boot/head.S +++ b/genprotimg/boot/head.S @@ -1,5 +1,5 @@ /* - * Entry code for stage 3a boot loader + * Entry code for stage 3a and stage 3b boot loader * * Copyright IBM Corp. 2020 * @@ -24,6 +24,8 @@ _start: sam64 /* Initialize stack */ - lgfi %r15, STACK_ADDRESS + STACK_SIZE - STACK_FRAME_OVERHEAD + basr %r13, 0 +.Lbase: llgf %r15, .Lstack - .Lbase(%r13) brasl %r14, initialize +.Lstack: .long STACK_ADDRESS + STACK_SIZE - STACK_FRAME_OVERHEAD .previous diff --git a/genprotimg/boot/stage3a_init.S b/genprotimg/boot/stage3a_init.S index 87c8d754..43dd02b3 100644 --- a/genprotimg/boot/stage3a_init.S +++ b/genprotimg/boot/stage3a_init.S @@ -21,6 +21,8 @@ _init: * kernel command line and the address and size of the * ramdisk. Simply ignore this by starting at 0x11000. */ - lgfi %r1, STAGE3A_ENTRY + basr %r13, 0 +.Lbase: llgf %r1, .Lstage3a_entry - .Lbase(%r13) br %r1 +.Lstage3a_entry: .long STAGE3A_ENTRY .previous diff --git a/genprotimg/boot/stage3b_reloc.S b/genprotimg/boot/stage3b_reloc.S index 7b2242db..a7c4cf50 100644 --- a/genprotimg/boot/stage3b_reloc.S +++ b/genprotimg/boot/stage3b_reloc.S @@ -31,12 +31,12 @@ stage3b_reloc_start: sigp %r1, %r0, SIGP_SET_ARCHITECTURE sam64 -.copy_stage3b: /* Location of stage3b in memory */ larl %r8, stage3b_start /* Destination for stage3b */ - lgfi %r9, STAGE3B_LOAD_ADDRESS + basr %r13, 0 +.Lbase: llgf %r9, .Lstage3b_load_address - .Lbase(%r13) /* Size of stage3b */ lghi %r11, stage3b_end - stage3b_start @@ -45,8 +45,10 @@ stage3b_reloc_start: MEMCPY %r9, %r8, %r11 /* Branch to STAGE3B_ENTRY */ - lgfi %r9, STAGE3B_ENTRY + llgf %r9, .Lstage3b_entry - .Lbase(%r13) br %r9 +.Lstage3b_load_address: .long STAGE3B_LOAD_ADDRESS +.Lstage3b_entry: .long STAGE3B_ENTRY stage3b_start: .incbin "stage3b.bin" stage3b_end: