lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since 3061bc1 was 28f4adb, checked in by Martin Decky <martin@…>, 15 years ago |
update scripts for compatibility with Python 3 (thx Vojtech Horky and Martin Sucha)
|
-
Property mode
set to
100755
|
File size:
495 bytes
|
Rev | Line | |
---|
[ba81cab] | 1 | #!/usr/bin/env python
|
---|
| 2 | """
|
---|
| 3 | Decode 32-bit address into PTE components
|
---|
| 4 | """
|
---|
| 5 | import sys
|
---|
| 6 |
|
---|
| 7 | def main():
|
---|
| 8 | if len(sys.argv) != 2 or not sys.argv[1].startswith('0x'):
|
---|
[28f4adb] | 9 | print("%s 0x..." % sys.argv[0])
|
---|
[ba81cab] | 10 | sys.exit(1)
|
---|
| 11 |
|
---|
| 12 | address = int(sys.argv[1],16)
|
---|
| 13 | offset = address & 0xfff
|
---|
| 14 | ptl1 = (address >> 12) & 0x3ff
|
---|
| 15 | ptl0 = (address >> 22) & 0x3ff
|
---|
[28f4adb] | 16 | print("Ptl0: %3d" % ptl0)
|
---|
| 17 | print("Ptl1: %3d" % ptl1)
|
---|
| 18 | print("Offset: 0x%x" % offset)
|
---|
[ba81cab] | 19 |
|
---|
| 20 | if __name__ == '__main__':
|
---|
| 21 | main()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.