123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994 |
- #ifndef ADSPRPC_SHARED_H
- #define ADSPRPC_SHARED_H
- #include <linux/types.h>
- #include <linux/cdev.h>
- #ifdef CONFIG_MSM_ADSPRPC_TRUSTED
- #include "../include/uapi/fastrpc_shared.h"
- #else
- #include "fastrpc_shared.h"
- #endif
- #define FASTRPC_GLINK_GUID "fastrpcglink-apps-dsp"
- #define FASTRPC_SMD_GUID "fastrpcsmd-apps-dsp"
- #define DEVICE_NAME "adsprpc-smd"
- #define DEVICE_NAME_SECURE "adsprpc-smd-secure"
- #define smq_invoke_ctx_params "pid: %d, tgid: %d, handle: %d, sc: 0x%x, fl: %p, fd: %p, magic: %d\n"
- #define fastrpc_file_params "fl->tgid: %d, fl->cid: %d, fl->ssrcount: %p, fl->pd: %d, fl->profile: %p, fl->mode: %p, fl->tgid_open: %d, fl->num_cached_buf: %d, num_pers_hdrs: %d, fl->sessionid: %d, fl->servloc_name: %s, fl->file_close: %d, fl->dsp_proc_init: %d,fl->apps: %p, fl->qos_request: %d, fl->dev_minor: %d, fl->debug_buf: %s fl->debug_buf_alloced_attempted: %d, fl->wake_enable: %d, fl->ws_timeout: %d, fl->untrusted_process: %d\n"
- #define fastrpc_mmap_params "fd: %d, flags: %p, buf: %p, phys: %p, size : %d, va : %p, map->raddr: %p, len : %d, refs : %d, secure: %d\n"
- #define fastrpc_buf_params "buf->fl: %p, buf->phys: %p, buf->virt: %p, buf->size: %d, buf->dma_attr: %ld, buf->raddr: %p, buf->flags: %d, buf->type: %d, buf->in_use: %d\n"
- #define FASTRPC_ATTR_NOVA 0x1
- #define FASTRPC_ATTR_NON_COHERENT 0x2
- #define FASTRPC_ATTR_COHERENT 0x4
- #define FASTRPC_ATTR_KEEP_MAP 0x8
- #define FASTRPC_ATTR_NOMAP (16)
- #define FASTRPC_ATTR_FORCE_NOFLUSH (32)
- #define FASTRPC_ATTR_FORCE_NOINVALIDATE (64)
- #define FASTRPC_MODE_PARALLEL 0
- #define FASTRPC_MODE_SERIAL 1
- #define FASTRPC_MODE_PROFILE 2
- #define FASTRPC_MODE_SESSION 4
- #define REMOTE_SCALARS_INBUFS(sc) (((sc) >> 16) & 0x0ff)
- #define REMOTE_SCALARS_OUTBUFS(sc) (((sc) >> 8) & 0x0ff)
- #define REMOTE_SCALARS_INHANDLES(sc) (((sc) >> 4) & 0x0f)
- #define REMOTE_SCALARS_OUTHANDLES(sc) ((sc) & 0x0f)
- #define ADSP_DOMAIN_ID (0)
- #define MDSP_DOMAIN_ID (1)
- #define SDSP_DOMAIN_ID (2)
- #define CDSP_DOMAIN_ID (3)
- #define CDSP1_DOMAIN_ID (4)
- #define NUM_CHANNELS 5
- #define NUM_SESSIONS 14
- #define DEFAULT_MAX_SESS_PER_PROC 4
- #define VALID_FASTRPC_CID(cid) \
- (cid >= ADSP_DOMAIN_ID && cid < NUM_CHANNELS)
- #define REMOTE_SCALARS_LENGTH(sc) (REMOTE_SCALARS_INBUFS(sc) +\
- REMOTE_SCALARS_OUTBUFS(sc) +\
- REMOTE_SCALARS_INHANDLES(sc) +\
- REMOTE_SCALARS_OUTHANDLES(sc))
- #define REMOTE_SCALARS_MAKEX(attr, method, in, out, oin, oout) \
- ((((uint32_t) (attr) & 0x7) << 29) | \
- (((uint32_t) (method) & 0x1f) << 24) | \
- (((uint32_t) (in) & 0xff) << 16) | \
- (((uint32_t) (out) & 0xff) << 8) | \
- (((uint32_t) (oin) & 0x0f) << 4) | \
- ((uint32_t) (oout) & 0x0f))
- #define REMOTE_SCALARS_MAKE(method, in, out) \
- REMOTE_SCALARS_MAKEX(0, method, in, out, 0, 0)
- #ifdef VERIFY_PRINT_ERROR
- #define VERIFY_EPRINTF(format, ...) pr_err(format, ##__VA_ARGS__)
- #else
- #define VERIFY_EPRINTF(format, args) ((void)0)
- #endif
- #ifndef VERIFY_PRINT_INFO
- #define VERIFY_IPRINTF(args) ((void)0)
- #endif
- #ifndef VERIFY
- #define __STR__(x) #x ":"
- #define __TOSTR__(x) __STR__(x)
- #define __FILE_LINE__ __FILE__ ":" __TOSTR__(__LINE__)
- #define __ADSPRPC_LINE__ "adsprpc:" __TOSTR__(__LINE__)
- #define VERIFY(err, val) \
- do {\
- VERIFY_IPRINTF(__FILE_LINE__"info: calling: " #val "\n");\
- if ((val) == 0) {\
- (err) = (err) == 0 ? -1 : (err);\
- VERIFY_EPRINTF(__ADSPRPC_LINE__" error: %d: "#val "\n", (err));\
- } else {\
- VERIFY_IPRINTF(__FILE_LINE__"info: passed: " #val "\n");\
- } \
- } while (0)
- #endif
- #define ADSPRPC_ERR(fmt, args...)\
- pr_err("Error: adsprpc (%d): %s: %s: " fmt, __LINE__,\
- current->comm, __func__, ##args)
- #define ADSPRPC_INFO(fmt, args...)\
- pr_info("Info: adsprpc (%d): %s: %s: " fmt, __LINE__,\
- current->comm, __func__, ##args)
- #define ADSPRPC_WARN(fmt, args...)\
- pr_warn("Warning: adsprpc (%d): %s: %s: " fmt, __LINE__,\
- current->comm, __func__, ##args)
- #define ADSPRPC_DEBUG(fmt, args...)\
- pr_debug("Debug: adsprpc (%d): %s: %s: " fmt, __LINE__,\
- current->comm, __func__, ##args)
- #define DEBUG_PRINT_SIZE_LIMIT (512*1024)
- #define remote_arg64_t union remote_arg64
- struct remote_buf64 {
- uint64_t pv;
- uint64_t len;
- };
- struct remote_dma_handle64 {
- int fd;
- uint32_t offset;
- uint32_t len;
- };
- union remote_arg64 {
- struct remote_buf64 buf;
- struct remote_dma_handle64 dma;
- uint32_t h;
- };
- struct remote_buf {
- void *pv;
- size_t len;
- };
- struct fastrpc_proc_sharedbuf_info {
- int buf_fd;
- int buf_size;
- };
- struct remote_dma_handle {
- int fd;
- uint32_t offset;
- };
- union remote_arg {
- struct remote_buf buf;
- struct remote_dma_handle dma;
- uint32_t h;
- };
- struct fastrpc_async_job {
- uint32_t isasyncjob;
- uint64_t jobid;
- uint32_t reserved;
- };
- struct fastrpc_proc_sess_info {
- uint32_t domain_id;
- uint32_t session_id;
- uint32_t pd_type;
- uint32_t sharedcb;
- };
- enum fastrpc_init_flags {
- FASTRPC_INIT_NO_CREATE = -1,
- FASTRPC_INIT_ATTACH = 0,
- FASTRPC_INIT_CREATE = 1,
- FASTRPC_INIT_CREATE_STATIC = 2,
- FASTRPC_INIT_ATTACH_SENSORS = 3,
- };
- enum fastrpc_invoke2_type {
- FASTRPC_INVOKE2_ASYNC = 1,
- FASTRPC_INVOKE2_ASYNC_RESPONSE = 2,
- FASTRPC_INVOKE2_KERNEL_OPTIMIZATIONS,
- FASTRPC_INVOKE2_STATUS_NOTIF,
- FASTRPC_INVOKE2_PROC_SHAREDBUF_INFO,
-
- FASTRPC_INVOKE2_SESS_INFO,
- };
- enum fastrpc_map_flags {
-
- FASTRPC_MAP_STATIC = 0,
-
- FASTRPC_MAP_RESERVED,
-
- FASTRPC_MAP_FD = 2,
-
- FASTRPC_MAP_FD_DELAYED,
-
- FASTRPC_MAP_FD_NOMAP = 16,
- FASTRPC_MAP_MAX,
- };
- enum dsp_map_flags {
-
- ADSP_MMAP_HEAP_ADDR = 4,
-
- ADSP_MMAP_DMA_BUFFER = 6,
-
- ADSP_MMAP_REMOTE_HEAP_ADDR = 8,
-
- ADSP_MMAP_ADD_PAGES = 0x1000,
-
- ADSP_MMAP_ADD_PAGES_LLC = 0x3000,
-
- ADSP_MMAP_PERSIST_HDR = 0x4000,
- };
- enum fastrpc_control_type {
- FASTRPC_CONTROL_LATENCY = 1,
-
- FASTRPC_CONTROL_SMMU = 2,
- FASTRPC_CONTROL_KALLOC = 3,
- FASTRPC_CONTROL_WAKELOCK = 4,
- FASTRPC_CONTROL_PM = 5,
- FASTRPC_CONTROL_DSPPROCESS_CLEAN = 6,
- FASTRPC_CONTROL_RPC_POLL = 7,
- FASTRPC_CONTROL_ASYNC_WAKE = 8,
- FASTRPC_CONTROL_NOTIF_WAKE = 9,
- };
- #define FASTRPC_MAX_DSP_ATTRIBUTES (256)
- #define FASTRPC_MAX_ATTRIBUTES (260)
- enum fastrpc_dsp_capability {
- ASYNC_FASTRPC_CAP = 9,
- DMA_HANDLE_REVERSE_RPC_CAP = 129,
- };
- struct smq_null_invoke {
- uint64_t ctx;
- uint32_t handle;
- uint32_t sc;
- };
- struct smq_phy_page {
- uint64_t addr;
- uint64_t size;
- };
- struct smq_invoke_buf {
- int num;
- int pgidx;
- };
- struct smq_invoke {
- struct smq_null_invoke header;
- struct smq_phy_page page;
- };
- struct smq_msg {
- uint32_t pid;
- uint32_t tid;
- struct smq_invoke invoke;
- };
- struct smq_invoke_rsp {
- uint64_t ctx;
- int retval;
- };
- enum fastrpc_response_flags {
- NORMAL_RESPONSE = 0,
- EARLY_RESPONSE = 1,
- USER_EARLY_SIGNAL = 2,
- COMPLETE_SIGNAL = 3,
- STATUS_RESPONSE = 4,
- POLL_MODE = 5,
- };
- enum fastrpc_process_create_state {
- PROCESS_CREATE_DEFAULT = 0,
- PROCESS_CREATE_IS_INPROGRESS = 1,
- PROCESS_CREATE_SUCCESS = 2,
- };
- struct smq_invoke_rspv2 {
- uint64_t ctx;
- int retval;
- uint32_t flags;
- uint32_t early_wake_time;
- uint32_t version;
- };
- enum fastrpc_status_flags {
- FASTRPC_USERPD_UP = 0,
- FASTRPC_USERPD_EXIT = 1,
- FASTRPC_USERPD_FORCE_KILL = 2,
- FASTRPC_USERPD_EXCEPTION = 3,
- FASTRPC_DSP_SSR = 4,
- };
- struct smq_notif_rspv3 {
- uint64_t ctx;
- uint32_t type;
- int pid;
- uint32_t status;
- };
- enum fastrpc_process_exit_states {
-
- FASTRPC_PROCESS_DEFAULT_STATE = 0,
-
- FASTRPC_PROCESS_EXIT_START = 1,
-
- FASTRPC_PROCESS_DSP_EXIT_INIT = 2,
-
- FASTRPC_PROCESS_DSP_EXIT_COMPLETE = 3,
-
- FASTRPC_PROCESS_DSP_EXIT_ERROR = 4,
- };
- #define DEFAULT_UNUSED 0
- #define ROOT_PD 1
- #define AUDIO_STATICPD 2
- #define SENSORS_STATICPD 3
- #define SECURE_STATICPD 4
- #define OIS_STATICPD 5
- #define CPZ_USERPD 6
- #define USERPD 7
- #define GUEST_OS_SHARED 8
- #define MAX_PD_TYPE 9
- struct fastrpc_file;
- int fastrpc_transport_send(int cid, void *rpc_msg, uint32_t rpc_msg_size, int tvm_remote_domain);
- inline int fastrpc_handle_rpc_response(void *data, int len, int cid);
- inline int verify_transport_device(int cid, int tvm_remote_domain);
- int fastrpc_transport_init(void);
- void fastrpc_transport_deinit(void);
- void fastrpc_transport_session_init(int cid, char *subsys);
- void fastrpc_transport_session_deinit(int cid);
- int fastrpc_wait_for_transport_interrupt(int cid, unsigned int flags);
- int fastrpc_set_tvm_remote_domain(struct fastrpc_file *fl, struct fastrpc_ioctl_init *init);
- void fastrpc_restart_drivers(int cid);
- static inline struct smq_invoke_buf *smq_invoke_buf_start(remote_arg64_t *pra,
- uint32_t sc)
- {
- unsigned int len = REMOTE_SCALARS_LENGTH(sc);
- return (struct smq_invoke_buf *)(&pra[len]);
- }
- static inline struct smq_phy_page *smq_phy_page_start(uint32_t sc,
- struct smq_invoke_buf *buf)
- {
- unsigned int nTotal = REMOTE_SCALARS_LENGTH(sc);
- return (struct smq_phy_page *)(&buf[nTotal]);
- }
- #define FASTRPC_CTX_MAX (1024)
- #define GLINK_MSG_HISTORY_LEN (128)
- enum fastrpc_buf_type {
- METADATA_BUF,
- COPYDATA_BUF,
- INITMEM_BUF,
- USERHEAP_BUF,
- };
- enum fastrpc_msg_type {
-
- USER_MSG = 0,
-
- KERNEL_MSG_WITH_ZERO_PID,
-
- KERNEL_MSG_WITH_NONZERO_PID,
-
- COMPAT_MSG,
- };
- enum fastrpc_remote_pd_type {
- FASTRPC_ROOT_PD = 0,
- FASTRPC_USER_PD,
- FASTRPC_SENSORS_PD,
- };
- #define DSPSIGNAL_TIMEOUT_NONE 0xffffffff
- #define DSPSIGNAL_NUM_SIGNALS 1024
- #define DSPSIGNAL_GROUP_SIZE 256
- struct secure_vm {
- int *vmid;
- int *vmperm;
- int vmcount;
- };
- struct gid_list {
- unsigned int *gids;
- unsigned int gidcount;
- };
- struct fastrpc_buf {
- struct hlist_node hn;
- struct hlist_node hn_rem;
- struct hlist_node hn_init;
- struct fastrpc_file *fl;
- void *virt;
- uint64_t phys;
- size_t size;
- unsigned long dma_attr;
- uintptr_t raddr;
- uint32_t flags;
- int type;
- bool in_use;
- struct timespec64 buf_start_time;
- struct timespec64 buf_end_time;
- };
- struct fastrpc_ctx_lst;
- struct fastrpc_tx_msg {
- struct smq_msg msg;
- int transport_send_err;
- int64_t ns;
- uint64_t xo_time_in_us;
- uint64_t xo_time_in_us_interrupted;
- uint64_t xo_time_in_us_restored;
- };
- struct fastrpc_rx_msg {
- struct smq_invoke_rspv2 rsp;
- int64_t ns;
- uint64_t xo_time_in_us;
- };
- struct fastrpc_transport_log {
- unsigned int tx_index;
- unsigned int rx_index;
-
- struct fastrpc_tx_msg tx_msgs[GLINK_MSG_HISTORY_LEN];
-
- struct fastrpc_rx_msg rx_msgs[GLINK_MSG_HISTORY_LEN];
- spinlock_t lock;
- };
- struct overlap {
- uintptr_t start;
- uintptr_t end;
- int raix;
- uintptr_t mstart;
- uintptr_t mend;
- uintptr_t offset;
- int do_cmo;
- };
- struct fastrpc_perf {
- uint64_t count;
- uint64_t flush;
- uint64_t map;
- uint64_t copy;
- uint64_t link;
- uint64_t getargs;
- uint64_t putargs;
- uint64_t invargs;
- uint64_t invoke;
- uint64_t tid;
- };
- struct smq_notif_rsp {
- struct list_head notifn;
- int domain;
- int session;
- enum fastrpc_status_flags status;
- };
- struct smq_invoke_ctx {
- struct hlist_node hn;
-
- struct hlist_node asyncn;
- struct completion work;
- int retval;
- int pid;
- int tgid;
- remote_arg_t *lpra;
- remote_arg64_t *rpra;
- remote_arg64_t *lrpra;
- int *fds;
- unsigned int *attrs;
- struct fastrpc_mmap **maps;
- struct fastrpc_buf *buf;
- struct fastrpc_buf *copybuf;
- size_t used;
- struct fastrpc_file *fl;
- uint32_t handle;
- uint32_t sc;
- struct overlap *overs;
- struct overlap **overps;
- struct smq_msg msg;
- uint32_t *crc;
- uint64_t *perf_kernel;
- uint64_t *perf_dsp;
- unsigned int magic;
- uint64_t ctxid;
- struct fastrpc_perf *perf;
-
- enum fastrpc_response_flags rsp_flags;
-
- uint32_t early_wake_time;
-
- bool is_work_done;
-
- struct fastrpc_async_job asyncjob;
-
- bool is_early_wakeup;
- uint32_t sc_interrupted;
- struct fastrpc_file *fl_interrupted;
- uint32_t handle_interrupted;
- uint64_t xo_time_in_us_created;
- uint64_t xo_time_in_us_interrupted;
- uint64_t xo_time_in_us_restored;
- int tx_index;
- bool is_job_sent_to_remote_ss;
- };
- struct fastrpc_ctx_lst {
- struct hlist_head pending;
- struct hlist_head interrupted;
-
- uint32_t num_active_ctxs;
-
- struct hlist_head async_queue;
-
- struct list_head notif_queue;
- };
- struct fastrpc_smmu {
- struct device *dev;
- const char *dev_name;
- int cb;
- int enabled;
- int faults;
- int secure;
- int coherent;
- int sharedcb;
- int pd_type;
-
- struct gen_pool *frpc_genpool;
-
- struct fastrpc_buf *frpc_genpool_buf;
-
- unsigned long genpool_iova;
-
- size_t genpool_size;
- };
- struct fastrpc_session_ctx {
- struct device *dev;
- struct fastrpc_smmu smmu;
- int used;
- };
- struct fastrpc_static_pd {
- char *servloc_name;
- char *spdname;
- void *pdrhandle;
- uint64_t pdrcount;
- uint64_t prevpdrcount;
- atomic_t ispdup;
- int cid;
- wait_queue_head_t wait_for_pdup;
- };
- struct fastrpc_dsp_capabilities {
- uint32_t is_cached;
- uint32_t dsp_attributes[FASTRPC_MAX_DSP_ATTRIBUTES];
- };
- struct fastrpc_channel_ctx {
- char *name;
- char *subsys;
- struct device *dev;
- struct fastrpc_session_ctx session[NUM_SESSIONS];
- struct fastrpc_static_pd spd[NUM_SESSIONS];
- struct completion work;
- struct completion workport;
- struct notifier_block nb;
- struct mutex smd_mutex;
- uint64_t sesscount;
- uint64_t ssrcount;
- int in_hib;
- void *handle;
- uint64_t prevssrcount;
- int subsystemstate;
- int vmid;
- struct secure_vm rhvm;
- void *rh_dump_dev;
-
- int secure;
-
- bool unsigned_support;
- struct fastrpc_dsp_capabilities dsp_cap_kernel;
-
- uint64_t cpuinfo_todsp;
- bool cpuinfo_status;
- struct smq_invoke_ctx *ctxtable[FASTRPC_CTX_MAX];
- spinlock_t ctxlock;
- struct fastrpc_transport_log gmsg_log;
- struct hlist_head initmems;
-
- struct fastrpc_buf *buf;
- };
- struct fastrpc_apps {
- struct fastrpc_channel_ctx *channel;
- struct cdev cdev;
- struct class *class;
- struct smq_phy_page range;
- struct hlist_head maps;
- uint32_t staticpd_flags;
- dev_t dev_no;
- int compat;
- struct hlist_head drivers;
- spinlock_t hlock;
- struct device *dev;
-
- struct device *dev_fastrpc;
- unsigned int latency;
- int transport_initialized;
-
- int fastrpc_bus_register;
- bool legacy_remote_heap;
-
- uint64_t jobid[NUM_CHANNELS];
- struct gid_list gidlist;
- struct device *secure_dev;
- struct device *non_secure_dev;
-
- struct wakeup_source *wake_source_secure;
-
- struct wakeup_source *wake_source;
- uint32_t duplicate_rsp_err_cnt;
- uint32_t max_size_limit;
- struct hlist_head frpc_devices;
- struct hlist_head frpc_drivers;
- struct mutex mut_uid;
-
- int fastrpc_nsp_status;
-
- int share_securecb;
-
- bool cb_pd_type;
-
- unsigned int lowest_capacity_core_count;
-
- bool single_core_latency_vote;
-
- uint32_t max_sess_per_proc;
- };
- struct fastrpc_mmap {
- struct hlist_node hn;
- struct fastrpc_file *fl;
- struct fastrpc_apps *apps;
- int fd;
- uint32_t flags;
- struct dma_buf *buf;
- struct sg_table *table;
- struct dma_buf_attachment *attach;
- struct ion_handle *handle;
- uint64_t phys;
- size_t size;
- uintptr_t va;
- size_t len;
- int refs;
- uintptr_t raddr;
- int secure;
- bool is_persistent;
- int frpc_md_index;
- uintptr_t attr;
- bool in_use;
- struct timespec64 map_start_time;
- struct timespec64 map_end_time;
-
- bool is_filemap;
- bool is_dumped;
- char *servloc_name;
-
- unsigned int ctx_refs;
-
- unsigned int dma_handle_refs;
- };
- enum fastrpc_perfkeys {
- PERF_COUNT = 0,
- PERF_FLUSH = 1,
- PERF_MAP = 2,
- PERF_COPY = 3,
- PERF_LINK = 4,
- PERF_GETARGS = 5,
- PERF_PUTARGS = 6,
- PERF_INVARGS = 7,
- PERF_INVOKE = 8,
- PERF_TID = 9,
- PERF_KEY_MAX = 10,
- };
- struct fastrpc_notif_queue {
-
- atomic_t notif_queue_count;
-
- wait_queue_head_t notif_wait_queue;
-
- spinlock_t nqlock;
- };
- enum fastrpc_dspsignal_state {
- DSPSIGNAL_STATE_UNUSED = 0,
- DSPSIGNAL_STATE_PENDING,
- DSPSIGNAL_STATE_SIGNALED,
- DSPSIGNAL_STATE_CANCELED
- };
- struct fastrpc_dspsignal {
- struct completion comp;
- int state;
- };
- struct memory_snapshot {
-
- size_t heap_bufs_size;
-
- size_t nonheap_bufs_size;
- };
- struct fastrpc_file {
- struct hlist_node hn;
- spinlock_t hlock;
- struct hlist_head maps;
- struct hlist_head cached_bufs;
- uint32_t num_cached_buf;
- struct hlist_head remote_bufs;
- struct fastrpc_ctx_lst clst;
- struct fastrpc_session_ctx *sctx;
- struct fastrpc_buf *init_mem;
- struct kref refcount;
-
- unsigned int num_pers_hdrs;
-
- struct fastrpc_buf *pers_hdr_buf;
-
- struct fastrpc_buf *hdr_bufs;
-
- struct memory_snapshot mem_snap;
- struct fastrpc_session_ctx *secsctx;
- uint32_t mode;
- uint32_t profile;
- int sessionid;
- int tgid_open;
- int tgid;
-
- int tgid_frpc;
- int cid;
- int tvm_remote_domain;
- uint64_t ssrcount;
- int pd;
- char *servloc_name;
- int file_close;
- int dsp_proc_init;
- int sharedcb;
- int pd_type;
- struct fastrpc_apps *apps;
- struct dentry *debugfs_file;
- struct dev_pm_qos_request *dev_pm_qos_req;
- int qos_request;
- struct mutex map_mutex;
- struct mutex internal_map_mutex;
-
- int dev_minor;
- char *debug_buf;
-
- int debug_buf_alloced_attempted;
-
- int wake_enable;
- struct gid_list gidlist;
-
- atomic_t async_queue_job_count;
-
- wait_queue_head_t async_wait_queue;
-
- spinlock_t aqlock;
-
- struct fastrpc_notif_queue proc_state_notif;
- uint32_t ws_timeout;
- bool untrusted_process;
- struct fastrpc_device *device;
-
- struct completion dma_invoke;
-
- bool is_dma_invoke_pend;
-
- uint32_t proc_flags;
-
- bool poll_mode;
-
- uint32_t poll_timeout;
-
- enum fastrpc_process_create_state dsp_process_state;
- bool is_unsigned_pd;
-
- struct fastrpc_dspsignal *signal_groups[DSPSIGNAL_NUM_SIGNALS / DSPSIGNAL_GROUP_SIZE];
- spinlock_t dspsignals_lock;
- struct mutex signal_create_mutex;
- struct completion shutdown;
-
- bool exit_notif;
-
- bool exit_async;
-
- struct fastrpc_proc_sharedbuf_info sharedbuf_info;
-
- bool multi_session_support;
-
- bool set_session_info;
- };
- int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode,
- uint32_t kernel,
- struct fastrpc_ioctl_invoke_async *inv);
- int fastrpc_internal_invoke2(struct fastrpc_file *fl,
- struct fastrpc_ioctl_invoke2 *inv2, bool is_compat);
- int fastrpc_internal_munmap(struct fastrpc_file *fl,
- struct fastrpc_ioctl_munmap *ud);
- int fastrpc_internal_mem_map(struct fastrpc_file *fl,
- struct fastrpc_ioctl_mem_map *ud);
- int fastrpc_internal_mem_unmap(struct fastrpc_file *fl,
- struct fastrpc_ioctl_mem_unmap *ud);
- int fastrpc_internal_mmap(struct fastrpc_file *fl,
- struct fastrpc_ioctl_mmap *ud);
- int fastrpc_init_process(struct fastrpc_file *fl,
- struct fastrpc_ioctl_init_attrs *uproc);
- int fastrpc_get_info(struct fastrpc_file *fl, uint32_t *info);
- int fastrpc_internal_control(struct fastrpc_file *fl,
- struct fastrpc_ioctl_control *cp);
- int fastrpc_setmode(unsigned long ioctl_param,
- struct fastrpc_file *fl);
- int fastrpc_get_info_from_kernel(
- struct fastrpc_ioctl_capability *cap,
- struct fastrpc_file *fl);
- int fastrpc_dspsignal_signal(struct fastrpc_file *fl,
- struct fastrpc_ioctl_dspsignal_signal *sig);
- int fastrpc_dspsignal_wait(struct fastrpc_file *fl,
- struct fastrpc_ioctl_dspsignal_wait *wait);
- int fastrpc_dspsignal_create(struct fastrpc_file *fl,
- struct fastrpc_ioctl_dspsignal_create *create);
- int fastrpc_dspsignal_destroy(struct fastrpc_file *fl,
- struct fastrpc_ioctl_dspsignal_destroy *destroy);
- int fastrpc_dspsignal_cancel_wait(struct fastrpc_file *fl,
- struct fastrpc_ioctl_dspsignal_cancel_wait *cancel);
- void fastrpc_rproc_trace_events(const char *name, const char *event,
- const char *subevent);
- #endif
|