rtkit-internal.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/apple-mailbox.h>
  9. #include <linux/bitfield.h>
  10. #include <linux/bitmap.h>
  11. #include <linux/completion.h>
  12. #include <linux/dma-mapping.h>
  13. #include <linux/io.h>
  14. #include <linux/kernel.h>
  15. #include <linux/mailbox_client.h>
  16. #include <linux/module.h>
  17. #include <linux/slab.h>
  18. #include <linux/soc/apple/rtkit.h>
  19. #include <linux/workqueue.h>
  20. #define APPLE_RTKIT_APP_ENDPOINT_START 0x20
  21. #define APPLE_RTKIT_MAX_ENDPOINTS 0x100
  22. struct apple_rtkit {
  23. void *cookie;
  24. const struct apple_rtkit_ops *ops;
  25. struct device *dev;
  26. const char *mbox_name;
  27. int mbox_idx;
  28. struct mbox_client mbox_cl;
  29. struct mbox_chan *mbox_chan;
  30. struct completion epmap_completion;
  31. struct completion iop_pwr_ack_completion;
  32. struct completion ap_pwr_ack_completion;
  33. int boot_result;
  34. int version;
  35. unsigned int iop_power_state;
  36. unsigned int ap_power_state;
  37. bool crashed;
  38. DECLARE_BITMAP(endpoints, APPLE_RTKIT_MAX_ENDPOINTS);
  39. struct apple_rtkit_shmem ioreport_buffer;
  40. struct apple_rtkit_shmem crashlog_buffer;
  41. struct apple_rtkit_shmem syslog_buffer;
  42. char *syslog_msg_buffer;
  43. size_t syslog_n_entries;
  44. size_t syslog_msg_size;
  45. struct workqueue_struct *wq;
  46. };
  47. void apple_rtkit_crashlog_dump(struct apple_rtkit *rtk, u8 *bfr, size_t size);
  48. #endif