summaryrefslogtreecommitdiffstats
path: root/include/uapi/misc/adsp_console_ioctl.h
blob: 8a2abd899954b5cb3d01e7abaf203426ca082d5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * include/uapi/misc/adsp_console_ioctl.h
 *
 * A header file for adsp console driver
 *
 * Copyright (C) 2016-2020, NVIDIA CORPORATION. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * 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 __UAPI_ADSP_CNSL_IOCTL_H
#define __UAPI_ADSP_CNSL_IOCTL_H
#include <linux/ioctl.h>

#if !defined(NVADSP_NAME_SZ)
#define NVADSP_NAME_SZ 128
#endif

#define NVADSP_NAME_SZ_MAX	(NVADSP_NAME_SZ - 1)

#if !defined(ARGV_SIZE_IN_WORDS)
#define ARGV_SIZE_IN_WORDS 128
#endif

#define NV_ADSP_CONSOLE_MAGIC 'q'

struct adsp_consol_run_app_arg_t {
	char app_name[NVADSP_NAME_SZ];
	char app_path[NVADSP_NAME_SZ];
	uint32_t args[ARGV_SIZE_IN_WORDS + 1];
	uint64_t ctx1;
	uint64_t ctx2;
};

#define ADSP_CNSL_LOAD _IO(NV_ADSP_CONSOLE_MAGIC, 0x01)
#define ADSP_CNSL_CLR_BUFFER _IO(NV_ADSP_CONSOLE_MAGIC, 0x02)
#define ADSP_CNSL_PUT_DATA _IOW(NV_ADSP_CONSOLE_MAGIC, 0x03, uint32_t *)
#define ADSP_CNSL_RUN_APP _IOWR(NV_ADSP_CONSOLE_MAGIC, 0x04,\
	struct adsp_consol_run_app_arg_t *)
#define ADSP_CNSL_STOP_APP _IOWR(NV_ADSP_CONSOLE_MAGIC, 0x05,\
	struct adsp_consol_run_app_arg_t *)
#define ADSP_CNSL_OPN_MBX _IOW(NV_ADSP_CONSOLE_MAGIC, 0x06,  void *)
#define ADSP_CNSL_CLOSE_MBX _IO(NV_ADSP_CONSOLE_MAGIC, 0x07)
#define ADSP_CNSL_PUT_MBX _IOW(NV_ADSP_CONSOLE_MAGIC, 0x08, uint32_t *)
#define ADSP_CNSL_GET_MBX _IOR(NV_ADSP_CONSOLE_MAGIC, 0x09, uint32_t *)

#endif