arch/s390/kernel/dumpstack.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/dumpstack.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/dumpstack.c- Extension
.c- Size
- 6162 bytes
- Lines
- 225
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kallsyms.hlinux/hardirq.hlinux/kprobes.hlinux/utsname.hlinux/export.hlinux/kdebug.hlinux/ptrace.hlinux/mm.hlinux/module.hlinux/sched.hlinux/sched/debug.hlinux/sched/task_stack.hasm/asm-offsets.hasm/processor.hasm/debug.hasm/dis.hasm/ipl.hasm/unwind.h
Detected Declarations
function in_stackfunction in_task_stackfunction in_irq_stackfunction in_nodat_stackfunction in_mcck_stackfunction in_restart_stackfunction get_stack_infofunction show_stackfunction show_last_breaking_eventfunction show_registersfunction show_regsfunction dieexport stack_type_name
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Stack dumping functions
*
* Copyright IBM Corp. 1999, 2013
*/
#include <linux/kallsyms.h>
#include <linux/hardirq.h>
#include <linux/kprobes.h>
#include <linux/utsname.h>
#include <linux/export.h>
#include <linux/kdebug.h>
#include <linux/ptrace.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/sched/task_stack.h>
#include <asm/asm-offsets.h>
#include <asm/processor.h>
#include <asm/debug.h>
#include <asm/dis.h>
#include <asm/ipl.h>
#include <asm/unwind.h>
const char *stack_type_name(enum stack_type type)
{
switch (type) {
case STACK_TYPE_TASK:
return "task";
case STACK_TYPE_IRQ:
return "irq";
case STACK_TYPE_NODAT:
return "nodat";
case STACK_TYPE_RESTART:
return "restart";
default:
return "unknown";
}
}
EXPORT_SYMBOL_GPL(stack_type_name);
static inline bool in_stack(unsigned long sp, struct stack_info *info,
enum stack_type type, unsigned long stack)
{
if (sp < stack || sp >= stack + THREAD_SIZE)
return false;
info->type = type;
info->begin = stack;
info->end = stack + THREAD_SIZE;
return true;
}
static bool in_task_stack(unsigned long sp, struct task_struct *task,
struct stack_info *info)
{
unsigned long stack = (unsigned long)task_stack_page(task);
return in_stack(sp, info, STACK_TYPE_TASK, stack);
}
static bool in_irq_stack(unsigned long sp, struct stack_info *info)
{
unsigned long stack = get_lowcore()->async_stack - STACK_INIT_OFFSET;
return in_stack(sp, info, STACK_TYPE_IRQ, stack);
}
static bool in_nodat_stack(unsigned long sp, struct stack_info *info)
{
unsigned long stack = get_lowcore()->nodat_stack - STACK_INIT_OFFSET;
return in_stack(sp, info, STACK_TYPE_NODAT, stack);
}
static bool in_mcck_stack(unsigned long sp, struct stack_info *info)
{
unsigned long stack = get_lowcore()->mcck_stack - STACK_INIT_OFFSET;
return in_stack(sp, info, STACK_TYPE_MCCK, stack);
}
static bool in_restart_stack(unsigned long sp, struct stack_info *info)
{
unsigned long stack = get_lowcore()->restart_stack - STACK_INIT_OFFSET;
return in_stack(sp, info, STACK_TYPE_RESTART, stack);
}
Annotation
- Immediate include surface: `linux/kallsyms.h`, `linux/hardirq.h`, `linux/kprobes.h`, `linux/utsname.h`, `linux/export.h`, `linux/kdebug.h`, `linux/ptrace.h`, `linux/mm.h`.
- Detected declarations: `function in_stack`, `function in_task_stack`, `function in_irq_stack`, `function in_nodat_stack`, `function in_mcck_stack`, `function in_restart_stack`, `function get_stack_info`, `function show_stack`, `function show_last_breaking_event`, `function show_registers`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.