mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 13:37:10 +00:00
acrn-config: dump iomem info from /proc/iomem
Need more information from iomem, so dump all the iomem information from /proc/iomem to instead of system ram information. Tracked-On: #4569 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Victor Sun <victor.sun@intel.com> Acked-by: Terry Zou <terry.zou@intel.com>
This commit is contained in:
parent
8e7b80fcb2
commit
e7726944b1
@ -61,9 +61,12 @@ def get_ram_range():
|
|||||||
# read system ram from board_info.xml
|
# read system ram from board_info.xml
|
||||||
ram_range = {}
|
ram_range = {}
|
||||||
|
|
||||||
sys_mem_lines = board_cfg_lib.get_info(
|
io_mem_lines = board_cfg_lib.get_info(
|
||||||
board_cfg_lib.BOARD_INFO_FILE, "<SYSTEM_RAM_INFO>", "</SYSTEM_RAM_INFO>")
|
board_cfg_lib.BOARD_INFO_FILE, "<IOMEM_INFO>", "</IOMEM_INFO>")
|
||||||
for line in sys_mem_lines:
|
|
||||||
|
for line in io_mem_lines:
|
||||||
|
if 'System RAM' not in line:
|
||||||
|
continue
|
||||||
start_addr = int(line.split('-')[0], 16)
|
start_addr = int(line.split('-')[0], 16)
|
||||||
end_addr = int(line.split('-')[1].split(':')[0], 16)
|
end_addr = int(line.split('-')[1].split(':')[0], 16)
|
||||||
mem_range = end_addr - start_addr
|
mem_range = end_addr - start_addr
|
||||||
|
@ -145,19 +145,17 @@ def dump_system_ram(config):
|
|||||||
"""This will get systemd ram which are usable
|
"""This will get systemd ram which are usable
|
||||||
:param config: file pointer that opened for writing board config information
|
:param config: file pointer that opened for writing board config information
|
||||||
"""
|
"""
|
||||||
print("\t<SYSTEM_RAM_INFO>", file=config)
|
print("\t<IOMEM_INFO>", file=config)
|
||||||
with open(MEM_PATH[0], 'rt') as mem_info:
|
with open(MEM_PATH[0], 'rt') as mem_info:
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
line = mem_info.readline().strip()
|
line = mem_info.readline().strip('\n')
|
||||||
if not line:
|
if not line:
|
||||||
break
|
break
|
||||||
|
|
||||||
pat_type = line.split(':')[1].strip()
|
print("\t{}".format(line), file=config)
|
||||||
if pat_type == "System RAM":
|
|
||||||
print("\t{}".format(line), file=config)
|
|
||||||
|
|
||||||
print("\t</SYSTEM_RAM_INFO>", file=config)
|
print("\t</IOMEM_INFO>", file=config)
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user