Skip to content
Snippets Groups Projects
  1. Apr 22, 2014
  2. Apr 21, 2014
  3. Apr 17, 2014
  4. Apr 16, 2014
    • Mitchel Humpherys's avatar
      lrdp-v2: define equivalency for Register objects · 308f4fdc
      Mitchel Humpherys authored
      Register objects are `equal' if they have the same fields and the values
      of all of those fields are equal. Overload Register.__eq__ to reflect
      this.
      
      Change-Id: I680e869470b20d6dc88d4bd78da9f002980aea4f
      308f4fdc
    • Mitchel Humpherys's avatar
      lrdp-v2: register.py: add doctest for single-bit fields · 2acca144
      Mitchel Humpherys authored
      The Register class supports single-bit field definitions. Add a doctest
      for example purposes and regression testing.
      
      Change-Id: Ib04762aca8cb00256e16c29ac2ab71d47d0c06da
      2acca144
    • Mitchel Humpherys's avatar
      lrdp-v2: register.py: add support for setting the register value · a2510954
      Mitchel Humpherys authored
      The Register class currently can't handle setting the `value'
      attribute. Fix this. Also add a `zero' convenience method for zeroing
      out a register.
      
      After adding the following doctest:
      
          >>> abc.value = 0
          >>> abc.value
          0
      
      but before fixing __setattr__, I get:
      
          **********************************************************************
          File "register.py", line 42, in __main__.Register
          Failed example:
              abc.value = 0
          Exception raised:
              Traceback (most recent call last):
                File "/usr/lib/python2.7/doctest.py", line 1289, in __run
                  compileflags, 1) in test.globs
                File "<doctest __main__.Register[10]>", line 1, in <module>
                  abc.value = 0
                File "register.py", line 106, in __setattr__
                  raise AttributeError
              AttributeError
          **********************************************************************
          File "register.py", line 43, in __main__.Register
          Failed example:
              abc.value
          Expected:
              0
          Got:
              49
          **********************************************************************
          1 items had failures:
             2 of  20 in __main__.Register
          ***Test Failed*** 2 failures.
      
      After the fix in __setattr__, all tests pass successfully.
      
      Change-Id: I6d39261b139aae0def58f38a4291baad651b10e3
      a2510954
    • Mitchel Humpherys's avatar
      lrdp-v2: refactor dmesg extraction code · 779e720e
      Mitchel Humpherys authored
      It can be useful to extract the dmesg from contexts other than the
      --dmesg parser. Refactor the code into a top-level "library" module and
      hook the --dmesg parser into that.
      
      Change-Id: I935c05a081b1096d67343f5ce8617febb674b2e0
      779e720e
    • Mitchel Humpherys's avatar
      lrdp-v2: add hexdump functions · 97cff249
      Mitchel Humpherys authored
      It's useful to be able to dump regions of memory a la `xxd'. Add some
      machinery to parser_util and RamDump to do this.
      
      Example:
      
          $ ramparse.py -a . -o parsed --shell
          >>> dump.hexdump(0, 100, virtual=False)
          00000000: fffe ffde 0200 0000 ffff b7bf adf5 a5ff  ................
          00000010: e7bf edfe c6fe edf6 fefa fffe befa fefe  ................
          00000020: bfbe ffef aebd a5ef ffff 7f7e fefe 5afb  ...........~..Z.
          00000030: 1b00 2000 3300 4300 1c00 2100 3400 4800  .. .3.C...!.4.H.
          00000040: ffff ff7f fafe ffdb effd a5af adf5 a5bf  ................
          00000050: 4444 4444 4444 4444 4444 4444 4444 4444  DDDDDDDDDDDDDDDD
          00000060: 5fff ffff                                _...
          >>> dump.hexdump(0xc0000000, 100, virtual=True)
          c0000000: fffe ffde 0200 0000 ffff b7bf adf5 a5ff  ................
          c0000010: e7bf edfe c6fe edf6 fefa fffe befa fefe  ................
          c0000020: bfbe ffef aebd a5ef ffff 7f7e fefe 5afb  ...........~..Z.
          c0000030: 1b00 2000 3300 4300 1c00 2100 3400 4800  .. .3.C...!.4.H.
          c0000040: ffff ff7f fafe ffdb effd a5af adf5 a5bf  ................
          c0000050: 4444 4444 4444 4444 4444 4444 4444 4444  DDDDDDDDDDDDDDDD
          c0000060: 5fff ffff                                _...
          >>> dump.hexdump(dump.addr_lookup('linux_banner'), 144, virtual=True)
          c0b0006a: 4c69 6e75 7820 7665 7273 696f 6e20 332e  Linux version 3.
          c0b0007a: 3130 2e32 382d 6765 3232 3362 6632 3830  10.28-ge223bf280
          c0b0008a: 662d 6469 7274 7920 286d 6974 6368 656c  f-dirty (mitchel
          c0b0009a: 6840 6d69 7463 6865 6c68 2d6c 696e 7578  h@mitchelh-linux
          c0b000aa: 2920 2867 6363 2076 6572 7369 6f6e 2034  ) (gcc version 4
          c0b000ba: 2e37 2028 4743 4329 2029 2023 3720 534d  .7 (GCC) ) #7 SM
          c0b000ca: 5020 5052 4545 4d50 5420 5475 6520 4170  P PREEMPT Tue Ap
          c0b000da: 7220 3820 3134 3a32 303a 3132 2050 4454  r 8 14:20:12 PDT
          c0b000ea: 2032 3031 340a 007c 2f2d 5c00 0000 0000   2014..|/-\.....
      
      Change-Id: Iecaf80f72845f052085a60eadedd2bb24743224c
      97cff249
    • Mitchel Humpherys's avatar
      lrdp-v2: refactor Armv7LPAEMMU code · 4f8207f7
      Mitchel Humpherys authored
      The LPAE MMU code can be re-used for other modules that need page table
      parsing (like the LPAE IOMMU page tables). Refactor the code a bit so
      that it can be easily re-used later.
      
      Change-Id: I0deb80a69f2fca83c3ddcc78867fa2e5f5d18bb2
      4f8207f7
Loading