Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
0002 /*
0003  * Apple RTKit IPC library
0004  * Copyright (C) The Asahi Linux Contributors
0005  */
0006 
0007 #ifndef _APPLE_RTKIT_INTERAL_H
0008 #define _APPLE_RTKIT_INTERAL_H
0009 
0010 #include <linux/apple-mailbox.h>
0011 #include <linux/bitfield.h>
0012 #include <linux/bitmap.h>
0013 #include <linux/completion.h>
0014 #include <linux/dma-mapping.h>
0015 #include <linux/io.h>
0016 #include <linux/kernel.h>
0017 #include <linux/mailbox_client.h>
0018 #include <linux/module.h>
0019 #include <linux/slab.h>
0020 #include <linux/soc/apple/rtkit.h>
0021 #include <linux/workqueue.h>
0022 
0023 #define APPLE_RTKIT_APP_ENDPOINT_START 0x20
0024 #define APPLE_RTKIT_MAX_ENDPOINTS 0x100
0025 
0026 struct apple_rtkit {
0027     void *cookie;
0028     const struct apple_rtkit_ops *ops;
0029     struct device *dev;
0030 
0031     const char *mbox_name;
0032     int mbox_idx;
0033     struct mbox_client mbox_cl;
0034     struct mbox_chan *mbox_chan;
0035 
0036     struct completion epmap_completion;
0037     struct completion iop_pwr_ack_completion;
0038     struct completion ap_pwr_ack_completion;
0039 
0040     int boot_result;
0041     int version;
0042 
0043     unsigned int iop_power_state;
0044     unsigned int ap_power_state;
0045     bool crashed;
0046 
0047     DECLARE_BITMAP(endpoints, APPLE_RTKIT_MAX_ENDPOINTS);
0048 
0049     struct apple_rtkit_shmem ioreport_buffer;
0050     struct apple_rtkit_shmem crashlog_buffer;
0051 
0052     struct apple_rtkit_shmem syslog_buffer;
0053     char *syslog_msg_buffer;
0054     size_t syslog_n_entries;
0055     size_t syslog_msg_size;
0056 
0057     struct workqueue_struct *wq;
0058 };
0059 
0060 void apple_rtkit_crashlog_dump(struct apple_rtkit *rtk, u8 *bfr, size_t size);
0061 
0062 #endif