arch/x86/tools/cpufeaturemasks.awk

Source file repositories/reference/linux-study-clean/arch/x86/tools/cpufeaturemasks.awk

File Facts

System
Linux kernel
Corpus path
arch/x86/tools/cpufeaturemasks.awk
Extension
.awk
Size
1941 bytes
Lines
89
Domain
Architecture Layer
Bucket
arch/x86
Inferred role
Architecture Layer: arch/x86
Status
atlas-only

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 (featstat[s, feat]) {
					nfstr = fstr " " feat;
					if (length(nfstr) > 72) {
						printf " *   %s\n", fstr;
						nfstr = " " feat;
					}
					fstr = nfstr;
					mask += (2 ^ j);
				}
			}
			masks[i] = mask;
		}
		printf " *   %s\n */\n", fstr;

		for (i = 0; i < ncapints; i++)
			printf "#define %s_MASK%d\t0x%08xU\n", s, i, masks[i];

		printf "\n#define %s_MASK_BIT_SET(x)\t\t\t\\\n", s;
		printf "\t((\t\t\t\t\t";
		for (i = 0; i < ncapints; i++) {
			if (masks[i])
				printf "\t\\\n\t\t((x) >> 5) == %2d ? %s_MASK%d :", i, s, i;
		}
		printf " 0\t\\\n";
		printf "\t) & (1U << ((x) & 31)))\n\n";
	}

	printf "#endif /* _ASM_X86_CPUFEATUREMASKS_H */\n";
}

Annotation

Implementation Notes