mirror of
https://github.com/seL4/seL4.git
synced 2026-04-05 06:49:54 +00:00
tools: add conditional invocation label defines
This commit is contained in:
@@ -38,8 +38,14 @@ INVOCATION_TEMPLATE = COMMON_HEADER + """
|
||||
|
||||
enum invocation_label {
|
||||
InvalidInvocation,
|
||||
{{for label in invocations}}
|
||||
{{for label, condition in invocations}}
|
||||
{{if condition}}
|
||||
#if {{condition}}
|
||||
{{endif}}
|
||||
{{label}},
|
||||
{{if condition}}
|
||||
#endif
|
||||
{{endif}}
|
||||
{{endfor}}
|
||||
nInvocationLabels
|
||||
};
|
||||
@@ -60,9 +66,21 @@ SEL4_ARCH_INVOCATION_TEMPLATE = COMMON_HEADER + """
|
||||
#include <api/invocation.h>
|
||||
{{endif}}
|
||||
|
||||
{{py:first = 1}}
|
||||
enum sel4_arch_invocation_label {
|
||||
{{for loop, label in looper(invocations)}}
|
||||
{{label}} = nInvocationLabels + {{loop.index}},
|
||||
{{for label, condition in invocations}}
|
||||
{{if condition}}
|
||||
#if {{condition}}
|
||||
{{endif}}
|
||||
{{if first}}
|
||||
{{py:first = 0}}
|
||||
{{label}} = nInvocationLabels,
|
||||
{{else}}
|
||||
{{label}},
|
||||
{{endif}}
|
||||
{{if condition}}
|
||||
#endif
|
||||
{{endif}}
|
||||
{{endfor}}
|
||||
nSeL4ArchInvocationLabels = nInvocationLabels + {{num_invocations}}
|
||||
};
|
||||
@@ -78,9 +96,21 @@ ARCH_INVOCATION_TEMPLATE = COMMON_HEADER + """
|
||||
#include <arch/api/sel4_invocation.h>
|
||||
{{endif}}
|
||||
|
||||
{{py:first = 1}}
|
||||
enum arch_invocation_label {
|
||||
{{for loop, label in looper(invocations)}}
|
||||
{{label}} = nSeL4ArchInvocationLabels + {{loop.index}},
|
||||
{{for label, condition in invocations}}
|
||||
{{if condition}}
|
||||
#if {{condition}}
|
||||
{{endif}}
|
||||
{{if first}}
|
||||
{{label}} = nSeL4ArchInvocationLabels,
|
||||
{{py:first = 0}}
|
||||
{{else}}
|
||||
{{label}},
|
||||
{{endif}}
|
||||
{{if condition}}
|
||||
#endif
|
||||
{{endif}}
|
||||
{{endfor}}
|
||||
nArchInvocationLabels = nSeL4ArchInvocationLabels + {{num_invocations}}
|
||||
};
|
||||
@@ -114,7 +144,7 @@ def parse_xml(xml_file):
|
||||
|
||||
invocation_labels = []
|
||||
for method in doc.getElementsByTagName("method"):
|
||||
invocation_labels.append(str(method.getAttribute("id")))
|
||||
invocation_labels.append((str(method.getAttribute("id")), str(method.getAttribute("config"))))
|
||||
|
||||
return invocation_labels
|
||||
|
||||
|
||||
Reference in New Issue
Block a user