Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/tools/testing/selftests/arm64/signal/sve_helpers.h
26292 views
1
/* SPDX-License-Identifier: GPL-2.0 */
2
/*
3
* Copyright (C) 2024 ARM Limited
4
*
5
* Common helper functions for SVE and SME functionality.
6
*/
7
8
#ifndef __SVE_HELPERS_H__
9
#define __SVE_HELPERS_H__
10
11
#include <stdbool.h>
12
13
#define VLS_USE_SVE false
14
#define VLS_USE_SME true
15
16
extern unsigned int vls[];
17
extern unsigned int nvls;
18
19
int sve_fill_vls(bool use_sme, int min_vls);
20
21
static inline uint64_t get_svcr(void)
22
{
23
uint64_t val;
24
25
asm volatile (
26
"mrs %0, S3_3_C4_C2_2\n"
27
: "=r"(val)
28
:
29
: "cc");
30
31
return val;
32
}
33
34
#endif
35
36