From d2317d50ae2402e5335f2ed807a166359565566b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 14 Oct 2019 14:01:15 +0000 Subject: [PATCH] internal/cpu: define kdsaQuery for s390 Patch from Andreas Krebbel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201037 From-SVN: r276962 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/internal/cpu/cpu_gccgo.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 1c90e55e9b1..360c76b6026 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -f174fdad69cad42309984dfa108d80f2ae8a9f78 +ed1bd343130ab4907750156d3c04a0cef428bf68 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/internal/cpu/cpu_gccgo.c b/libgo/go/internal/cpu/cpu_gccgo.c index ed0e7bff8cd..6b40f0137a4 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__) */ -- 2.30.2