9
3

my_cpu.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Copyright (c) 2013, MariaDB foundation Ab and SkySQL
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
  12. */
  13. /* instructions for specific cpu's */
  14. /*
  15. Macros for adjusting thread priority (hardware multi-threading)
  16. The defines are the same ones used by the linux kernel
  17. */
  18. #if defined(__powerpc__)
  19. /* Very low priority */
  20. #define HMT_very_low() asm volatile("or 31,31,31")
  21. /* Low priority */
  22. #define HMT_low() asm volatile("or 1,1,1")
  23. /* Medium low priority */
  24. #define HMT_medium_low() asm volatile("or 6,6,6")
  25. /* Medium priority */
  26. #define HMT_medium() asm volatile("or 2,2,2")
  27. /* Medium high priority */
  28. #define HMT_medium_high() asm volatile("or 5,5,5")
  29. /* High priority */
  30. #define HMT_high() asm volatile("or 3,3,3")
  31. #else
  32. #define HMT_very_low()
  33. #define HMT_low()
  34. #define HMT_medium_low()
  35. #define HMT_medium()
  36. #define HMT_medium_high()
  37. #define HMT_high()
  38. #endif