Files
android/drivers/misc/mediatek/apusys/midware/1.1/mdw_usr.h
T
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

74 lines
2.1 KiB
C

/*
* Copyright (C) 2020 MediaTek Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __APUSYS_MDW_USR_H__
#define __APUSYS_MDW_USR_H__
#include "apusys_drv.h"
#include "apusys_device.h"
#include "mdw_cmd.h"
#include <linux/kref.h>
#include <linux/idr.h>
struct mdw_usr_mgr {
struct list_head list;
struct mutex mtx;
};
struct mdw_usr {
uint64_t id;
pid_t pid;
pid_t tgid;
char comm[TASK_COMM_LEN];
uint32_t iova_size_max;
uint32_t iova_size;
struct list_head m_item; // to usr mgr
struct mutex mtx;
struct kref kref;
struct idr cmds_idr;
struct list_head mem_list; // for mem
struct list_head sdev_list; // for sec dev
};
void mdw_usr_dump(struct seq_file *s);
int mdw_usr_mem_alloc(struct apusys_mem *um, struct mdw_usr *u);
int mdw_usr_mem_free(struct apusys_mem *um, struct mdw_usr *u);
int mdw_usr_mem_import(struct apusys_mem *um, struct mdw_usr *u);
int mdw_usr_mem_map(struct apusys_mem *um, struct mdw_usr *u);
int mdw_usr_dev_sec_alloc(int type, struct mdw_usr *u);
int mdw_usr_dev_sec_free(int type, struct mdw_usr *u);
int mdw_usr_fw(struct apusys_ioctl_fw *f, int op);
int mdw_usr_ucmd(struct apusys_ioctl_ucmd *uc);
int mdw_usr_set_pwr(struct apusys_ioctl_power *pwr);
struct mdw_usr *mdw_usr_create(void);
int mdw_usr_put(struct mdw_usr *u);
void mdw_usr_get(struct mdw_usr *u);
bool mdw_user_check(struct mdw_usr *u);
void mdw_usr_destroy(struct kref *kref);
int mdw_usr_run_cmd_async(struct mdw_usr *u, struct apusys_ioctl_cmd *in);
int mdw_usr_wait_cmd(struct mdw_usr *u, struct apusys_ioctl_cmd *in);
int mdw_usr_run_cmd_sync(struct mdw_usr *u, struct apusys_ioctl_cmd *in);
int mdw_usr_init(void);
void mdw_usr_exit(void);
void mdw_usr_print_mem_usage(void);
void mdw_usr_sys_aee_mem(char *buf, int *n);
#endif