optee: sync OP-TEE headers
Pulls in updates in the internal headers from OP-TEE OS [1]. A few defines has been shortened, hence the changes in rpc.c. Defines not used by the driver in tee_rpc_cmd.h has been filtered out. Note that this does not change the ABI. Link: [1] https://github.com/OP-TEE/optee_os Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <linux/tee_drv.h>
|
||||
#include "optee_private.h"
|
||||
#include "optee_smc.h"
|
||||
#include "optee_rpc_cmd.h"
|
||||
|
||||
struct wq_entry {
|
||||
struct list_head link;
|
||||
@@ -89,7 +90,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
|
||||
if (!client.adapter)
|
||||
goto bad;
|
||||
|
||||
if (params[1].u.value.a & OPTEE_MSG_RPC_CMD_I2C_FLAGS_TEN_BIT) {
|
||||
if (params[1].u.value.a & OPTEE_RPC_I2C_FLAGS_TEN_BIT) {
|
||||
if (!i2c_check_functionality(client.adapter,
|
||||
I2C_FUNC_10BIT_ADDR)) {
|
||||
i2c_put_adapter(client.adapter);
|
||||
@@ -103,11 +104,11 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
|
||||
snprintf(client.name, I2C_NAME_SIZE, "i2c%d", client.adapter->nr);
|
||||
|
||||
switch (params[0].u.value.a) {
|
||||
case OPTEE_MSG_RPC_CMD_I2C_TRANSFER_RD:
|
||||
case OPTEE_RPC_I2C_TRANSFER_RD:
|
||||
ret = i2c_master_recv(&client, params[2].u.memref.shm->kaddr,
|
||||
params[2].u.memref.size);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_CMD_I2C_TRANSFER_WR:
|
||||
case OPTEE_RPC_I2C_TRANSFER_WR:
|
||||
ret = i2c_master_send(&client, params[2].u.memref.shm->kaddr,
|
||||
params[2].u.memref.size);
|
||||
break;
|
||||
@@ -194,10 +195,10 @@ static void handle_rpc_func_cmd_wq(struct optee *optee,
|
||||
goto bad;
|
||||
|
||||
switch (arg->params[0].u.value.a) {
|
||||
case OPTEE_MSG_RPC_WAIT_QUEUE_SLEEP:
|
||||
case OPTEE_RPC_WAIT_QUEUE_SLEEP:
|
||||
wq_sleep(&optee->wait_queue, arg->params[0].u.value.b);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_WAIT_QUEUE_WAKEUP:
|
||||
case OPTEE_RPC_WAIT_QUEUE_WAKEUP:
|
||||
wq_wakeup(&optee->wait_queue, arg->params[0].u.value.b);
|
||||
break;
|
||||
default:
|
||||
@@ -267,11 +268,11 @@ static struct tee_shm *cmd_alloc_suppl(struct tee_context *ctx, size_t sz)
|
||||
struct tee_shm *shm;
|
||||
|
||||
param.attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT;
|
||||
param.u.value.a = OPTEE_MSG_RPC_SHM_TYPE_APPL;
|
||||
param.u.value.a = OPTEE_RPC_SHM_TYPE_APPL;
|
||||
param.u.value.b = sz;
|
||||
param.u.value.c = 0;
|
||||
|
||||
ret = optee_supp_thrd_req(ctx, OPTEE_MSG_RPC_CMD_SHM_ALLOC, 1, ¶m);
|
||||
ret = optee_supp_thrd_req(ctx, OPTEE_RPC_CMD_SHM_ALLOC, 1, ¶m);
|
||||
if (ret)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -308,10 +309,10 @@ static void handle_rpc_func_cmd_shm_alloc(struct tee_context *ctx,
|
||||
|
||||
sz = arg->params[0].u.value.b;
|
||||
switch (arg->params[0].u.value.a) {
|
||||
case OPTEE_MSG_RPC_SHM_TYPE_APPL:
|
||||
case OPTEE_RPC_SHM_TYPE_APPL:
|
||||
shm = cmd_alloc_suppl(ctx, sz);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_SHM_TYPE_KERNEL:
|
||||
case OPTEE_RPC_SHM_TYPE_KERNEL:
|
||||
shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED);
|
||||
break;
|
||||
default:
|
||||
@@ -383,7 +384,7 @@ static void cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm)
|
||||
struct tee_param param;
|
||||
|
||||
param.attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT;
|
||||
param.u.value.a = OPTEE_MSG_RPC_SHM_TYPE_APPL;
|
||||
param.u.value.a = OPTEE_RPC_SHM_TYPE_APPL;
|
||||
param.u.value.b = tee_shm_get_id(shm);
|
||||
param.u.value.c = 0;
|
||||
|
||||
@@ -400,7 +401,7 @@ static void cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm)
|
||||
*/
|
||||
tee_shm_put(shm);
|
||||
|
||||
optee_supp_thrd_req(ctx, OPTEE_MSG_RPC_CMD_SHM_FREE, 1, ¶m);
|
||||
optee_supp_thrd_req(ctx, OPTEE_RPC_CMD_SHM_FREE, 1, ¶m);
|
||||
}
|
||||
|
||||
static void handle_rpc_func_cmd_shm_free(struct tee_context *ctx,
|
||||
@@ -418,10 +419,10 @@ static void handle_rpc_func_cmd_shm_free(struct tee_context *ctx,
|
||||
|
||||
shm = (struct tee_shm *)(unsigned long)arg->params[0].u.value.b;
|
||||
switch (arg->params[0].u.value.a) {
|
||||
case OPTEE_MSG_RPC_SHM_TYPE_APPL:
|
||||
case OPTEE_RPC_SHM_TYPE_APPL:
|
||||
cmd_free_suppl(ctx, shm);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_SHM_TYPE_KERNEL:
|
||||
case OPTEE_RPC_SHM_TYPE_KERNEL:
|
||||
tee_shm_free(shm);
|
||||
break;
|
||||
default:
|
||||
@@ -458,23 +459,23 @@ static void handle_rpc_func_cmd(struct tee_context *ctx, struct optee *optee,
|
||||
}
|
||||
|
||||
switch (arg->cmd) {
|
||||
case OPTEE_MSG_RPC_CMD_GET_TIME:
|
||||
case OPTEE_RPC_CMD_GET_TIME:
|
||||
handle_rpc_func_cmd_get_time(arg);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_CMD_WAIT_QUEUE:
|
||||
case OPTEE_RPC_CMD_WAIT_QUEUE:
|
||||
handle_rpc_func_cmd_wq(optee, arg);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_CMD_SUSPEND:
|
||||
case OPTEE_RPC_CMD_SUSPEND:
|
||||
handle_rpc_func_cmd_wait(arg);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_CMD_SHM_ALLOC:
|
||||
case OPTEE_RPC_CMD_SHM_ALLOC:
|
||||
free_pages_list(call_ctx);
|
||||
handle_rpc_func_cmd_shm_alloc(ctx, arg, call_ctx);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_CMD_SHM_FREE:
|
||||
case OPTEE_RPC_CMD_SHM_FREE:
|
||||
handle_rpc_func_cmd_shm_free(ctx, arg);
|
||||
break;
|
||||
case OPTEE_MSG_RPC_CMD_I2C_TRANSFER:
|
||||
case OPTEE_RPC_CMD_I2C_TRANSFER:
|
||||
handle_rpc_func_cmd_i2c_transfer(ctx, arg);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user