cpumask.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/cpumask.h>
  3. __rust_helper
  4. void rust_helper_cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
  5. {
  6. cpumask_set_cpu(cpu, dstp);
  7. }
  8. __rust_helper
  9. void rust_helper___cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
  10. {
  11. __cpumask_set_cpu(cpu, dstp);
  12. }
  13. __rust_helper
  14. void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
  15. {
  16. cpumask_clear_cpu(cpu, dstp);
  17. }
  18. __rust_helper
  19. void rust_helper___cpumask_clear_cpu(int cpu, struct cpumask *dstp)
  20. {
  21. __cpumask_clear_cpu(cpu, dstp);
  22. }
  23. __rust_helper
  24. bool rust_helper_cpumask_test_cpu(int cpu, struct cpumask *srcp)
  25. {
  26. return cpumask_test_cpu(cpu, srcp);
  27. }
  28. __rust_helper
  29. void rust_helper_cpumask_setall(struct cpumask *dstp)
  30. {
  31. cpumask_setall(dstp);
  32. }
  33. __rust_helper
  34. bool rust_helper_cpumask_empty(struct cpumask *srcp)
  35. {
  36. return cpumask_empty(srcp);
  37. }
  38. __rust_helper
  39. bool rust_helper_cpumask_full(struct cpumask *srcp)
  40. {
  41. return cpumask_full(srcp);
  42. }
  43. __rust_helper
  44. unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
  45. {
  46. return cpumask_weight(srcp);
  47. }
  48. __rust_helper
  49. void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
  50. {
  51. cpumask_copy(dstp, srcp);
  52. }
  53. __rust_helper
  54. bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
  55. {
  56. return alloc_cpumask_var(mask, flags);
  57. }
  58. __rust_helper
  59. bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
  60. {
  61. return zalloc_cpumask_var(mask, flags);
  62. }
  63. #ifndef CONFIG_CPUMASK_OFFSTACK
  64. __rust_helper
  65. void rust_helper_free_cpumask_var(cpumask_var_t mask)
  66. {
  67. free_cpumask_var(mask);
  68. }
  69. #endif