mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 05:02:24 +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
|
||||
ram_range = {}
|
||||
|
||||
sys_mem_lines = board_cfg_lib.get_info(
|
||||
board_cfg_lib.BOARD_INFO_FILE, "<SYSTEM_RAM_INFO>", "</SYSTEM_RAM_INFO>")
|
||||
for line in sys_mem_lines:
|
||||
io_mem_lines = board_cfg_lib.get_info(
|
||||
board_cfg_lib.BOARD_INFO_FILE, "<IOMEM_INFO>", "</IOMEM_INFO>")
|
||||
|
||||
for line in io_mem_lines:
|
||||
if 'System RAM' not in line:
|
||||
continue
|
||||
start_addr = int(line.split('-')[0], 16)
|
||||
end_addr = int(line.split('-')[1].split(':')[0], 16)
|
||||
mem_range = end_addr - start_addr
|
||||
|
@ -145,19 +145,17 @@ def dump_system_ram(config):
|
||||
"""This will get systemd ram which are usable
|
||||
: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:
|
||||
|
||||
while True:
|
||||
line = mem_info.readline().strip()
|
||||
line = mem_info.readline().strip('\n')
|
||||
if not line:
|
||||
break
|
||||
|
||||
pat_type = line.split(':')[1].strip()
|
||||
if pat_type == "System RAM":
|
||||
print("\t{}".format(line), file=config)
|
||||
print("\t{}".format(line), file=config)
|
||||
|
||||
print("\t</SYSTEM_RAM_INFO>", file=config)
|
||||
print("\t</IOMEM_INFO>", file=config)
|
||||
print("", file=config)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user