Unverified Commit ccd130ea authored by danh-arm's avatar danh-arm Committed by GitHub
Browse files

Merge pull request #1255 from masahir0y/int-ll64

Use consistent int-ll64 typedefs for aarch32 and aarch64
parents a8d9550b 0a2d5b43
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* The target cpu is being turned on. Allow the OPTEED/OPTEE to perform any * The target cpu is being turned on. Allow the OPTEED/OPTEE to perform any
* actions needed. Nothing at the moment. * actions needed. Nothing at the moment.
******************************************************************************/ ******************************************************************************/
static void opteed_cpu_on_handler(uint64_t target_cpu) static void opteed_cpu_on_handler(u_register_t target_cpu)
{ {
} }
...@@ -24,7 +24,7 @@ static void opteed_cpu_on_handler(uint64_t target_cpu) ...@@ -24,7 +24,7 @@ static void opteed_cpu_on_handler(uint64_t target_cpu)
* This cpu is being turned off. Allow the OPTEED/OPTEE to perform any actions * This cpu is being turned off. Allow the OPTEED/OPTEE to perform any actions
* needed * needed
******************************************************************************/ ******************************************************************************/
static int32_t opteed_cpu_off_handler(uint64_t unused) static int32_t opteed_cpu_off_handler(u_register_t unused)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -57,7 +57,7 @@ static int32_t opteed_cpu_off_handler(uint64_t unused) ...@@ -57,7 +57,7 @@ static int32_t opteed_cpu_off_handler(uint64_t unused)
* This cpu is being suspended. S-EL1 state must have been saved in the * This cpu is being suspended. S-EL1 state must have been saved in the
* resident cpu (mpidr format) if it is a UP/UP migratable OPTEE. * resident cpu (mpidr format) if it is a UP/UP migratable OPTEE.
******************************************************************************/ ******************************************************************************/
static void opteed_cpu_suspend_handler(uint64_t max_off_pwrlvl) static void opteed_cpu_suspend_handler(u_register_t max_off_pwrlvl)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -87,7 +87,7 @@ static void opteed_cpu_suspend_handler(uint64_t max_off_pwrlvl) ...@@ -87,7 +87,7 @@ static void opteed_cpu_suspend_handler(uint64_t max_off_pwrlvl)
* after initialising minimal architectural state that guarantees safe * after initialising minimal architectural state that guarantees safe
* execution. * execution.
******************************************************************************/ ******************************************************************************/
static void opteed_cpu_on_finish_handler(uint64_t unused) static void opteed_cpu_on_finish_handler(u_register_t unused)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -123,7 +123,7 @@ static void opteed_cpu_on_finish_handler(uint64_t unused) ...@@ -123,7 +123,7 @@ static void opteed_cpu_on_finish_handler(uint64_t unused)
* completed the preceding suspend call. Use that context to program an entry * completed the preceding suspend call. Use that context to program an entry
* into OPTEE to allow it to do any remaining book keeping * into OPTEE to allow it to do any remaining book keeping
******************************************************************************/ ******************************************************************************/
static void opteed_cpu_suspend_finish_handler(uint64_t max_off_pwrlvl) static void opteed_cpu_suspend_finish_handler(u_register_t max_off_pwrlvl)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -154,7 +154,7 @@ static void opteed_cpu_suspend_finish_handler(uint64_t max_off_pwrlvl) ...@@ -154,7 +154,7 @@ static void opteed_cpu_suspend_finish_handler(uint64_t max_off_pwrlvl)
* Return the type of OPTEE the OPTEED is dealing with. Report the current * Return the type of OPTEE the OPTEED is dealing with. Report the current
* resident cpu (mpidr format) if it is a UP/UP migratable OPTEE. * resident cpu (mpidr format) if it is a UP/UP migratable OPTEE.
******************************************************************************/ ******************************************************************************/
static int32_t opteed_cpu_migrate_info(uint64_t *resident_cpu) static int32_t opteed_cpu_migrate_info(u_register_t *resident_cpu)
{ {
return OPTEE_MIGRATE_INFO; return OPTEE_MIGRATE_INFO;
} }
......
...@@ -44,14 +44,14 @@ DEFINE_SVC_UUID(tlk_uuid, ...@@ -44,14 +44,14 @@ DEFINE_SVC_UUID(tlk_uuid,
0xbd11e9c9, 0x2bba, 0x52ee, 0xb1, 0x72, 0xbd11e9c9, 0x2bba, 0x52ee, 0xb1, 0x72,
0x46, 0x1f, 0xba, 0x97, 0x7f, 0x63); 0x46, 0x1f, 0xba, 0x97, 0x7f, 0x63);
int32_t tlkd_init(void); static int32_t tlkd_init(void);
/******************************************************************************* /*******************************************************************************
* Secure Payload Dispatcher setup. The SPD finds out the SP entrypoint and type * Secure Payload Dispatcher setup. The SPD finds out the SP entrypoint and type
* (aarch32/aarch64) if not already known and initialises the context for entry * (aarch32/aarch64) if not already known and initialises the context for entry
* into the SP for its initialisation. * into the SP for its initialisation.
******************************************************************************/ ******************************************************************************/
int32_t tlkd_setup(void) static int32_t tlkd_setup(void)
{ {
entry_point_info_t *tlk_ep_info; entry_point_info_t *tlk_ep_info;
...@@ -100,7 +100,7 @@ int32_t tlkd_setup(void) ...@@ -100,7 +100,7 @@ int32_t tlkd_setup(void)
* used. This function performs a synchronous entry into the Secure payload. * used. This function performs a synchronous entry into the Secure payload.
* The SP passes control back to this routine through a SMC. * The SP passes control back to this routine through a SMC.
******************************************************************************/ ******************************************************************************/
int32_t tlkd_init(void) static int32_t tlkd_init(void)
{ {
entry_point_info_t *tlk_entry_point; entry_point_info_t *tlk_entry_point;
...@@ -133,14 +133,14 @@ int32_t tlkd_init(void) ...@@ -133,14 +133,14 @@ int32_t tlkd_init(void)
* will also return any information that the secure payload needs to do the * will also return any information that the secure payload needs to do the
* work assigned to it. * work assigned to it.
******************************************************************************/ ******************************************************************************/
uint64_t tlkd_smc_handler(uint32_t smc_fid, static uintptr_t tlkd_smc_handler(uint32_t smc_fid,
uint64_t x1, u_register_t x1,
uint64_t x2, u_register_t x2,
uint64_t x3, u_register_t x3,
uint64_t x4, u_register_t x4,
void *cookie, void *cookie,
void *handle, void *handle,
uint64_t flags) u_register_t flags)
{ {
cpu_context_t *ns_cpu_context; cpu_context_t *ns_cpu_context;
gp_regs_t *gp_regs; gp_regs_t *gp_regs;
......
...@@ -22,7 +22,7 @@ extern tlk_context_t tlk_ctx; ...@@ -22,7 +22,7 @@ extern tlk_context_t tlk_ctx;
* Return the type of payload TLKD is dealing with. Report the current * Return the type of payload TLKD is dealing with. Report the current
* resident cpu (mpidr format) if it is a UP/UP migratable payload. * resident cpu (mpidr format) if it is a UP/UP migratable payload.
******************************************************************************/ ******************************************************************************/
static int32_t cpu_migrate_info(uint64_t *resident_cpu) static int32_t cpu_migrate_info(u_register_t *resident_cpu)
{ {
/* the payload runs only on CPU0 */ /* the payload runs only on CPU0 */
*resident_cpu = MPIDR_CPU0; *resident_cpu = MPIDR_CPU0;
...@@ -35,7 +35,7 @@ static int32_t cpu_migrate_info(uint64_t *resident_cpu) ...@@ -35,7 +35,7 @@ static int32_t cpu_migrate_info(uint64_t *resident_cpu)
* This cpu is being suspended. Inform TLK of the SYSTEM_SUSPEND event, so * This cpu is being suspended. Inform TLK of the SYSTEM_SUSPEND event, so
* that it can pass this information to its Trusted Apps. * that it can pass this information to its Trusted Apps.
******************************************************************************/ ******************************************************************************/
static void cpu_suspend_handler(uint64_t suspend_level) static void cpu_suspend_handler(u_register_t suspend_level)
{ {
gp_regs_t *gp_regs; gp_regs_t *gp_regs;
int cpu = read_mpidr() & MPIDR_CPU_MASK; int cpu = read_mpidr() & MPIDR_CPU_MASK;
...@@ -67,7 +67,7 @@ static void cpu_suspend_handler(uint64_t suspend_level) ...@@ -67,7 +67,7 @@ static void cpu_suspend_handler(uint64_t suspend_level)
* This cpu is being resumed. Inform TLK of the SYSTEM_SUSPEND exit, so * This cpu is being resumed. Inform TLK of the SYSTEM_SUSPEND exit, so
* that it can pass this information to its Trusted Apps. * that it can pass this information to its Trusted Apps.
******************************************************************************/ ******************************************************************************/
static void cpu_resume_handler(uint64_t suspend_level) static void cpu_resume_handler(u_register_t suspend_level)
{ {
gp_regs_t *gp_regs; gp_regs_t *gp_regs;
int cpu = read_mpidr() & MPIDR_CPU_MASK; int cpu = read_mpidr() & MPIDR_CPU_MASK;
......
...@@ -53,7 +53,7 @@ struct args { ...@@ -53,7 +53,7 @@ struct args {
uint64_t r7; uint64_t r7;
}; };
struct trusty_cpu_ctx trusty_cpu_ctx[PLATFORM_CORE_COUNT]; static struct trusty_cpu_ctx trusty_cpu_ctx[PLATFORM_CORE_COUNT];
struct args trusty_init_context_stack(void **sp, void *new_stack); struct args trusty_init_context_stack(void **sp, void *new_stack);
struct args trusty_context_switch_helper(void **sp, void *smc_params); struct args trusty_context_switch_helper(void **sp, void *smc_params);
...@@ -159,7 +159,7 @@ static uint64_t trusty_set_fiq_handler(void *handle, uint64_t cpu, ...@@ -159,7 +159,7 @@ static uint64_t trusty_set_fiq_handler(void *handle, uint64_t cpu,
struct trusty_cpu_ctx *ctx; struct trusty_cpu_ctx *ctx;
if (cpu >= PLATFORM_CORE_COUNT) { if (cpu >= PLATFORM_CORE_COUNT) {
ERROR("%s: cpu %ld >= %d\n", __func__, cpu, PLATFORM_CORE_COUNT); ERROR("%s: cpu %lld >= %d\n", __func__, cpu, PLATFORM_CORE_COUNT);
return SM_ERR_INVALID_PARAMETERS; return SM_ERR_INVALID_PARAMETERS;
} }
...@@ -191,7 +191,7 @@ static uint64_t trusty_fiq_exit(void *handle, uint64_t x1, uint64_t x2, uint64_t ...@@ -191,7 +191,7 @@ static uint64_t trusty_fiq_exit(void *handle, uint64_t x1, uint64_t x2, uint64_t
ret = trusty_context_switch(NON_SECURE, SMC_FC_FIQ_EXIT, 0, 0, 0); ret = trusty_context_switch(NON_SECURE, SMC_FC_FIQ_EXIT, 0, 0, 0);
if (ret.r0 != 1) { if (ret.r0 != 1) {
INFO("%s(%p) SMC_FC_FIQ_EXIT returned unexpected value, %ld\n", INFO("%s(%p) SMC_FC_FIQ_EXIT returned unexpected value, %lld\n",
__func__, handle, ret.r0); __func__, handle, ret.r0);
} }
...@@ -212,14 +212,14 @@ static uint64_t trusty_fiq_exit(void *handle, uint64_t x1, uint64_t x2, uint64_t ...@@ -212,14 +212,14 @@ static uint64_t trusty_fiq_exit(void *handle, uint64_t x1, uint64_t x2, uint64_t
SMC_RET0(handle); SMC_RET0(handle);
} }
static uint64_t trusty_smc_handler(uint32_t smc_fid, static uintptr_t trusty_smc_handler(uint32_t smc_fid,
uint64_t x1, u_register_t x1,
uint64_t x2, u_register_t x2,
uint64_t x3, u_register_t x3,
uint64_t x4, u_register_t x4,
void *cookie, void *cookie,
void *handle, void *handle,
uint64_t flags) u_register_t flags)
{ {
struct args ret; struct args ret;
uint32_t vmid = 0; uint32_t vmid = 0;
...@@ -331,7 +331,7 @@ static void trusty_cpu_suspend(uint32_t off) ...@@ -331,7 +331,7 @@ static void trusty_cpu_suspend(uint32_t off)
ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_SUSPEND, off, 0, 0); ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_SUSPEND, off, 0, 0);
if (ret.r0 != 0) { if (ret.r0 != 0) {
INFO("%s: cpu %d, SMC_FC_CPU_SUSPEND returned unexpected value, %ld\n", INFO("%s: cpu %d, SMC_FC_CPU_SUSPEND returned unexpected value, %lld\n",
__func__, plat_my_core_pos(), ret.r0); __func__, plat_my_core_pos(), ret.r0);
} }
} }
...@@ -342,19 +342,19 @@ static void trusty_cpu_resume(uint32_t on) ...@@ -342,19 +342,19 @@ static void trusty_cpu_resume(uint32_t on)
ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_RESUME, on, 0, 0); ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_RESUME, on, 0, 0);
if (ret.r0 != 0) { if (ret.r0 != 0) {
INFO("%s: cpu %d, SMC_FC_CPU_RESUME returned unexpected value, %ld\n", INFO("%s: cpu %d, SMC_FC_CPU_RESUME returned unexpected value, %lld\n",
__func__, plat_my_core_pos(), ret.r0); __func__, plat_my_core_pos(), ret.r0);
} }
} }
static int32_t trusty_cpu_off_handler(uint64_t unused) static int32_t trusty_cpu_off_handler(u_register_t unused)
{ {
trusty_cpu_suspend(1); trusty_cpu_suspend(1);
return 0; return 0;
} }
static void trusty_cpu_on_finish_handler(uint64_t unused) static void trusty_cpu_on_finish_handler(u_register_t unused)
{ {
struct trusty_cpu_ctx *ctx = get_trusty_ctx(); struct trusty_cpu_ctx *ctx = get_trusty_ctx();
...@@ -365,12 +365,12 @@ static void trusty_cpu_on_finish_handler(uint64_t unused) ...@@ -365,12 +365,12 @@ static void trusty_cpu_on_finish_handler(uint64_t unused)
} }
} }
static void trusty_cpu_suspend_handler(uint64_t unused) static void trusty_cpu_suspend_handler(u_register_t unused)
{ {
trusty_cpu_suspend(0); trusty_cpu_suspend(0);
} }
static void trusty_cpu_suspend_finish_handler(uint64_t unused) static void trusty_cpu_suspend_finish_handler(u_register_t unused)
{ {
trusty_cpu_resume(0); trusty_cpu_resume(0);
} }
......
...@@ -179,7 +179,7 @@ static uint64_t tspd_ns_interrupt_handler(uint32_t id, ...@@ -179,7 +179,7 @@ static uint64_t tspd_ns_interrupt_handler(uint32_t id,
* (aarch32/aarch64) if not already known and initialises the context for entry * (aarch32/aarch64) if not already known and initialises the context for entry
* into the SP for its initialisation. * into the SP for its initialisation.
******************************************************************************/ ******************************************************************************/
int32_t tspd_setup(void) static int32_t tspd_setup(void)
{ {
entry_point_info_t *tsp_ep_info; entry_point_info_t *tsp_ep_info;
uint32_t linear_id; uint32_t linear_id;
...@@ -273,14 +273,14 @@ int32_t tspd_init(void) ...@@ -273,14 +273,14 @@ int32_t tspd_init(void)
* will also return any information that the secure payload needs to do the * will also return any information that the secure payload needs to do the
* work assigned to it. * work assigned to it.
******************************************************************************/ ******************************************************************************/
uint64_t tspd_smc_handler(uint32_t smc_fid, static uintptr_t tspd_smc_handler(uint32_t smc_fid,
uint64_t x1, u_register_t x1,
uint64_t x2, u_register_t x2,
uint64_t x3, u_register_t x3,
uint64_t x4, u_register_t x4,
void *cookie, void *cookie,
void *handle, void *handle,
uint64_t flags) u_register_t flags)
{ {
cpu_context_t *ns_cpu_context; cpu_context_t *ns_cpu_context;
uint32_t linear_id = plat_my_core_pos(), ns; uint32_t linear_id = plat_my_core_pos(), ns;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* The target cpu is being turned on. Allow the TSPD/TSP to perform any actions * The target cpu is being turned on. Allow the TSPD/TSP to perform any actions
* needed. Nothing at the moment. * needed. Nothing at the moment.
******************************************************************************/ ******************************************************************************/
static void tspd_cpu_on_handler(uint64_t target_cpu) static void tspd_cpu_on_handler(u_register_t target_cpu)
{ {
} }
...@@ -25,7 +25,7 @@ static void tspd_cpu_on_handler(uint64_t target_cpu) ...@@ -25,7 +25,7 @@ static void tspd_cpu_on_handler(uint64_t target_cpu)
* This cpu is being turned off. Allow the TSPD/TSP to perform any actions * This cpu is being turned off. Allow the TSPD/TSP to perform any actions
* needed * needed
******************************************************************************/ ******************************************************************************/
static int32_t tspd_cpu_off_handler(uint64_t unused) static int32_t tspd_cpu_off_handler(u_register_t unused)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -64,7 +64,7 @@ static int32_t tspd_cpu_off_handler(uint64_t unused) ...@@ -64,7 +64,7 @@ static int32_t tspd_cpu_off_handler(uint64_t unused)
* This cpu is being suspended. S-EL1 state must have been saved in the * This cpu is being suspended. S-EL1 state must have been saved in the
* resident cpu (mpidr format) if it is a UP/UP migratable TSP. * resident cpu (mpidr format) if it is a UP/UP migratable TSP.
******************************************************************************/ ******************************************************************************/
static void tspd_cpu_suspend_handler(uint64_t max_off_pwrlvl) static void tspd_cpu_suspend_handler(u_register_t max_off_pwrlvl)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -100,7 +100,7 @@ static void tspd_cpu_suspend_handler(uint64_t max_off_pwrlvl) ...@@ -100,7 +100,7 @@ static void tspd_cpu_suspend_handler(uint64_t max_off_pwrlvl)
* after initialising minimal architectural state that guarantees safe * after initialising minimal architectural state that guarantees safe
* execution. * execution.
******************************************************************************/ ******************************************************************************/
static void tspd_cpu_on_finish_handler(uint64_t unused) static void tspd_cpu_on_finish_handler(u_register_t unused)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -145,7 +145,7 @@ static void tspd_cpu_on_finish_handler(uint64_t unused) ...@@ -145,7 +145,7 @@ static void tspd_cpu_on_finish_handler(uint64_t unused)
* completed the preceding suspend call. Use that context to program an entry * completed the preceding suspend call. Use that context to program an entry
* into the TSP to allow it to do any remaining book keeping * into the TSP to allow it to do any remaining book keeping
******************************************************************************/ ******************************************************************************/
static void tspd_cpu_suspend_finish_handler(uint64_t max_off_pwrlvl) static void tspd_cpu_suspend_finish_handler(u_register_t max_off_pwrlvl)
{ {
int32_t rc = 0; int32_t rc = 0;
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
...@@ -176,7 +176,7 @@ static void tspd_cpu_suspend_finish_handler(uint64_t max_off_pwrlvl) ...@@ -176,7 +176,7 @@ static void tspd_cpu_suspend_finish_handler(uint64_t max_off_pwrlvl)
* Return the type of TSP the TSPD is dealing with. Report the current resident * Return the type of TSP the TSPD is dealing with. Report the current resident
* cpu (mpidr format) if it is a UP/UP migratable TSP. * cpu (mpidr format) if it is a UP/UP migratable TSP.
******************************************************************************/ ******************************************************************************/
static int32_t tspd_cpu_migrate_info(uint64_t *resident_cpu) static int32_t tspd_cpu_migrate_info(u_register_t *resident_cpu)
{ {
return TSP_MIGRATE_INFO; return TSP_MIGRATE_INFO;
} }
......
...@@ -221,16 +221,6 @@ void tspd_init_tsp_ep_state(struct entry_point_info *tsp_entry_point, ...@@ -221,16 +221,6 @@ void tspd_init_tsp_ep_state(struct entry_point_info *tsp_entry_point,
tsp_context_t *tsp_ctx); tsp_context_t *tsp_ctx);
int tspd_abort_preempted_smc(tsp_context_t *tsp_ctx); int tspd_abort_preempted_smc(tsp_context_t *tsp_ctx);
uint64_t tspd_smc_handler(uint32_t smc_fid,
uint64_t x1,
uint64_t x2,
uint64_t x3,
uint64_t x4,
void *cookie,
void *handle,
uint64_t flags);
int32_t tspd_setup(void);
uint64_t tspd_handle_sp_preemption(void *handle); uint64_t tspd_handle_sp_preemption(void *handle);
extern tsp_context_t tspd_sp_context[TSPD_CORE_COUNT]; extern tsp_context_t tspd_sp_context[TSPD_CORE_COUNT];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment