My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
otz_common.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 /*
24  * Trustzone client driver defintions.
25  */
26 
27 #ifndef __OTZ_COMMON_H_
28 #define __OTZ_COMMON_H_
29 
30 
31 #define OTZ_MAX_REQ_PARAMS 12
32 #define OTZ_MAX_RES_PARAMS 4
33 #define OTZ_1K_SIZE 1024
34 
38 /*enum otz_smc_ret {
39  SMC_ENOMEM = -5,
40  SMC_EOPNOTSUPP = -4,
41  SMC_EINVAL_ADDR = -3,
42  SMC_EINVAL_ARG = -2,
43  SMC_ERROR = -1,
44  SMC_INTERRUPTED = 1,
45  SMC_PENDING = 2,
46  SMC_SUCCESS = 0
47 };
48 */
49 
50 
57  OTZ_STATUS_MAX = 0x7FFFFFFF
58 };
59 
68  OTZ_CMD_TYPE_MAX = 0x7FFFFFFF
69 };
70 
77 };
78 
83  void* dev_file_id;
87  int enc_id;
88 };
89 
94  int type;
95  int len;
96 // #ifdef ARM_ARCH_ARMV7
97  // unsigned int usr_addr;
98 // #else
99  void* usr_addr;
100 // #endif
101  int ret_len;
102 };
103 
107 struct otz_smc_cmd {
108  unsigned int id;
109  unsigned int context;
110  unsigned int enc_id;
111 
112  unsigned int src_id;
113  unsigned int src_context;
114 
115  unsigned int req_buf_len;
116  unsigned int resp_buf_len;
117  unsigned int ret_resp_buf_len;
118  unsigned int cmd_status;
119  #ifdef ARM_ARCH_ARMV7
120  unsigned int req_buf_phys;
121  unsigned int resp_buf_phys;
122  unsigned int meta_data_phys;
123  #else
124  unsigned long req_buf_phys;
125  unsigned long resp_buf_phys;
126  unsigned long meta_data_phys;
127  #endif
128  unsigned int dev_file_id;
129 };
130 
131 #endif /* __OTZ_COMMON_H_ */
unsigned int ret_resp_buf_len
Definition: otz_common.h:117
Definition: otz_common.h:57
int client_pid
Definition: otz_common.h:85
unsigned int enc_id
Definition: otz_common.h:110
int len
Definition: otz_common.h:95
unsigned int id
Definition: otz_common.h:108
int ret_len
Definition: otz_common.h:101
Definition: otz_common.h:76
otzc_param_type
Parameters type.
Definition: otz_common.h:74
void * dev_file_id
Definition: otz_common.h:83
Definition: otz_common.h:68
unsigned int resp_buf_len
Definition: otz_common.h:116
unsigned long req_buf_phys
Definition: otz_common.h:124
Definition: otz_common.h:55
Definition: otz_common.h:75
SMC command structure.
Definition: otz_common.h:107
Definition: otz_common.h:65
unsigned int dev_file_id
Definition: otz_common.h:128
otz_cmd_status
SMC return values.
Definition: otz_common.h:54
unsigned int src_context
Definition: otz_common.h:113
Metadata used for encoding/decoding.
Definition: otz_common.h:93
Shared memory for Notification.
Definition: otz_common.h:82
int enc_id
Definition: otz_common.h:87
Definition: otz_common.h:66
unsigned int req_buf_len
Definition: otz_common.h:115
unsigned int src_id
Definition: otz_common.h:112
unsigned int context
Definition: otz_common.h:109
unsigned long meta_data_phys
Definition: otz_common.h:126
int type
Definition: otz_common.h:94
Definition: otz_common.h:64
Definition: otz_common.h:56
Definition: otz_common.h:67
otz_cmd_type
Command type.
Definition: otz_common.h:63
unsigned long resp_buf_phys
Definition: otz_common.h:125
void * usr_addr
Definition: otz_common.h:99
unsigned int cmd_status
Definition: otz_common.h:118
int session_id
Definition: otz_common.h:86
int service_id
Definition: otz_common.h:84