topology.c 619 B

12345678910111213141516171819202122
  1. /*
  2. * (C) 2010,2011 Thomas Renninger <trenn@suse.de>, Novell Inc.
  3. *
  4. * Licensed under the terms of the GNU GPL License version 2.
  5. *
  6. * ToDo: Needs to be done more properly for AMD/Intel specifics
  7. */
  8. /* Helper struct for qsort, must be in sync with cpupower_topology.cpu_info */
  9. /* Be careful: Need to pass unsigned to the sort, so that offlined cores are
  10. in the end, but double check for -1 for offlined cpus at other places */
  11. #include <stdlib.h>
  12. #include <stdio.h>
  13. #include <unistd.h>
  14. #include <errno.h>
  15. #include <fcntl.h>
  16. #include <cpuidle.h>
  17. /* CPU topology/hierarchy parsing ******************/