tunables.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2015 Philippe Gerum <rpm@xenomai.org>.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  16. */
  17. #ifndef _COBALT_TUNABLES_H
  18. #define _COBALT_TUNABLES_H
  19. #include <boilerplate/tunables.h>
  20. #include <sys/cobalt.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. extern int __cobalt_main_prio;
  25. extern int __cobalt_print_bufsz;
  26. extern int __cobalt_print_bufcount;
  27. extern int __cobalt_print_syncdelay;
  28. static inline define_config_tunable(main_prio, int, prio)
  29. {
  30. __cobalt_main_prio = prio;
  31. }
  32. static inline read_config_tunable(main_prio, int)
  33. {
  34. return __cobalt_main_prio;
  35. }
  36. static inline define_config_tunable(print_buffer_size, int, size)
  37. {
  38. __cobalt_print_bufsz = size;
  39. }
  40. static inline read_config_tunable(print_buffer_size, int)
  41. {
  42. return __cobalt_print_bufsz;
  43. }
  44. static inline define_config_tunable(print_buffer_count, int, count)
  45. {
  46. __cobalt_print_bufcount = count;
  47. }
  48. static inline read_config_tunable(print_buffer_count, int)
  49. {
  50. return __cobalt_print_bufcount;
  51. }
  52. static inline define_config_tunable(print_sync_delay, int, delay_ms)
  53. {
  54. __cobalt_print_syncdelay = delay_ms;
  55. }
  56. static inline read_config_tunable(print_sync_delay, int)
  57. {
  58. return __cobalt_print_syncdelay;
  59. }
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* !_COBALT_TUNABLES_H */