rtkit-internal.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
  2. /*
  3. * Apple RTKit IPC library
  4. * Copyright (C) The Asahi Linux Contributors
  5. */
  6. #ifndef _APPLE_RTKIT_INTERAL_H
  7. #define _APPLE_RTKIT_INTERAL_H
  8. #include <linux/bitfield.h>
  9. #include <linux/bitmap.h>
  10. #include <linux/completion.h>
  11. #include <linux/dma-mapping.h>
  12. #include <linux/io.h>
  13. #include <linux/kernel.h>
  14. #include <linux/module.h>
  15. #include <linux/slab.h>
  16. #include <linux/soc/apple/rtkit.h>
  17. #include <linux/workqueue.h>
  18. #include "mailbox.h"
  19. #define APPLE_RTKIT_APP_ENDPOINT_START 0x20
  20. #define APPLE_RTKIT_MAX_ENDPOINTS 0x100
  21. struct apple_rtkit {
  22. void *cookie;
  23. const struct apple_rtkit_ops *ops;
  24. struct device *dev;
  25. struct apple_mbox *mbox;
  26. struct completion epmap_completion;
  27. struct completion iop_pwr_ack_completion;
  28. struct completion ap_pwr_ack_completion;
  29. int boot_result;
  30. int version;
  31. unsigned int iop_power_state;
  32. unsigned int ap_power_state;
  33. bool crashed;
  34. DECLARE_BITMAP(endpoints, APPLE_RTKIT_MAX_ENDPOINTS);
  35. struct apple_rtkit_shmem ioreport_buffer;
  36. struct apple_rtkit_shmem crashlog_buffer;
  37. struct apple_rtkit_shmem syslog_buffer;
  38. char *syslog_msg_buffer;
  39. size_t syslog_n_entries;
  40. size_t syslog_msg_size;
  41. struct workqueue_struct *wq;
  42. };
  43. void apple_rtkit_crashlog_dump(struct apple_rtkit *rtk, u8 *bfr, size_t size);
  44. #endif