arch/s390/include/asm/bug.h

Source file repositories/reference/linux-study-clean/arch/s390/include/asm/bug.h

File Facts

System
Linux kernel
Corpus path
arch/s390/include/asm/bug.h
Extension
.h
Size
3732 bytes
Lines
142
Domain
Architecture Layer
Bucket
arch/s390
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct arch_va_list {
	long __gpr;
	long __fpr;
	void *__overflow_arg_area;
	void *__reg_save_area;
};

struct bug_entry;
struct pt_regs;

void *__warn_args(struct arch_va_list *args, struct pt_regs *regs);
void __WARN_trap(struct bug_entry *bug, ...);

#define __WARN_print_arg(flags, format, arg...)				\
do {									\
	int __flags = (flags) | BUGFLAG_WARNING | BUGFLAG_ARGS;		\
									\
	__WARN_trap(__WARN_bug_entry(__flags, format), ## arg);		\
	/* prevent tail-call optimization */				\
	asm("");							\
} while (0)

#define __WARN_printf(taint, fmt, arg...) \
	__WARN_print_arg(BUGFLAG_TAINT(taint), fmt, ## arg)

#define WARN_ONCE(cond, format, arg...)					\
({									\
	int __ret_warn_on = !!(cond);					\
									\
	if (unlikely(__ret_warn_on)) {					\
		__WARN_print_arg(BUGFLAG_ONCE|BUGFLAG_TAINT(TAINT_WARN),\
				format, ## arg);			\
	}								\
	__ret_warn_on;							\
})

#define HAVE_ARCH_BUG
#define HAVE_ARCH_BUG_FORMAT
#define HAVE_ARCH_BUG_FORMAT_ARGS

#define ARCH_WARN_ASM(file, line, flags, size)				\
	".section .rodata.str,\"aMS\",@progbits,1\n"			\
	"9:\n"								\
	".asciz \"\"\n"		/* Empty string for compatibility */	\
	".previous\n"							\
	"0:\n"								\
	__stringify(mc 0(%r0),0) "\n"					\
	__BUG_ENTRY("9b", file, line, flags, size)

#define ARCH_WARN_REACHABLE

#endif /* CONFIG_BUG && CONFIG_CC_HAS_ASM_IMMEDIATE_STRINGS */
#endif /* __ASSEMBLER__ */

#include <asm-generic/bug.h>

#endif /* _ASM_S390_BUG_H */

Annotation

Implementation Notes