hv: coding style: refine initialize_trusty to one exit

1) Move data copy out of initialize_trusty
2) Fix procedure has more than one exit point

Tracked-On: #2120
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-12-19 23:41:29 +08:00
committed by Eddie Dong
parent 8a55f03823
commit 1dca17cd29
3 changed files with 39 additions and 41 deletions

View File

@@ -127,7 +127,7 @@ struct trusty_startup_param {
};
void switch_world(struct acrn_vcpu *vcpu, int32_t next_world);
bool initialize_trusty(struct acrn_vcpu *vcpu, uint64_t param);
bool initialize_trusty(struct acrn_vcpu *vcpu, const struct trusty_boot_param *boot_param);
void destroy_secure_world(struct acrn_vm *vm, bool need_clr_mem);
void save_sworld_context(struct acrn_vcpu *vcpu);
void restore_sworld_context(struct acrn_vcpu *vcpu);