Added parsing of memory region capability bits.

This commit is contained in:
Bahadir Balban
2009-10-03 15:34:39 +03:00
parent b2f508c8b7
commit ed9199a972
6 changed files with 79 additions and 64 deletions

View File

@@ -25,6 +25,16 @@ class Container:
self.virt_regions = 0
self.phys_regions = 0
def print_self(self):
print '\nContainer %d' % self.id
print 'Container type: %s' % self.type
print 'Container Name: %s' % self.name
print 'Container Pager lma: %s' % conv_hex(self.pager_lma)
print 'Container Pager vma: %s' % conv_hex(self.pager_vma)
print 'Container Pager size: %s' % conv_hex(self.pager_size)
print 'Container Virtual regions: %s' % self.virt_regions
print 'Container Physical regions: %s' % self.phys_regions
class configuration:
def __init__(self):
@@ -153,20 +163,6 @@ class configuration:
# Make sure elements in order for indexed accessing
self.containers.sort(self.compare_containers)
def container_print(self, c):
print '\nContainer %d' % c.id
print 'Container type: %s' % c.type
print 'Container Name: %s' % c.name
print 'Container Pager lma: %s' % conv_hex(c.pager_lma)
print 'Container Pager vma: %s' % conv_hex(c.pager_vma)
print 'Container Pager size: %s' % conv_hex(c.pager_size)
print 'Container Virtual regions: %s' % c.virt_regions
print 'Container Physical regions: %s' % c.phys_regions
def containers_print(self, containers):
for c in containers:
self.container_print(self, c)
def config_print(self):
print 'Configuration\n'
print '-------------\n'
@@ -174,7 +170,11 @@ class configuration:
print 'Platform: %s' % self.platform
print 'Symbols:\n %s' % self.all
print 'Containers: %s' % self.ncontainers
self.containers_print(self.containers)
self.containers_print()
def containers_print(self):
for c in self.containers:
c.print_self()
def configuration_save(config):
if not os.path.exists(CONFIG_SHELVE_DIR):

View File

@@ -29,6 +29,11 @@ def build_parse_options():
help = "Reset configuration file settings "
"(If you had configured before and changing the "
"rule file, this will reset existing values to default)")
parser.add_option("-s", "--save-old-config", action = "store_true",
default = False, dest = "backup_config",
help = "Backs up old configuration file settings to a .saved file"
"(Subsequent calls would overwrite. Only meaningful with -r)")
(options, args) = parser.parse_args()
@@ -45,6 +50,10 @@ def build_parse_options():
if autogen_true:
generate_container_cml(options.arch, options.ncont)
if options.reset_old_config == 1 and os.path.exists(CML2_OLDCONFIG_FILE):
print "Moving %s to unused file %s" % (CML2_OLDCONFIG_FILE, CML2_OLDCONFIG_FILE + '.saved')
shutil.move(CML2_OLDCONFIG_FILE, CML2_OLDCONFIG_FILE + '.saved')
if options.backup_config == 1:
print "Backing up %s into %s" % (CML2_OLDCONFIG_FILE, CML2_OLDCONFIG_FILE + '.saved')
shutil.move(CML2_OLDCONFIG_FILE, CML2_OLDCONFIG_FILE + '.saved')
else:
print "Deleting %s" % CML2_OLDCONFIG_FILE
os.remove(CML2_OLDCONFIG_FILE)