summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArunachalam Ganapathy <arunachalam.ganapathy@arm.com>2023-04-12 10:41:42 +0100
committerArunachalam Ganapathy <arunachalam.ganapathy@arm.com>2023-05-24 13:40:39 +0100
commitd179ddcc64cac3b319b301cfe6c1bc32c1ea0eaf (patch)
treef7ff4f156a0bf64c0f186e057dea7243ecc3ab8c /include
parent0bbdc2dff449036aa65e4c53cd351d01484e0d23 (diff)
refactor(sve): move sve operations to a lib routine
This patch moves the SVE subtract operation to a common sve library routine and takes a callback function that does the world switch while SVE operations are done in a loop. The callback is invoked after z0, z1 vectors are loaded and before the calculated results are stored back in the vector registers. This refactoring later helps to use this function to do context switch from NS to Secure world or from NS to Realm world based on the callback type. This patch also moves the SVE fill vector registers, read vector registers to a common sve library routine. Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com> Change-Id: Iceb34b96fa85597be63a50c429ae0eb29f8fcaf8
Diffstat (limited to 'include')
-rw-r--r--include/lib/extensions/sve.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/lib/extensions/sve.h b/include/lib/extensions/sve.h
index 994fbfe..2fdaa55 100644
--- a/include/lib/extensions/sve.h
+++ b/include/lib/extensions/sve.h
@@ -33,6 +33,16 @@ typedef uint8_t sve_vector_t[SVE_VECTOR_LEN_BYTES];
void sve_config_vq(uint8_t sve_vq);
uint32_t sve_probe_vl(uint8_t sve_max_vq);
+void sve_fill_vector_regs(const sve_vector_t v[SVE_NUM_VECTORS]);
+void sve_read_vector_regs(sve_vector_t v[SVE_NUM_VECTORS]);
+
+/* Assembly routines */
+bool sve_subtract_arrays_interleaved(int *dst_array, int *src_array1,
+ int *src_array2, int array_size,
+ bool (*world_switch_cb)(void));
+
+void sve_subtract_arrays(int *dst_array, int *src_array1, int *src_array2,
+ int array_size);
#ifdef __aarch64__