securemsm-kernel : Add new functionality in HLOS for TZ to sleep for certain
amount of time. Change-Id: I6352bbe201ffcf81fde6ac7fc65e6f8eaeb0c64e
This commit is contained in:

committed by
basant kumar

parent
bd912a6bb3
commit
4f96dd41ec
@@ -990,6 +990,23 @@ out:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t smcinvoke_sleep(void *buf, size_t buf_len)
|
||||||
|
{
|
||||||
|
struct smcinvoke_tzcb_req *msg = buf;
|
||||||
|
uint32_t sleepTimeMs_val = 0;
|
||||||
|
|
||||||
|
if (msg->hdr.counts != OBJECT_COUNTS_PACK(1, 0, 0, 0) ||
|
||||||
|
(buf_len - msg->args[0].b.offset < msg->args[0].b.size)) {
|
||||||
|
pr_err("Invalid counts received for sleeping in hlos\n");
|
||||||
|
return OBJECT_ERROR_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Time in miliseconds is expected from tz */
|
||||||
|
sleepTimeMs_val = *((uint32_t *)(buf + msg->args[0].b.offset));
|
||||||
|
msleep(sleepTimeMs_val);
|
||||||
|
return OBJECT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static void process_kernel_obj(void *buf, size_t buf_len)
|
static void process_kernel_obj(void *buf, size_t buf_len)
|
||||||
{
|
{
|
||||||
struct smcinvoke_tzcb_req *cb_req = buf;
|
struct smcinvoke_tzcb_req *cb_req = buf;
|
||||||
@@ -1001,6 +1018,9 @@ static void process_kernel_obj(void *buf, size_t buf_len)
|
|||||||
case OBJECT_OP_YIELD:
|
case OBJECT_OP_YIELD:
|
||||||
cb_req->result = OBJECT_OK;
|
cb_req->result = OBJECT_OK;
|
||||||
break;
|
break;
|
||||||
|
case OBJECT_OP_SLEEP:
|
||||||
|
cb_req->result = smcinvoke_sleep(buf, buf_len);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
pr_err(" invalid operation for tz kernel object\n");
|
pr_err(" invalid operation for tz kernel object\n");
|
||||||
cb_req->result = OBJECT_ERROR_INVALID;
|
cb_req->result = OBJECT_ERROR_INVALID;
|
||||||
|
Reference in New Issue
Block a user