1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2021 Mark Kettenis <kettenis@openbsd.org>
4  */
5 
6 #define APPLE_RTKIT_PWR_STATE_SLEEP	0x01
7 #define APPLE_RTKIT_PWR_STATE_QUIESCED	0x10
8 #define APPLE_RTKIT_PWR_STATE_ON	0x20
9 
10 struct apple_rtkit_buffer {
11 	void *buffer;
12 	u64 dva;
13 	size_t size;
14 	bool is_mapped;
15 };
16 
17 typedef int (*apple_rtkit_shmem_setup)(void *cookie,
18 				       struct apple_rtkit_buffer *buf);
19 typedef void (*apple_rtkit_shmem_destroy)(void *cookie,
20 					  struct apple_rtkit_buffer *buf);
21 
22 struct apple_rtkit;
23 
24 struct apple_rtkit *apple_rtkit_init(struct mbox_chan *chan, void *cookie,
25 				     apple_rtkit_shmem_setup shmem_setup,
26 				     apple_rtkit_shmem_destroy shmem_destroy);
27 void apple_rtkit_free(struct apple_rtkit *rtk);
28 int apple_rtkit_boot(struct apple_rtkit *rtk);
29 int apple_rtkit_shutdown(struct apple_rtkit *rtk, int pwrstate);
30