#!/usr/bin/env python # SPDX-License-Identifier: GPL-2.0 # libxed.py: Python wrapper for libxed.so # Copyright (c) 2014-2021, Intel Corporation. # To use Intel XED, libxed.so must be present. To build and install # libxed.so: # git clone https://github.com/intelxed/mbuild.git mbuild # git clone https://github.com/intelxed/xed # cd xed # ./mfile.py --share # sudo ./mfile.py --prefix=/usr/local install # sudo ldconfig # import sys from ctypes import CDLL, Structure, create_string_buffer, addressof, sizeof, \ c_void_p, c_bool, c_byte, c_char, c_int, c_uint, c_longlong, c_ulonglong # XED Disassembler class xed_state_t(Structure): _fields_ = [ ("mode", c_int), ("width", c_int) ] class XEDInstruction(): def __init__(self, libxed): # Current xed_decoded_inst_t structure is 192 bytes. Use 512 to allow for future expansion xedd_t = c_byte * 512 self.xedd = xedd_t() self.xedp = addressof(self.xedd) libxed.xed_decoded_inst_zero(self.xedp) self.state = xed_state_t() self.statep = addressof(self.state) # Buffer for disassembled instruction text self.buffer = create_string_buffer(256) self.bufferp = addressof(self.buffer) class LibXED(): def __init__(self): try: self.libxed = CDLL("libxed.so") except: self.libxed = None if not self.libxed: self.libxed = CDLL("/usr/local/lib/libxed.so") self.xed_tables_init = self.libxed.xed_tables_init self.xed_tables_init.restype = None self.xed_tables_init.argtypes = [] self.xed_decoded_inst_zero = self.libxed.xed_decoded_inst_zero self.xed_decoded_inst_zero.restype = None self.xed_decoded_inst_zero.argtypes = [ c_void_p ] self.xed_operand_values_set_mode = self.libxed.xed_operand_values_set_mode self.xed_operand_values_set_mode.restype = None self.xed_operand_values_set_mode.argtypes = [ c_void_p, c_void_p ] self.xed_decoded_inst_zero_keep_mode = self.libxed.xed_decoded_inst_zero_keep_mode self.xed_decoded_inst_zero_keep_mode.restype = None self.xed_decoded_inst_zero_keep_mode.argtypes = [ c_void_p ] self.xed_decode = self.libxed.xed_decode self.xed_decode.restype = c_int self.xed_decode.argtypes = [ c_void_p, c_void_p, c_uint ] self.xed_format_context = self.libxed.xed_format_context self.xed_format_context.restype = c_uint self.xed_format_context.argtypes = [ c_int, c_void_p, c_void_p, c_int, c_ulonglong, c_void_p, c_void_p ] self.xed_tables_init() def Instruction(self): return XEDInstruction(self) def SetMode(self, inst, mode): if mode: inst.state.mode = 4 # 32-bit inst.state.width = 4 # 4 bytes else: inst.state.mode = 1 # 64-bit inst.state.width = 8 # 8 bytes self.xed_operand_values_set_mode(inst.xedp, inst.statep) def DisassembleOne(self, inst, bytes_ptr, bytes_cnt, ip): self.xed_decoded_inst_zero_keep_mode(inst.xedp) err = self.xed_decode(inst.xedp, bytes_ptr, bytes_cnt) if err: return 0, "" # Use AT&T mode (2), alternative is Intel (3) ok = self.xed_format_context(2, inst.xedp, inst.bufferp, sizeof(inst.buffer), ip, 0, 0) if not ok: return 0, "" if sys.version_info[0] == 2: result = inst.buffer.value else: result = inst.buffer.value.decode() # Return instruction length and the disassembled instruction text # For now, assume the length is in byte 166 return inst.xedd[166], result lue='linux-3.9.y'>linux-3.9.y Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
path: root/sound/soc/sof/intel/pci-ptl.c
'left'>Age
AgeCommit message (Expand)Author
Commit message (Expand)Author
2013-07-03mm, vmalloc: use clamp() to simplify codeZhang Yanfei
2013-07-03mm, vmalloc: remove insert_vmalloc_vm()Zhang Yanfei
2013-07-03mm, vmalloc: call setup_vmalloc_vm() instead of insert_vmalloc_vm()Zhang Yanfei
2013-07-03mm, vmalloc: only call setup_vmalloc_vm() only in __get_vm_area_node()Zhang Yanfei
2013-07-03vmalloc: introduce remap_vmalloc_range_partialHATAYAMA Daisuke
2013-07-03vmalloc: make find_vm_area check in rangeHATAYAMA Daisuke
2013-05-07mm/vmalloc.c: add vfree commentAndrew Morton
2013-05-01Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir...Linus Torvalds
2013-04-29kexec, vmalloc: export additional vmalloc layer informationAtsushi Kumagai
2013-04-29mm, vmalloc: remove list management of vmlist after initializing vmallocJoonsoo Kim
2013-04-29mm, vmalloc: export vmap_area_list, instead of vmlistJoonsoo Kim
2013-04-29mm, vmalloc: iterate vmap_area_list, instead of vmlist, in vmallocinfo()Joonsoo Kim
2013-04-29mm, vmalloc: iterate vmap_area_list in get_vmalloc_info()Joonsoo Kim
2013-04-29mm, vmalloc: iterate vmap_area_list, instead of vmlist in vread/vwrite()Joonsoo Kim
2013-04-29mm, vmalloc: protect va->vm by vmap_area_lockJoonsoo Kim
2013-04-29mm, vmalloc: move get_vmalloc_info() to vmalloc.cJoonsoo Kim
2013-03-10make vfree() safe to call from interrupt contextsAl Viro
2013-02-23mm: use NUMA_NO_NODEDavid Rientjes
2012-12-11mm: use IS_ENABLED(CONFIG_NUMA) instead of NUMA_BUILDKirill A. Shutemov
2012-10-09mm: use %pK for /proc/vmallocinfoKees Cook
2012-10-09mm: kill vma flag VM_RESERVED and mm->reserved_vm counterKonstantin Khlebnikov
2012-07-31mm: make vb_alloc() more foolproofJan Kara
2012-07-31vmalloc: walk vmap_areas by sorted list instead of rb_next()Hong zhi guo
2012-07-30Merge branch 'for-linus-for-3.6-rc1' of git://git.linaro.org/people/mszyprows...Linus Torvalds
2012-07-30ARM: dma-mapping: remove custom consistent dma regionMarek Szyprowski
2012-07-30mm: vmalloc: use const void * for caller argumentMarek Szyprowski
2012-07-24vmalloc: remove KM_USER0 from commentsCong Wang
2012-05-29mm: fix faulty initialization in vmalloc_init()KyongHo
2012-05-29mm: use kcalloc() instead of kzalloc() to allocate arrayThomas Meyer
2012-03-20mm: remove the second argument of k[un]map_atomic()Cong Wang
2012-01-12mm/vmalloc.c: eliminate extra loop in pcpu_get_vm_areas error pathKautuk Consul
2012-01-10mm/vmalloc.c: change void* into explict vm_struct*Minchan Kim
2012-01-05Merge branch 'devel-stable' into for-linusRussell King
2011-12-20mm/vmalloc.c: remove static declaration of va from __get_vm_area_nodeKautuk Consul
2011-12-09mm: vmalloc: check for page allocation failure before vmlist insertionMel Gorman
2011-12-05Merge branch 'vmalloc' of git://git.linaro.org/people/nico/linux into devel-s...Russell King
2011-11-18mm: add vm_area_add_early()Nicolas Pitre
2011-11-16xen: map foreign pages for shared rings by updating the PTEs directlyDavid Vrabel
2011-10-31mm/vmalloc.c: report more vmalloc failuresJoe Perches
2011-10-31mm: neaten warn_alloc_failedJoe Perches
2011-10-31mm: avoid null pointer access in vm_struct via /proc/vmallocinfoMitsuo Hayasaka
2011-09-14mm: sync vmalloc address space page tables in alloc_vm_area()David Vrabel
2011-08-14mm: fix wrong vmap address calculations with odd NR_CPUS valuesClemens Ladisch
2011-07-26atomic: use <linux/atomic.h>Arun Sharma
2011-07-20vmalloc,rcu: Convert call_rcu(rcu_free_vb) to kfree_rcu()Lai Jiangshan
2011-07-20vmalloc,rcu: Convert call_rcu(rcu_free_va) to kfree_rcu()Lai Jiangshan
2011-05-26Merge branch 'upstream/tidy-xen-mmu-2.6.39' of git://git.kernel.org/pub/scm/l...Linus Torvalds
2011-05-25mm: print vmalloc() state after allocation failuresDave Hansen
2011-05-25mm/vmalloc: remove guard page from between vmap blocksJohannes Weiner
2011-05-20vmalloc: remove vmalloc_sync_all() from alloc_vm_area()Jeremy Fitzhardinge