securemsm-kernel: exposing smcinvoke headers
We are exposing headers present in "include/linux" for the rest of the kernel DLKM's. Aallow other kernel teams to access these headers. Change-Id: I19c5591d885c7042ba3acd312ce9cb2bddc995c9 CRS-Fixed: 3338788
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
8456ddc256
commit
9cd99dbb79
120
include/linux/IClientEnv.h
Normal file
120
include/linux/IClientEnv.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#define IClientEnv_OP_open 0
|
||||
#define IClientEnv_OP_registerLegacy 1
|
||||
#define IClientEnv_OP_register 2
|
||||
#define IClientEnv_OP_registerWithWhitelist 3
|
||||
#define IClientEnv_OP_notifyDomainChange 4
|
||||
#define IClientEnv_OP_registerWithCredentials 5
|
||||
|
||||
#include "smcinvoke_object.h"
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_release(struct Object self)
|
||||
{
|
||||
return Object_invoke(self, Object_OP_release, 0, 0);
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_retain(struct Object self)
|
||||
{
|
||||
return Object_invoke(self, Object_OP_retain, 0, 0);
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_open(struct Object self, uint32_t uid_val, struct Object *obj_ptr)
|
||||
{
|
||||
union ObjectArg a[2];
|
||||
int32_t result;
|
||||
|
||||
a[0].b = (struct ObjectBuf) { &uid_val, sizeof(uint32_t) };
|
||||
|
||||
result = Object_invoke(self, IClientEnv_OP_open, a, ObjectCounts_pack(1, 0, 0, 1));
|
||||
|
||||
*obj_ptr = a[1].o;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_registerLegacy(struct Object self, const void *credentials_ptr, size_t credentials_len,
|
||||
struct Object *clientEnv_ptr)
|
||||
{
|
||||
union ObjectArg a[2];
|
||||
int32_t result;
|
||||
|
||||
a[0].bi = (struct ObjectBufIn) { credentials_ptr, credentials_len * 1 };
|
||||
|
||||
result = Object_invoke(self, IClientEnv_OP_registerLegacy, a,
|
||||
ObjectCounts_pack(1, 0, 0, 1));
|
||||
|
||||
*clientEnv_ptr = a[1].o;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_register(struct Object self, struct Object credentials_val,
|
||||
struct Object *clientEnv_ptr)
|
||||
{
|
||||
union ObjectArg a[2];
|
||||
int32_t result;
|
||||
|
||||
a[0].o = credentials_val;
|
||||
|
||||
result = Object_invoke(self, IClientEnv_OP_register, a,
|
||||
ObjectCounts_pack(0, 0, 1, 1));
|
||||
|
||||
*clientEnv_ptr = a[1].o;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_registerWithWhitelist(struct Object self,
|
||||
struct Object credentials_val, const uint32_t *uids_ptr,
|
||||
size_t uids_len, struct Object *clientEnv_ptr)
|
||||
{
|
||||
union ObjectArg a[3];
|
||||
int32_t result;
|
||||
|
||||
a[1].o = credentials_val;
|
||||
a[0].bi = (struct ObjectBufIn) { uids_ptr, uids_len *
|
||||
sizeof(uint32_t) };
|
||||
|
||||
result = Object_invoke(self, IClientEnv_OP_registerWithWhitelist, a,
|
||||
ObjectCounts_pack(1, 0, 1, 1));
|
||||
|
||||
*clientEnv_ptr = a[2].o;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_notifyDomainChange(struct Object self)
|
||||
{
|
||||
return Object_invoke(self, IClientEnv_OP_notifyDomainChange, 0, 0);
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
IClientEnv_registerWithCredentials(struct Object self, struct Object
|
||||
credentials_val, struct Object *clientEnv_ptr)
|
||||
{
|
||||
union ObjectArg a[2]={{{0,0}}};
|
||||
int32_t result;
|
||||
|
||||
a[0].o = credentials_val;
|
||||
|
||||
result = Object_invoke(self, IClientEnv_OP_registerWithCredentials, a,
|
||||
ObjectCounts_pack(0, 0, 1, 1));
|
||||
|
||||
*clientEnv_ptr = a[1].o;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user