cpt_upgrader.py (10861:9141d87c7f71) | cpt_upgrader.py (10930:ddc3d96d6313) |
---|---|
1#!/usr/bin/env python 2 3# Copyright (c) 2012-2013 ARM Limited 4# All rights reserved 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 600 unchanged lines hidden (view full) --- 609 import re 610 # Search for all ISA sections 611 if re.search('.*sys.*\.cpu.*\.isa$', sec): 612 miscRegs = cpt.get(sec, 'miscRegs').split() 613 # CONTEXTIDR_EL2 defaults to 0b11111100000000000001 614 miscRegs[599:599] = [0xFC001] 615 cpt.set(sec, 'miscRegs', ' '.join(str(x) for x in miscRegs)) 616 | 1#!/usr/bin/env python 2 3# Copyright (c) 2012-2013 ARM Limited 4# All rights reserved 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 600 unchanged lines hidden (view full) --- 609 import re 610 # Search for all ISA sections 611 if re.search('.*sys.*\.cpu.*\.isa$', sec): 612 miscRegs = cpt.get(sec, 'miscRegs').split() 613 # CONTEXTIDR_EL2 defaults to 0b11111100000000000001 614 miscRegs[599:599] = [0xFC001] 615 cpt.set(sec, 'miscRegs', ' '.join(str(x) for x in miscRegs)) 616 |
617# Checkpoint version F renames an internal member of Process class. 618def from_E(cpt): 619 import re 620 for sec in cpt.sections(): 621 fdm = 'FdMap' 622 fde = 'FDEntry' 623 if re.match('.*\.%s.*' % fdm, sec): 624 rename = re.sub(fdm, fde, sec) 625 split = re.split(fde, rename) 626 627 # rename the section and add the 'mode' field 628 rename_section(cpt, sec, rename) 629 cpt.set(rename, 'mode', "0") # no proper value to set :( 630 631 # add in entries 257 to 1023 632 if split[1] == "0": 633 for x in range(257, 1024): 634 seq = (split[0], fde, "%s" % x) 635 section = "".join(seq) 636 cpt.add_section(section) 637 cpt.set(section, 'fd', '-1') 638 639 |
|
617migrations = [] 618migrations.append(from_0) 619migrations.append(from_1) 620migrations.append(from_2) 621migrations.append(from_3) 622migrations.append(from_4) 623migrations.append(from_5) 624migrations.append(from_6) 625migrations.append(from_7) 626migrations.append(from_8) 627migrations.append(from_9) 628migrations.append(from_A) 629migrations.append(from_B) 630migrations.append(from_C) 631migrations.append(from_D) | 640migrations = [] 641migrations.append(from_0) 642migrations.append(from_1) 643migrations.append(from_2) 644migrations.append(from_3) 645migrations.append(from_4) 646migrations.append(from_5) 647migrations.append(from_6) 648migrations.append(from_7) 649migrations.append(from_8) 650migrations.append(from_9) 651migrations.append(from_A) 652migrations.append(from_B) 653migrations.append(from_C) 654migrations.append(from_D) |
655migrations.append(from_E) |
|
632 | 656 |
657# http://stackoverflow.com/questions/15069127/python-configparser-module-\ 658# rename-a-section 659def rename_section(cp, section_from, section_to): 660 items = cp.items(section_from) 661 cp.add_section(section_to) 662 for item in items: 663 cp.set(section_to, item[0], item[1]) 664 cp.remove_section(section_from) 665 |
|
633verbose_print = False 634 635def verboseprint(*args): 636 if not verbose_print: 637 return 638 for arg in args: 639 print arg, 640 print --- 94 unchanged lines hidden --- | 666verbose_print = False 667 668def verboseprint(*args): 669 if not verbose_print: 670 return 671 for arg in args: 672 print arg, 673 print --- 94 unchanged lines hidden --- |