xref: /openbsd-src/sys/dev/pci/drm/include/linux/soc/apple/rtkit.h (revision 5dd0baa8251145fcf503b060e3a9291086883454)
1 /* Public domain. */
2 
3 #ifndef _LINUX_SOC_APPLE_RTKIT_H
4 #define _LINUX_SOC_APPLE_RTKIT_H
5 
6 #include <linux/bitfield.h>
7 
8 struct apple_rtkit;
9 
10 struct apple_rtkit_shmem {
11 	dma_addr_t iova;
12 	void *buffer;
13 	size_t size;
14 	int is_mapped;
15 };
16 
17 struct apple_rtkit_ops {
18 	void (*crashed)(void *);
19 	void (*recv_message)(void *, uint8_t, uint64_t);
20 	int (*shmem_setup)(void *, struct apple_rtkit_shmem *);
21 	void (*shmem_destroy)(void *, struct apple_rtkit_shmem *);
22 };
23 
24 struct apple_rtkit *devm_apple_rtkit_init(struct device *, void *,
25 	    const char *, int, const struct apple_rtkit_ops *);
26 
27 int	apple_rtkit_send_message(struct apple_rtkit *, uint8_t, uint64_t,
28 				 struct completion *, int);
29 int	apple_rtkit_start_ep(struct apple_rtkit *, uint8_t);
30 int	apple_rtkit_wake(struct apple_rtkit *);
31 
32 #endif
33