sbi_ipi.c 536 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2019 Fraunhofer AISEC,
  4. * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
  5. */
  6. #include <common.h>
  7. #include <asm/sbi.h>
  8. int riscv_send_ipi(int hart)
  9. {
  10. ulong mask;
  11. mask = 1UL << hart;
  12. sbi_send_ipi(&mask);
  13. return 0;
  14. }
  15. int riscv_clear_ipi(int hart)
  16. {
  17. sbi_clear_ipi();
  18. return 0;
  19. }
  20. int riscv_get_ipi(int hart, int *pending)
  21. {
  22. /*
  23. * The SBI does not support reading the IPI status. We always return 0
  24. * to indicate that no IPI is pending.
  25. */
  26. *pending = 0;
  27. return 0;
  28. }