sbi_ipi.c 616 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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/encoding.h>
  8. #include <asm/sbi.h>
  9. int riscv_init_ipi(void)
  10. {
  11. return 0;
  12. }
  13. int riscv_send_ipi(int hart)
  14. {
  15. ulong mask;
  16. mask = 1UL << hart;
  17. sbi_send_ipi(&mask);
  18. return 0;
  19. }
  20. int riscv_clear_ipi(int hart)
  21. {
  22. csr_clear(CSR_SIP, SIP_SSIP);
  23. return 0;
  24. }
  25. int riscv_get_ipi(int hart, int *pending)
  26. {
  27. /*
  28. * The SBI does not support reading the IPI status. We always return 0
  29. * to indicate that no IPI is pending.
  30. */
  31. *pending = 0;
  32. return 0;
  33. }