1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
3 * Apple RTKit IPC library
4 * Copyright (C) The Asahi Linux Contributors
7 #ifndef _APPLE_RTKIT_INTERAL_H
8 #define _APPLE_RTKIT_INTERAL_H
10 #include <linux/bitfield.h>
11 #include <linux/bitmap.h>
12 #include <linux/completion.h>
13 #include <linux/dma-mapping.h>
15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/slab.h>
18 #include <linux/soc/apple/rtkit.h>
19 #include <linux/workqueue.h>
22 #define APPLE_RTKIT_APP_ENDPOINT_START 0x20
23 #define APPLE_RTKIT_MAX_ENDPOINTS 0x100
27 const struct apple_rtkit_ops *ops;
30 struct apple_mbox *mbox;
32 struct completion epmap_completion;
33 struct completion iop_pwr_ack_completion;
34 struct completion ap_pwr_ack_completion;
39 unsigned int iop_power_state;
40 unsigned int ap_power_state;
43 DECLARE_BITMAP(endpoints, APPLE_RTKIT_MAX_ENDPOINTS);
45 struct apple_rtkit_shmem ioreport_buffer;
46 struct apple_rtkit_shmem crashlog_buffer;
48 struct apple_rtkit_shmem syslog_buffer;
49 char *syslog_msg_buffer;
50 size_t syslog_n_entries;
51 size_t syslog_msg_size;
53 struct workqueue_struct *wq;
56 void apple_rtkit_crashlog_dump(struct apple_rtkit *rtk, u8 *bfr, size_t size);