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

Commit 8e206798 authored by Sudarshan Rajagopalan's avatar Sudarshan Rajagopalan Committed by Gerrit - the friendly Code Review server
Browse files

msm: secure_buffer: Add SPSS_SP_SHARED vmid



Add support for SPSS_SP_SHARED vmid. This vmid is equivalent
to TZ VM, which can be used for sharing memory with TZ with
the assign call.

Change-Id: I10b98820796e8bab7b8275f5ddf44e8814dc0fb0
Signed-off-by: default avatarSudarshan Rajagopalan <sudaraja@codeaurora.org>
parent 33ae0436
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -414,6 +414,8 @@ const char *msm_secure_vmid_to_string(int secure_vmid)
		return "VMID_CP_CAMERA_PREVIEW";
		return "VMID_CP_CAMERA_PREVIEW";
	case VMID_CP_SPSS_SP:
	case VMID_CP_SPSS_SP:
		return "VMID_CP_SPSS_SP";
		return "VMID_CP_SPSS_SP";
	case VMID_CP_SPSS_SP_SHARED:
		return "VMID_CP_SPSS_SP_SHARED";
	case VMID_INVAL:
	case VMID_INVAL:
		return "VMID_INVAL";
		return "VMID_INVAL";
	default:
	default:
+4 −1
Original line number Original line Diff line number Diff line
@@ -620,7 +620,8 @@ bool is_secure_vmid_valid(int vmid)
		vmid == VMID_CP_SEC_DISPLAY ||
		vmid == VMID_CP_SEC_DISPLAY ||
		vmid == VMID_CP_APP ||
		vmid == VMID_CP_APP ||
		vmid == VMID_CP_CAMERA_PREVIEW ||
		vmid == VMID_CP_CAMERA_PREVIEW ||
		vmid == VMID_CP_SPSS_SP);
		vmid == VMID_CP_SPSS_SP ||
		vmid == VMID_CP_SPSS_SP_SHARED);
}
}


unsigned int count_set_bits(unsigned long val)
unsigned int count_set_bits(unsigned long val)
@@ -666,6 +667,8 @@ int get_secure_vmid(unsigned long flags)
		return VMID_CP_CAMERA_PREVIEW;
		return VMID_CP_CAMERA_PREVIEW;
	if (flags & ION_FLAG_CP_SPSS_SP)
	if (flags & ION_FLAG_CP_SPSS_SP)
		return VMID_CP_SPSS_SP;
		return VMID_CP_SPSS_SP;
	if (flags & ION_FLAG_CP_SPSS_SP_SHARED)
		return VMID_CP_SPSS_SP_SHARED;
	return -EINVAL;
	return -EINVAL;
}
}
/* fix up the cases where the ioctl direction bits are incorrect */
/* fix up the cases where the ioctl direction bits are incorrect */
+1 −0
Original line number Original line Diff line number Diff line
@@ -85,6 +85,7 @@ enum cp_mem_usage {
#define ION_FLAG_CP_CAMERA		ION_BIT(21)
#define ION_FLAG_CP_CAMERA		ION_BIT(21)
#define ION_FLAG_CP_HLOS		ION_BIT(22)
#define ION_FLAG_CP_HLOS		ION_BIT(22)
#define ION_FLAG_CP_SPSS_SP		ION_BIT(23)
#define ION_FLAG_CP_SPSS_SP		ION_BIT(23)
#define ION_FLAG_CP_SPSS_SP_SHARED	ION_BIT(24)
#define ION_FLAG_CP_SEC_DISPLAY		ION_BIT(25)
#define ION_FLAG_CP_SEC_DISPLAY		ION_BIT(25)
#define ION_FLAG_CP_APP			ION_BIT(26)
#define ION_FLAG_CP_APP			ION_BIT(26)
#define ION_FLAG_CP_CAMERA_PREVIEW	ION_BIT(27)
#define ION_FLAG_CP_CAMERA_PREVIEW	ION_BIT(27)
+1 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ enum vmid {
	VMID_WLAN_CE = 0x19,
	VMID_WLAN_CE = 0x19,
	VMID_CP_SPSS_SP = 0x1A,
	VMID_CP_SPSS_SP = 0x1A,
	VMID_CP_CAMERA_PREVIEW = 0x1D,
	VMID_CP_CAMERA_PREVIEW = 0x1D,
	VMID_CP_SPSS_SP_SHARED = 0x22,
	VMID_LAST,
	VMID_LAST,
	VMID_INVAL = -1
	VMID_INVAL = -1
};
};