162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * (C) 2010,2011 Thomas Renninger <trenn@suse.de>, Novell Inc. 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * ToDo: Needs to be done more properly for AMD/Intel specifics 662306a36Sopenharmony_ci */ 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci/* Helper struct for qsort, must be in sync with cpupower_topology.cpu_info */ 962306a36Sopenharmony_ci/* Be careful: Need to pass unsigned to the sort, so that offlined cores are 1062306a36Sopenharmony_ci in the end, but double check for -1 for offlined cpus at other places */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <stdlib.h> 1362306a36Sopenharmony_ci#include <stdio.h> 1462306a36Sopenharmony_ci#include <unistd.h> 1562306a36Sopenharmony_ci#include <errno.h> 1662306a36Sopenharmony_ci#include <fcntl.h> 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci#include <cpuidle.h> 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci/* CPU topology/hierarchy parsing ******************/ 2162306a36Sopenharmony_ci 22