mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 13:55:56 +00:00
Pass the args to the BL3-3 entrypoint
At present the arguments for BL3-3 in the entry_point_info structure are not being transferred to X0-X7 before starting execution of this image This patch saves the args for BL3-3 into cpu context used for its entry Fixes ARM-software/tf-issues#172 Change-Id: I001b4b9bff6a264336f0d01d377619ae719f928b
This commit is contained in:
parent
05b6edfe26
commit
f05cb4a764
1 changed files with 14 additions and 2 deletions
|
@ -37,6 +37,7 @@
|
||||||
#include <platform.h>
|
#include <platform.h>
|
||||||
#include <runtime_svc.h>
|
#include <runtime_svc.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* This function pointer is used to initialise the BL32 image. It's initialized
|
* This function pointer is used to initialise the BL32 image. It's initialized
|
||||||
|
@ -154,6 +155,8 @@ void bl31_prepare_next_image_entry()
|
||||||
{
|
{
|
||||||
entry_point_info_t *next_image_info;
|
entry_point_info_t *next_image_info;
|
||||||
uint32_t scr, image_type;
|
uint32_t scr, image_type;
|
||||||
|
cpu_context_t *ctx;
|
||||||
|
gp_regs_t *gp_regs;
|
||||||
|
|
||||||
/* Determine which image to execute next */
|
/* Determine which image to execute next */
|
||||||
image_type = bl31_get_next_image_type();
|
image_type = bl31_get_next_image_type();
|
||||||
|
@ -167,6 +170,7 @@ void bl31_prepare_next_image_entry()
|
||||||
/* Program EL3 registers to enable entry into the next EL */
|
/* Program EL3 registers to enable entry into the next EL */
|
||||||
next_image_info = bl31_plat_get_next_image_ep_info(image_type);
|
next_image_info = bl31_plat_get_next_image_ep_info(image_type);
|
||||||
assert(next_image_info);
|
assert(next_image_info);
|
||||||
|
assert(image_type == GET_SECURITY_STATE(next_image_info->h.attr));
|
||||||
|
|
||||||
scr = read_scr();
|
scr = read_scr();
|
||||||
scr &= ~SCR_NS_BIT;
|
scr &= ~SCR_NS_BIT;
|
||||||
|
@ -182,13 +186,21 @@ void bl31_prepare_next_image_entry()
|
||||||
* Tell the context mgmt. library to ensure that SP_EL3 points to
|
* Tell the context mgmt. library to ensure that SP_EL3 points to
|
||||||
* the right context to exit from EL3 correctly.
|
* the right context to exit from EL3 correctly.
|
||||||
*/
|
*/
|
||||||
cm_set_el3_eret_context(GET_SECURITY_STATE(next_image_info->h.attr),
|
cm_set_el3_eret_context(image_type,
|
||||||
next_image_info->pc,
|
next_image_info->pc,
|
||||||
next_image_info->spsr,
|
next_image_info->spsr,
|
||||||
scr);
|
scr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Save the args generated in BL2 for the image in the right context
|
||||||
|
* used on its entry
|
||||||
|
*/
|
||||||
|
ctx = cm_get_context(read_mpidr(), image_type);
|
||||||
|
gp_regs = get_gpregs_ctx(ctx);
|
||||||
|
memcpy(gp_regs, (void *)&next_image_info->args, sizeof(aapcs64_params_t));
|
||||||
|
|
||||||
/* Finally set the next context */
|
/* Finally set the next context */
|
||||||
cm_set_next_eret_context(GET_SECURITY_STATE(next_image_info->h.attr));
|
cm_set_next_eret_context(image_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
Loading…
Add table
Reference in a new issue