Skip to content

Commit

Permalink
smc_cap: Specify SMC calls as badges in a list
Browse files Browse the repository at this point in the history
Signed-off-by: Robbie VanVossen <[email protected]>
  • Loading branch information
Alex Pavey authored and kent-mcleod committed Aug 29, 2023
1 parent b325158 commit ea97c37
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions camkes/templates/component.common.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,27 @@ int get_instance_affinity(void) {
}

#ifdef CONFIG_ALLOW_SMC_CALLS
seL4_CPtr camkes_get_smc_cap(seL4_Word smc_call){
seL4_CPtr cap;
switch(smc_call) {
/*# ARM SMC cap allocation #*/
/*- if 'allow_smc' in configuration[me.name].keys() -*/
/*- if configuration[me.name].get('allow_smc') == true -*/
/*- set smc_cap = alloc(name='smc', type=seL4_ARMSMC) -*/
/*- else -*/
/*- set smc_cap = 0 -*/
/*- if 'allowed_smc_functions' in configuration[me.name].keys() -*/
/*- for func_id in configuration[me.name].allowed_smc_functions -*/
/*- set smc_cap = alloc(name='smc_%d' % func_id, type=seL4_ARMSMC, badge=func_id) -*/

case /*? func_id ?*/:
cap = /*? smc_cap ?*/;
break;
/*- endfor -*/
/*- endif -*/
/*- endif -*/
/*- else -*/
/*- set smc_cap = 0 -*/
/*- endif -*/

seL4_CPtr camkes_get_smc_cap(){
return /*? smc_cap ?*/;
default:
cap = 0;
}
return cap;
}
#endif

Expand Down

0 comments on commit ea97c37

Please sign in to comment.