mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 23:57:10 +00:00
config-tools: generate ACFG_MAX_PCI_BUS_NUM based on board.xml
Extract the max pci bus number from board information and generate the common configuration macro ACFG_MAX_PCI_BUS_NUM automatically. Tracked-On: #6942 Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
12
misc/config_tools/static_allocators/board_capability.py
Normal file
12
misc/config_tools/static_allocators/board_capability.py
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import common
|
||||
|
||||
def fn(board_etree, scenario_etree, allocation_etree):
|
||||
pci_bus_nums = board_etree.xpath("//bus[@type='pci']/@address")
|
||||
common.append_node("/acrn-config/platform/MAX_PCI_BUS_NUM", hex(max(map(lambda x: int(x, 16), pci_bus_nums)) + 1), allocation_etree)
|
||||
Reference in New Issue
Block a user