Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bafe7896 authored by Dinesh K Garg's avatar Dinesh K Garg Committed by Gerrit - the friendly Code Review server
Browse files

mink: Add support of yield() interface in smcinvoke



When trusted environment is busy, it may ask HLOS to yield i.e.
retry. If HLOS does not have this functionality, it may result in
invocation failure.

Change-Id: I33abfce50bb4c6c88fd51a83a6fe3d6af9b3696a
Signed-off-by: default avatarDinesh K Garg <dineshg@codeaurora.org>
parent c9116b18
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -827,9 +827,17 @@ static void process_kernel_obj(void *buf, size_t buf_len)
{
	struct smcinvoke_tzcb_req *cb_req = buf;

	cb_req->result = (cb_req->hdr.op == OBJECT_OP_MAP_REGION) ?
			smcinvoke_map_mem_region(buf, buf_len) :
			OBJECT_ERROR_INVALID;
	switch (cb_req->hdr.op) {
	case OBJECT_OP_MAP_REGION:
		cb_req->result = smcinvoke_map_mem_region(buf, buf_len);
		break;
	case OBJECT_OP_YIELD:
		cb_req->result = OBJECT_OK;
		break;
	default:
		cb_req->result = OBJECT_ERROR_INVALID;
		break;
	}
}

static void process_mem_obj(void *buf, size_t buf_len)
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */
#ifndef __SMCINVOKE_OBJECT_H
#define __SMCINVOKE_OBJECT_H
@@ -16,6 +16,7 @@
#define OBJECT_OP_RELEASE       (OBJECT_OP_METHOD_MASK - 0)
#define OBJECT_OP_RETAIN        (OBJECT_OP_METHOD_MASK - 1)
#define OBJECT_OP_MAP_REGION    0
#define OBJECT_OP_YIELD 1

#define OBJECT_COUNTS_MAX_BI   0xF
#define OBJECT_COUNTS_MAX_BO   0xF