[PATCH 3/5] bsps/sparc: Unifiy stack initialization

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Jun 8 09:45:19 UTC 2021


On 08/06/2021 11:20, Sebastian Huber wrote:
> Initialize the stacks in start.S in one place and identical to
> _CPU_Context_Initialize().
> ---
>   bsps/sparc/shared/start/start.S | 14 ++++++--------
>   1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/bsps/sparc/shared/start/start.S b/bsps/sparc/shared/start/start.S
> index 369ef72a94..4922a97d6d 100644
> --- a/bsps/sparc/shared/start/start.S
> +++ b/bsps/sparc/shared/start/start.S
> @@ -306,13 +306,12 @@ SYM(hard_reset):
>   	 nop
>   
>   	ld	[%g6 + PER_CPU_INTERRUPT_STACK_HIGH], %sp ! set stack pointer
> -	sub	%sp, 4, %sp		! stack starts at end of area - 4
> -	andn	%sp, 0x0f, %sp		! align stack on 16-byte boundary
> +	andn	%sp, CPU_STACK_ALIGNMENT - 1, %sp
> +	sub	%sp, SPARC_MINIMUM_STACK_FRAME_SIZE, %sp
>   	mov	%sp, %fp		! set frame pointer
>   
> -	mov	%g6, %o0
>   	call	SYM(bsp_start_on_secondary_processor) ! does not return
> -	 sub	%sp, SPARC_MINIMUM_STACK_FRAME_SIZE, %sp
> +	 mov	%g6, %i0

Sorry, this should be "mov %g6, %o0".

>   .Lbootcpu:
>   	st	%o0, [%o1]
>   #endif
> @@ -326,8 +325,8 @@ SYM(hard_reset):
>   #endif
>   	set	SYM(_ISR_Stack_area_begin), %sp
>   	add	%sp, %g5, %sp
> -	sub	%sp, 4, %sp		! stack starts at end of area - 4
> -	andn	%sp, 0x0f, %sp		! align stack on 16-byte boundary
> +	andn	%sp, CPU_STACK_ALIGNMENT - 1, %sp
> +	sub	%sp, SPARC_MINIMUM_STACK_FRAME_SIZE, %sp
>           mov     %sp, %fp                ! Set frame pointer
>           nop
>   
> @@ -346,8 +345,7 @@ SYM(hard_reset):
>           bleu,a .Lzerobss
>           nop
>   
> -        mov     %g0, %o0                ! command line
>           call    SYM(boot_card)          ! does not return
> -         sub     %sp, 0x60, %sp         ! room for boot_card to save args
> +         mov    %g0, %i0                ! command line

Sorry, this should be "mov %g0, %o0".

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list