Skip to content

Commit

Permalink
Save space in Bootloader image with single thread and task end
Browse files Browse the repository at this point in the history
Bootloader checks for only being a single thread and handles other
thread instances.  It also has task end code to suport this checking.
This code can be removed to save space.

Change-Id: I906740efec02e1799a36edd82963d038fd42ce7e
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40286
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
mgloff authored and wghoffa committed May 23, 2017
1 parent 280883b commit 20ceedc
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions src/bootloader/bl_start.S
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,7 @@ _start:

_start_postmsr:

;// Determine if this is the first thread.
li r4, 2
;// Read spinlock value.
lis r2, kernel_other_thread_spinlock@h
ori r2, r2, kernel_other_thread_spinlock@l
lwsync
1:
ldarx r3, 0, r2
cmpwi r3, 0 ;// Non-zero means this thread wasn't first.
bnel cr0, _other_thread_error ;// Handle having multiple threads started
stdcx. r4, 0, r2 ;// Attempt to store 2.
bne 1b ;// Loop until sucessful at stwcx.
isync

;// _main:
Expand Down Expand Up @@ -313,31 +302,6 @@ HYPE_INTERRUPT(hype_fac_unavail, HBBL_hype_fac_unavail)
STD_INTERRUPT(softpatch, HBBL_softpatch)
STD_INTERRUPT(debug, HBBL_debug)

;// @fn _other_thread_error:
;// Used for threads other than first to handle this unexpected condition.
_other_thread_error:
;// Read spinlock value.
lis r2, kernel_other_thread_spinlock@h
ori r2, r2, kernel_other_thread_spinlock@l
1:
ld r3, 0(r2)
;// Loop until value is 1...
cmpi cr0, r3, 1
beq task_end_stub ;// End the multiple threads
or 1,1,1 ;// Lower thread priority.
b 1b


;// @fn task_end_stub
;// Stub to call a TASK_END syscall in the event that a task 'returns' from
;// its entry point. We cannot call task_end() directly because profiling
;// inserts garbage code into the task_end C function.
.global task_end_stub
task_end_stub:
mr r4, r3 ;// Move current rc (r3) to status value (r4)
li r3, 2 ;// TASK_END -> r3 (syscall number)
sc


;// @fn enterHBB
;// Leave the Bootloader and switch to the Hostboot Base (HBB).
Expand Down Expand Up @@ -388,11 +352,6 @@ switchToHBB:

.section .data

.balign 8
.global kernel_other_thread_spinlock
kernel_other_thread_spinlock:
.space 8

.balign 16
.global hbi_ImageId
hbi_ImageId:
Expand Down

0 comments on commit 20ceedc

Please sign in to comment.