Skip to content

Commit

Permalink
vm_arm: add method to get size of VM's pcpu list
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Pavey <[email protected]>
  • Loading branch information
Alex Pavey authored and chrisguikema committed Feb 1, 2024
1 parent 8ac18f0 commit 727df13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions templates/seL4VMParameters.template.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,19 @@ const vm_config_t vm_config = {
/*- endif -*/

};

/*- if 'pcpus' in config.keys() -*/
/*- for c in config.get('pcpus') -*/
#if (/*? c ?*/ >= CONFIG_MAX_NUM_NODES)
#error "Invalid CPU number /*? c ?*/ in PCPU list of /*? me.name ?*/"
#endif
/*- endfor -*/
/*- endif -*/

int get_instance_size_pcpus_list(void) {
/*- if 'pcpus' in config.keys() -*/
return /*? len(config.get('pcpus')) ?*/;
/*- else -*/
return 0;
/*- endif -*/
}
2 changes: 2 additions & 0 deletions templates/seL4VMParameters.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ typedef struct {
} vm_config_t;

extern const vm_config_t vm_config;

int get_instance_size_pcpus_list(void);

0 comments on commit 727df13

Please sign in to comment.