arch/sparc/include/uapi/asm/envctrl.h

Source file repositories/reference/linux-study-clean/arch/sparc/include/uapi/asm/envctrl.h

File Facts

System
Linux kernel
Corpus path
arch/sparc/include/uapi/asm/envctrl.h
Extension
.h
Size
3494 bytes
Lines
105
Domain
Architecture Layer
Bucket
arch/sparc
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

*	if (ioctl(fd, ENVCTRL_READ_FAN_STATUS, 0) < 0) {
 *		printf("ioctl fan failed\n");
 *	}
 *	if (read(fd, rslt, 1) <= 0) {
 *		printf("error or fan not monitored\n");
 *	} else {
 *		if (rslt[0] == ENVCTRL_ALL_FANS_GOOD) {
 *			printf("all fans good\n");
 *	} else if (rslt[0] == ENVCTRL_ALL_FANS_BAD) {
 *		printf("all fans bad\n");
 *	} else {
 *		if (rslt[0] & ENVCTRL_FAN0_FAILURE_MASK) {
 *			printf("fan 0 failed or not connected\n");
 *	}
 *	......
 */

#define ENVCTRL_ALL_FANS_GOOD			0x00
#define ENVCTRL_FAN0_FAILURE_MASK		0x01
#define ENVCTRL_FAN1_FAILURE_MASK		0x02
#define ENVCTRL_FAN2_FAILURE_MASK		0x04
#define ENVCTRL_FAN3_FAILURE_MASK		0x08
#define ENVCTRL_FAN4_FAILURE_MASK		0x10
#define ENVCTRL_FAN5_FAILURE_MASK		0x20
#define ENVCTRL_FAN6_FAILURE_MASK		0x40
#define ENVCTRL_FAN7_FAILURE_MASK		0x80
#define ENVCTRL_ALL_FANS_BAD 			0xFF

#endif /* !(_SPARC64_ENVCTRL_H) */

Annotation

Implementation Notes