aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-10-14 14:01:15 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-10-14 14:01:15 +0000
commitd2317d50ae2402e5335f2ed807a166359565566b (patch)
treee1da597f34748f3f862b014171a86a7c421d2d21 /libgo
parentea9782106cd2cfbb53237024dcc984a26acb7130 (diff)
downloadgcc-d2317d50ae2402e5335f2ed807a166359565566b.zip
gcc-d2317d50ae2402e5335f2ed807a166359565566b.tar.gz
gcc-d2317d50ae2402e5335f2ed807a166359565566b.tar.bz2
internal/cpu: define kdsaQuery for s390
Patch from Andreas Krebbel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201037 From-SVN: r276962
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/internal/cpu/cpu_gccgo.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libgo/go/internal/cpu/cpu_gccgo.c b/libgo/go/internal/cpu/cpu_gccgo.c
index ed0e7bff..6b40f01 100644
--- a/libgo/go/internal/cpu/cpu_gccgo.c
+++ b/libgo/go/internal/cpu/cpu_gccgo.c
@@ -184,4 +184,19 @@ struct queryResult klmdQuery() {
return ret;
}
+struct queryResult kdsaQuery(void)
+ __asm__(GOSYM_PREFIX "internal..z2fcpu.kdsaQuery")
+ __attribute__((no_split_stack));
+
+struct queryResult kdsaQuery() {
+ struct queryResult ret;
+
+ __asm__ ("lghi %%r0, 0\t\n" // set function code to 0 (KDSA-Query)
+ "la %%r1, %[ret]\t\n"
+ ".long 0xb93a0024\t\n" // kdsa
+ :[ret] "=QRST" (ret) : : "r0", "r1", "cc");
+
+ return ret;
+}
+
#endif /* defined(__s390x__) */