arch/mips/include/asm/asm.h

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

File Facts

System
Linux kernel
Corpus path
arch/mips/include/asm/asm.h
Extension
.h
Size
7338 bytes
Lines
357
Domain
Architecture Layer
Bucket
arch/mips
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

#ifndef __ASM_ASM_H
#define __ASM_ASM_H

#include <asm/sgidefs.h>
#include <asm/asm-eva.h>
#include <asm/isa-rev.h>

#ifndef __VDSO__
/*
 * Emit CFI data in .debug_frame sections, not .eh_frame sections.
 * We don't do DWARF unwinding at runtime, so only the offline DWARF
 * information is useful to anyone. Note we should change this if we
 * ever decide to enable DWARF unwinding at runtime.
 */
#define CFI_SECTIONS	.cfi_sections .debug_frame
#else
 /*
  * For the vDSO, emit both runtime unwind information and debug
  * symbols for the .dbg file.
  */
#define CFI_SECTIONS
#endif

#ifdef __ASSEMBLER__
/*
 * LEAF - declare leaf routine
 */
#define LEAF(symbol)					\
		CFI_SECTIONS;				\
		.globl	symbol;				\
		.align	2;				\
		.type	symbol, @function;		\
		.ent	symbol, 0;			\
symbol:		.frame	sp, 0, ra;			\
		.cfi_startproc;				\
		.insn

/*
 * NESTED - declare nested routine entry point
 */
#define NESTED(symbol, framesize, rpc)			\
		CFI_SECTIONS;				\
		.globl	symbol;				\
		.align	2;				\
		.type	symbol, @function;		\
		.ent	symbol, 0;			\
symbol:		.frame	sp, framesize, rpc;		\
		.cfi_startproc;				\
		.insn

/*
 * END - mark end of function
 */
#define END(function)					\
		.cfi_endproc;				\
		.end	function;			\
		.size	function, .-function

/*
 * EXPORT - export definition of symbol
 */
#define EXPORT(symbol)					\
		.globl	symbol;				\
symbol:

/*
 * FEXPORT - export definition of a function symbol
 */
#define FEXPORT(symbol)					\
		.globl	symbol;				\
		.type	symbol, @function;		\
symbol:		.insn

/*
 * ABS - export absolute symbol
 */
#define ABS(symbol,value)				\
		.globl	symbol;				\
symbol		=	value

#define TEXT(msg)					\
		.pushsection .data;			\
8:		.asciiz msg;				\
		.popsection;

#define ASM_PANIC(msg)					\
		.set	push;				\
		.set	reorder;			\
		PTR_LA	a0, 8f;				\
		jal	panic;				\

Annotation

Implementation Notes