regs_get_kernel_argument(9)
π
regs_get_kernel_argument(9) π
okay bestie, this is a page straight outta the Kernel API Manual, and itβs serving kernel-argument realness. The function is regs_get_kernel_argument, and yes, it gets the Nth function argument in the kernel. iconic behavior, honestly.
π NAME π
regs_get_kernel_argument β get Nth function argument in kernel
β¨ SYNOPSIS β¨
unsigned long regs_get_kernel_argument (struct pt_regs *regs , unsigned
int n );
π«Ά ARGUMENTS π«Ά
regsβ pt_regs of that contextnβ function argument number (start from 0)
πΈ DESCRIPTION πΈ
So the doc says regs_get_argument returns the nth argument of the function call. Thatβs the whole vibe.
Heads up though: this chooses the most probable assignment, and in some cases it can be incorrect. not me warning you twice, but likeβ¦ bestie, pls know this is a best-effort situation π
This is expected to be called from kprobes or ftrace with regs where the top of stack is the return address. thatβs the setup, thatβs the assignment, no cap.
π SEE ALSO π
- Kernel file
./arch/x86/include/asm/ptrace.h regs_get_register(9)regs_within_kernel_stack(9)regs_get_kernel_stack_nth_addr(9)regs_get_kernel_stack_nth(9)
Source/version: ./arch/x86/include/asm Β· Date: October 2026 Β· later bestie, go read the kernel source and slay ππ¦β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms