Skip to content
Snippets Groups Projects
Select Git revision
  • c62b9a26e5a78547fd0ab7c348733563f7c1f2e1
  • test default
2 results

gralloc.cpp

Blame
  • sysregs.py 1.09 KiB
    # Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License version 2 and
    # only version 2 as published by the Free Software Foundation.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    
    import struct
    import os
    from print_out import print_out_str
    from ramparse import VERSION
    
    class SysRegDump():
    
        def __init__(self, start, end):
            self.start_addr = start
            self.end_addr = end
    
        def dump_sysreg_img(self,ram_dump):
            if self.start_addr >= self.end_addr:
                return False
            rsz = self.end_addr - self.start_addr
            sysregfile = ram_dump.open_file('sysdbg_regs.bin')
            for i in range(0, rsz):
                val = ram_dump.read_byte(self.start_addr + i, False)
                sysregfile.write(struct.pack('<B', val))
    
            sysregfile.close()