diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-07-17 19:44:05 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-07-17 19:44:05 +0300 |
commit | c02c0232f4b5a7b775c4819ec2d707bd6a696eee (patch) | |
tree | 45086e82a271619e08fbaeacf1372eba189d933e /scripts/gdb/linux/xarray.py | |
parent | 81bd6aab35ad9ecce95dfe3e33c807effe370d83 (diff) | |
parent | e8af141440cebccb6554fc23f8d21ce063b976a1 (diff) | |
download | linux-c02c0232f4b5a7b775c4819ec2d707bd6a696eee.tar.xz |
Merge v6.15.7linux-rolling-stable
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/gdb/linux/xarray.py')
-rw-r--r-- | scripts/gdb/linux/xarray.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/gdb/linux/xarray.py b/scripts/gdb/linux/xarray.py new file mode 100644 index 000000000000..f4477b5def75 --- /dev/null +++ b/scripts/gdb/linux/xarray.py @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Xarray helpers +# +# Copyright (c) 2025 Broadcom +# +# Authors: +# Florian Fainelli <florian.fainelli@broadcom.com> + +import gdb + +from linux import utils +from linux import constants + +def xa_is_internal(entry): + ulong_type = utils.get_ulong_type() + return ((entry.cast(ulong_type) & 3) == 2) + +def xa_mk_internal(v): + return ((v << 2) | 2) + +def xa_is_zero(entry): + ulong_type = utils.get_ulong_type() + return entry.cast(ulong_type) == xa_mk_internal(257) + +def xa_is_node(entry): + ulong_type = utils.get_ulong_type() + return xa_is_internal(entry) and (entry.cast(ulong_type) > 4096) |