chromium/third_party/cpuinfo/src/src/x86/linux/cpuinfo.c

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include <cpuinfo/log.h>
#include <linux/api.h>
#include <x86/linux/api.h>

/*
 * Size, in chars, of the on-stack buffer used for parsing lines of
 * /proc/cpuinfo. This is also the limit on the length of a single line.
 */
#define BUFFER_SIZE

static uint32_t parse_processor_number(const char* processor_start, const char* processor_end) {}

/*
 * Decode APIC ID reported by Linux kernel for x86/x86-64 architecture.
 * Example of APIC ID reported in /proc/cpuinfo:
 *
 *		apicid		: 2
 */
static void parse_apic_id(
	const char* apic_start,
	const char* apic_end,
	struct cpuinfo_x86_linux_processor processor[restrict static 1]) {}

struct proc_cpuinfo_parser_state {};

/*
 *	Decode a single line of /proc/cpuinfo information.
 *	Lines have format <words-with-spaces>[ ]*:[ ]<space-separated words>
 */
static bool parse_line(
	const char* line_start,
	const char* line_end,
	struct proc_cpuinfo_parser_state state[restrict static 1],
	uint64_t line_number) {}

bool cpuinfo_x86_linux_parse_proc_cpuinfo(
	uint32_t max_processors_count,
	struct cpuinfo_x86_linux_processor processors[restrict static max_processors_count]) {}