Affinity.h 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef HEADER_Affinity
  2. #define HEADER_Affinity
  3. /*
  4. htop - Affinity.h
  5. (C) 2004-2011 Hisham H. Muhammad
  6. (C) 2020,2023 Red Hat, Inc. All Rights Reserved.
  7. Released under the GNU GPLv2+, see the COPYING file
  8. in the source distribution for its full text.
  9. */
  10. #include "Machine.h"
  11. #if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)
  12. #include <stdbool.h>
  13. #include "Object.h"
  14. #include "Row.h"
  15. #endif
  16. #if defined(HAVE_LIBHWLOC) && defined(HAVE_AFFINITY)
  17. #error hwloc and affinity support are mutual exclusive.
  18. #endif
  19. typedef struct Affinity_ {
  20. Machine* host;
  21. unsigned int size;
  22. unsigned int used;
  23. unsigned int* cpus;
  24. } Affinity;
  25. Affinity* Affinity_new(Machine* host);
  26. void Affinity_delete(Affinity* this);
  27. void Affinity_add(Affinity* this, unsigned int id);
  28. #if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)
  29. Affinity* Affinity_rowGet(const Row* row, Machine* host);
  30. bool Affinity_rowSet(Row* row, Arg arg);
  31. #endif /* HAVE_LIBHWLOC || HAVE_AFFINITY */
  32. #endif