__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# SPDX-License-Identifier: GPL-2.0 # # Radix Tree Parser # # Copyright (c) 2016 Linaro Ltd # Copyright (c) 2023 Broadcom # # Authors: # Kieran Bingham <[email protected]> # Florian Fainelli <[email protected]> import gdb from linux import utils from linux import constants radix_tree_root_type = utils.CachedType("struct xarray") radix_tree_node_type = utils.CachedType("struct xa_node") def is_internal_node(node): long_type = utils.get_long_type() return ((node.cast(long_type) & constants.LX_RADIX_TREE_ENTRY_MASK) == constants.LX_RADIX_TREE_INTERNAL_NODE) def entry_to_node(node): long_type = utils.get_long_type() node_type = node.type indirect_ptr = node.cast(long_type) & ~constants.LX_RADIX_TREE_INTERNAL_NODE return indirect_ptr.cast(radix_tree_node_type.get_type().pointer()) def node_maxindex(node): return (constants.LX_RADIX_TREE_MAP_SIZE << node['shift']) - 1 def lookup(root, index): if root.type == radix_tree_root_type.get_type().pointer(): node = root.dereference() elif root.type != radix_tree_root_type.get_type(): raise gdb.GdbError("must be {} not {}" .format(radix_tree_root_type.get_type(), root.type)) node = root['xa_head'] if node == 0: return None if not (is_internal_node(node)): if (index > 0): return None return node node = entry_to_node(node) maxindex = node_maxindex(node) if (index > maxindex): return None shift = node['shift'] + constants.LX_RADIX_TREE_MAP_SHIFT while True: offset = (index >> node['shift']) & constants.LX_RADIX_TREE_MAP_MASK slot = node['slots'][offset] if slot == 0: return None node = slot.cast(node.type.pointer()).dereference() if node == 0: return None shift -= constants.LX_RADIX_TREE_MAP_SHIFT if (shift <= 0): break return node class LxRadixTree(gdb.Function): """ Lookup and return a node from a RadixTree. $lx_radix_tree_lookup(root_node [, index]): Return the node at the given index. If index is omitted, the root node is dereference and returned.""" def __init__(self): super(LxRadixTree, self).__init__("lx_radix_tree_lookup") def invoke(self, root, index=0): result = lookup(root, index) if result is None: raise gdb.GdbError("No entry in tree at index {}".format(index)) return result LxRadixTree()
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| .gitignore | File | 65 B | 0644 |
|
| Makefile | File | 634 B | 0644 |
|
| __init__.py | File | 55 B | 0644 |
|
| clk.py | File | 2.57 KB | 0644 |
|
| config.py | File | 1.3 KB | 0644 |
|
| constants.py.in | File | 4.39 KB | 0644 |
|
| cpus.py | File | 6.05 KB | 0644 |
|
| device.py | File | 5.66 KB | 0644 |
|
| dmesg.py | File | 5.69 KB | 0644 |
|
| genpd.py | File | 2.65 KB | 0644 |
|
| interrupts.py | File | 7.67 KB | 0644 |
|
| kasan.py | File | 1.38 KB | 0644 |
|
| lists.py | File | 4.16 KB | 0644 |
|
| mapletree.py | File | 7.17 KB | 0644 |
|
| mm.py | File | 13.98 KB | 0644 |
|
| modules.py | File | 3.92 KB | 0644 |
|
| page_owner.py | File | 6.83 KB | 0644 |
|
| pgtable.py | File | 10.08 KB | 0644 |
|
| proc.py | File | 8.58 KB | 0644 |
|
| radixtree.py | File | 2.46 KB | 0644 |
|
| rbtree.py | File | 4.62 KB | 0644 |
|
| slab.py | File | 11.27 KB | 0644 |
|
| stackdepot.py | File | 2.62 KB | 0644 |
|
| symbols.py | File | 7.32 KB | 0644 |
|
| tasks.py | File | 3.17 KB | 0644 |
|
| timerlist.py | File | 7.86 KB | 0644 |
|
| utils.py | File | 5.87 KB | 0644 |
|
| vfs.py | File | 1.42 KB | 0644 |
|
| vmalloc.py | File | 2.33 KB | 0644 |
|
| xarray.py | File | 636 B | 0644 |
|