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 Alex Pavey committed Mar 10, 2023
1 parent db06407 commit c76ad13
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arm_vm_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ function(DeclareCAmkESARMVM init_component)
TEMPLATE_SOURCES
seL4AllocatorMempool.template.c
seL4VMParameters.template.c
camkesArmVM.template.c
TEMPLATE_HEADERS
seL4AllocatorMempool.template.h
seL4VMParameters.template.h
camkesArmVM.template.h
)

if(VmVirtioNetArping OR VmVirtioNetVirtqueue OR VmVirtioConsole)
Expand Down
23 changes: 23 additions & 0 deletions templates/camkesArmVM.template.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2022, DornerWorks
*
* SPDX-License-Identifier: BSD-2-Clause
*/

#include <camkes.h>

/*- if 'pcpus' in configuration[me.name].keys() -*/
/*- for c in configuration[me.name].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 configuration[me.name].keys() -*/
return /*? len(configuration[me.name].get('pcpus')) ?*/;
/*- else -*/
return 0;
/*- endif -*/
}
7 changes: 7 additions & 0 deletions templates/camkesArmVM.template.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright 2022, DornerWorks
*
* SPDX-License-Identifier: BSD-2-Clause
*/

int get_instance_size_pcpus_list(void);

0 comments on commit c76ad13

Please sign in to comment.