summaryrefslogtreecommitdiff
path: root/kexec/kexec-iomem.c
AgeCommit message (Collapse)Author
2020-08-10kexec-tools: Check callback first in kexec_iomem_for_each_line()Jinyang He
In the function kexec_iomem_for_each_line(), it is better to check the callback first, it can return directly if the callback is NULL. Signed-off-by: Jinyang He <hejinyang@loongson.cn> Signed-off-by: Simon Horman <horms@verge.net.au>
2017-05-22kexec: extend the semantics of kexec_iomem_for_each_lineAKASHI Takahiro
The current kexec_iomem_for_each_line() counts up all the lines for which a callback function returns zero(0) or positive, and otherwise it stops further scanning. This behavior is inconvenient in some cases. For instance, on arm64, we want to count up "System RAM" entries, but need to skip "reserved" entries. So this patch extends the semantics so that we will continue to scan succeeding entries but not count lines for which a callback function returns positive. The current users of kexec_iomem_for_each_line(), arm, sh and x86, will not be affected by this change because * arm The callback function only returns -1 or 0, and the return value of kexec_iomem_for_each_line() will never be used. * sh, x86 The callback function may return (-1 for sh,) 0 or 1, but always returns 1 once we have reached the maximum number of entries allowed. Even so the current kexec_iomem_for_each_line() counts them up. This change actually fixes this bug. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Tested-by: David Woodhouse <dwmw@amazon.co.uk> Tested-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2017-03-14Don't use %L width specifier with integer valuesPhilip Prindeville
MUSL doesn't support %L except for floating-point arguments; therefore, %ll must be used instead with integer arguments. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2014-06-06kexec: iomem: accept u64 parameters for callbacksLiu Hua
Since "start" and "end" in kexec_iomem_for_each_line are unsigned long long, this patch makes "callback"s accept unsigned-long-long-type parameters. Signed-off-by: Wei Jitao <weijitao@huawei.com> Signed-off-by: Liu Hua <sdu.liu@huawei.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Mark unused parametersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2008-04-24Replace weak definitions with source filename overriding.Jamey Sharp
This reduces the kexec-tools' demands on the capabilities of the toolchain, and improves standards conformance, without really changing maintenance complexity. Signed-off-by: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-03-04kexec-tools: no machine machine to proc_iomem()Simon Horman
Removes the machine parameter to proc_iomem() which is no longer of any use. Signed-off-by: Simon Horman <horms@verge.net.au>
2007-10-17Allow architectures to specify the location of /proc/iomemSimon Horman
On ia64 XEN it is sometimes neccessary to use an alternate location for the information that is usually provided by /proc/iomem. By having the path returned by a function, which can be overriden on a per-architecture basis, it is possible for ia64 XEN to make use of existing generic code. Hopefully other achitectures can use this infastructure as the need arises. If the machine parameter is zero, then iomem file relating to the currently running kernel should be returned. If the machine parameter is non-zero then iomem file, relating to the underlying hypervisor, should be returned. In the simple case, these will be the same file. Signed-off-by: Simon Horman <horms@verge.net.au> kexec/arch/i386/crashdump-x86.c | 4 ++-- kexec/arch/i386/kexec-x86.c | 2 +- kexec/arch/i386/x86-linux-setup.c | 2 +- kexec/arch/ia64/crashdump-ia64.c | 9 +++++---- kexec/arch/ia64/kexec-elf-ia64.c | 2 +- kexec/arch/ia64/kexec-ia64.c | 5 +++-- kexec/arch/ppc/kexec-ppc.c | 2 +- kexec/arch/s390/kexec-s390.c | 5 +++-- kexec/arch/x86_64/crashdump-x86_64.c | 10 +++++----- kexec/arch/x86_64/kexec-x86_64.c | 2 +- kexec/crashdump-xen.c | 6 ++++-- kexec/kexec-iomem.c | 31 +++++++++++++++++++++++-------- kexec/kexec.h | 6 +++--- 13 files changed, 53 insertions(+), 33 deletions(-) 9079040b40f643cfc9eb3d425dffa0ca8fd573e1
2006-11-27kexec-tools: Introduce kexec-iomem.c and /proc/iomem parsing code V2Magnus Damm
kexec-tools: Introduce kexec-iomem.c and /proc/iomem parsing code V2 This patch adds the new file kexec-iomem.c that implements code to parse /proc/iomem line-by-line. The following patches make use of this code - especially the Xen-code that use /proc/iomem to get crash note information. This version renames a function to parse_iomem_single() as suggested by Vivek. We also now export kexec_iomem_for_each_line() in a header file. Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Removed trailing whitespace Signed-off-by: Simon Horman <horms@verge.net.au>