arch/powerpc/platforms/powernv/vas-debug.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/powernv/vas-debug.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/powernv/vas-debug.c- Extension
.c- Size
- 4398 bytes
- Lines
- 169
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/slab.hlinux/debugfs.hlinux/seq_file.hasm/vas.hvas.h
Detected Declarations
function info_showfunction print_regfunction hvwc_showfunction vas_window_free_dbgdirfunction vas_window_init_dbgdirfunction vas_instance_init_dbgdirfunction vas_init_dbgdir
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2016-17 IBM Corp.
*/
#define pr_fmt(fmt) "vas: " fmt
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <asm/vas.h>
#include "vas.h"
static struct dentry *vas_debugfs;
static char *cop_to_str(int cop)
{
switch (cop) {
case VAS_COP_TYPE_FAULT: return "Fault";
case VAS_COP_TYPE_842: return "NX-842 Normal Priority";
case VAS_COP_TYPE_842_HIPRI: return "NX-842 High Priority";
case VAS_COP_TYPE_GZIP: return "NX-GZIP Normal Priority";
case VAS_COP_TYPE_GZIP_HIPRI: return "NX-GZIP High Priority";
case VAS_COP_TYPE_FTW: return "Fast Thread-wakeup";
default: return "Unknown";
}
}
static int info_show(struct seq_file *s, void *private)
{
struct pnv_vas_window *window = s->private;
mutex_lock(&vas_mutex);
/* ensure window is not unmapped */
if (!window->hvwc_map)
goto unlock;
seq_printf(s, "Type: %s, %s\n", cop_to_str(window->vas_win.cop),
window->tx_win ? "Send" : "Receive");
seq_printf(s, "Pid : %d\n", vas_window_pid(&window->vas_win));
unlock:
mutex_unlock(&vas_mutex);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(info);
static inline void print_reg(struct seq_file *s, struct pnv_vas_window *win,
char *name, u32 reg)
{
seq_printf(s, "0x%016llx %s\n", read_hvwc_reg(win, name, reg), name);
}
static int hvwc_show(struct seq_file *s, void *private)
{
struct pnv_vas_window *window = s->private;
mutex_lock(&vas_mutex);
/* ensure window is not unmapped */
if (!window->hvwc_map)
goto unlock;
print_reg(s, window, VREG(LPID));
print_reg(s, window, VREG(PID));
print_reg(s, window, VREG(XLATE_MSR));
print_reg(s, window, VREG(XLATE_LPCR));
print_reg(s, window, VREG(XLATE_CTL));
print_reg(s, window, VREG(AMR));
print_reg(s, window, VREG(SEIDR));
print_reg(s, window, VREG(FAULT_TX_WIN));
print_reg(s, window, VREG(OSU_INTR_SRC_RA));
print_reg(s, window, VREG(HV_INTR_SRC_RA));
print_reg(s, window, VREG(PSWID));
print_reg(s, window, VREG(LFIFO_BAR));
print_reg(s, window, VREG(LDATA_STAMP_CTL));
print_reg(s, window, VREG(LDMA_CACHE_CTL));
print_reg(s, window, VREG(LRFIFO_PUSH));
print_reg(s, window, VREG(CURR_MSG_COUNT));
print_reg(s, window, VREG(LNOTIFY_AFTER_COUNT));
print_reg(s, window, VREG(LRX_WCRED));
print_reg(s, window, VREG(LRX_WCRED_ADDER));
print_reg(s, window, VREG(TX_WCRED));
print_reg(s, window, VREG(TX_WCRED_ADDER));
print_reg(s, window, VREG(LFIFO_SIZE));
print_reg(s, window, VREG(WINCTL));
print_reg(s, window, VREG(WIN_STATUS));
Annotation
- Immediate include surface: `linux/types.h`, `linux/slab.h`, `linux/debugfs.h`, `linux/seq_file.h`, `asm/vas.h`, `vas.h`.
- Detected declarations: `function info_show`, `function print_reg`, `function hvwc_show`, `function vas_window_free_dbgdir`, `function vas_window_init_dbgdir`, `function vas_instance_init_dbgdir`, `function vas_init_dbgdir`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source 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.