arch/mips/include/asm/maar.h

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

File Facts

System
Linux kernel
Corpus path
arch/mips/include/asm/maar.h
Extension
.h
Size
4270 bytes
Lines
128
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

struct maar_config {
	phys_addr_t lower;
	phys_addr_t upper;
	unsigned attrs;
};

/**
 * maar_config() - configure MAARs according to provided data
 * @cfg:	Pointer to an array of struct maar_config.
 * @num_cfg:	The number of structs in the cfg array.
 * @num_pairs:	The number of MAAR pairs present in the system.
 *
 * Configures as many MAARs as are present and specified in the cfg
 * array with the values taken from the cfg array.
 *
 * Return:	The number of MAAR pairs configured.
 */
static inline unsigned maar_config(const struct maar_config *cfg,
				   unsigned num_cfg, unsigned num_pairs)
{
	unsigned i;

	for (i = 0; i < min(num_cfg, num_pairs); i++)
		write_maar_pair(i, cfg[i].lower, cfg[i].upper, cfg[i].attrs);

	return i;
}

#endif /* __MIPS_ASM_MIPS_MAAR_H__ */

Annotation

Implementation Notes