From 2f6abbe752b79e68e6c7557d9ea11165a825390c Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Wed, 6 Jan 2021 11:15:13 +0800 Subject: [PATCH] acrn-config: add XSLT scripts to transform XMLs to config.[h|mk] In order to remove Kconfig from the build process, acrn-config shall transform XML configuration files to config.h and config.mk by itself. This patch adds XSLT scripts that do the trick. Unfortunately, the scenario XML file along is not sufficient to generate config.h and config.mk, though. In addition to resource allocation (i.e. allocating physical RAM for the hypervisor), the transformation also need to do the following: 1. Translate UART info in board XML into several configuration entries depending on the UART selected in the scenario XML. 2. Use the MAX_MSIX_TABLE_NUM value in the board XML if the scenario XML does not specify it. In order to use XSLT to transform both XMLs in one shot, a template is provided to create another XML that includes (using XInclude) both board and scenario XMLs as sub-nodes. It will be instantiated once the transformations are integrated in the following patch. v2: * Add `allocation.xml` to `unified.xml` to include the results from static allocation. * Use HV_RAM_START and HV_RAM_SIZE in allocation results if they are not explicitly specified in the scenario XML. Tracked-On: #5644 Signed-off-by: Junjie Mao --- hypervisor/scripts/makefile/unified.xml.in | 17 ++ misc/acrn-config/xforms/config.h.xsl | 68 +++++ misc/acrn-config/xforms/config.mk.xsl | 70 +++++ misc/acrn-config/xforms/config_common.xsl | 338 +++++++++++++++++++++ 4 files changed, 493 insertions(+) create mode 100644 hypervisor/scripts/makefile/unified.xml.in create mode 100644 misc/acrn-config/xforms/config.h.xsl create mode 100644 misc/acrn-config/xforms/config.mk.xsl create mode 100644 misc/acrn-config/xforms/config_common.xsl diff --git a/hypervisor/scripts/makefile/unified.xml.in b/hypervisor/scripts/makefile/unified.xml.in new file mode 100644 index 000000000..45de6fa93 --- /dev/null +++ b/hypervisor/scripts/makefile/unified.xml.in @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + diff --git a/misc/acrn-config/xforms/config.h.xsl b/misc/acrn-config/xforms/config.h.xsl new file mode 100644 index 000000000..eff2ee96a --- /dev/null +++ b/misc/acrn-config/xforms/config.h.xsl @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + #ifndef CONFIG_H + #define CONFIG_H + + + + + #endif + + + + + + + + #define CONFIG_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/acrn-config/xforms/config.mk.xsl b/misc/acrn-config/xforms/config.mk.xsl new file mode 100644 index 000000000..8b88da702 --- /dev/null +++ b/misc/acrn-config/xforms/config.mk.xsl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + CONFIG_ + + = + + + + + + + + + + + + + + + + + + + + + + + + + # CONFIG_ + + is not set + + + + + + + + + + + + + + + diff --git a/misc/acrn-config/xforms/config_common.xsl b/misc/acrn-config/xforms/config_common.xsl new file mode 100644 index 000000000..1a0c26cf0 --- /dev/null +++ b/misc/acrn-config/xforms/config_common.xsl @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0b + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +