Skip to content

Commit

Permalink
smc_cap: Simplify camkes_get_smc_cap generation
Browse files Browse the repository at this point in the history
Just use `allowed_smc_functions` to define whether a component can
make SMC calls or not.

Signed-off-by: Robbie VanVossen <[email protected]>
  • Loading branch information
Furao authored and kent-mcleod committed Aug 29, 2023
1 parent ea97c37 commit add3915
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions camkes/templates/component.common.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,13 @@ 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 -*/
/*- 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) -*/
/*- for func_id in configuration[me.name].get('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 -*/
/*- endif -*/
/*- endfor -*/
default:
cap = 0;
}
Expand Down

0 comments on commit add3915

Please sign in to comment.