xref: /OK3568_Linux_fs/kernel/tools/power/cpupower/utils/helpers/topology.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  *  (C) 2010,2011       Thomas Renninger <trenn@suse.de>, Novell Inc.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * ToDo: Needs to be done more properly for AMD/Intel specifics
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun /* Helper struct for qsort, must be in sync with cpupower_topology.cpu_info */
9*4882a593Smuzhiyun /* Be careful: Need to pass unsigned to the sort, so that offlined cores are
10*4882a593Smuzhiyun    in the end, but double check for -1 for offlined cpus at other places */
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #include <stdlib.h>
13*4882a593Smuzhiyun #include <stdio.h>
14*4882a593Smuzhiyun #include <unistd.h>
15*4882a593Smuzhiyun #include <errno.h>
16*4882a593Smuzhiyun #include <fcntl.h>
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun #include <cpuidle.h>
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun /* CPU topology/hierarchy parsing ******************/
21*4882a593Smuzhiyun 
22