arch/mips/include/asm/octeon/cvmx-coremask.h

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

File Facts

System
Linux kernel
Corpus path
arch/mips/include/asm/octeon/cvmx-coremask.h
Extension
.h
Size
2176 bytes
Lines
90
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 cvmx_coremask {
	u64 coremask_bitmap[CVMX_COREMASK_BMPSZ];
};

/*
 * Is ``core'' set in the coremask?
 */
static inline bool cvmx_coremask_is_core_set(const struct cvmx_coremask *pcm,
					    int core)
{
	int n, i;

	n = core % CVMX_COREMASK_ELTSZ;
	i = core / CVMX_COREMASK_ELTSZ;

	return (pcm->coremask_bitmap[i] & ((u64)1 << n)) != 0;
}

/*
 * Make a copy of a coremask
 */
static inline void cvmx_coremask_copy(struct cvmx_coremask *dest,
				      const struct cvmx_coremask *src)
{
	memcpy(dest, src, sizeof(*dest));
}

/*
 * Set the lower 64-bit of the coremask.
 */
static inline void cvmx_coremask_set64(struct cvmx_coremask *pcm,
				       uint64_t coremask_64)
{
	pcm->coremask_bitmap[0] = coremask_64;
}

/*
 * Clear ``core'' from the coremask.
 */
static inline void cvmx_coremask_clear_core(struct cvmx_coremask *pcm, int core)
{
	int n, i;

	n = core % CVMX_COREMASK_ELTSZ;
	i = core / CVMX_COREMASK_ELTSZ;
	pcm->coremask_bitmap[i] &= ~(1ull << n);
}

#endif /* __CVMX_COREMASK_H__ */

Annotation

Implementation Notes