internal/cpu: define kdsaQuery for s390

Patch from Andreas Krebbel.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201037

From-SVN: r276962
This commit is contained in:
Ian Lance Taylor 2019-10-14 14:01:15 +00:00
parent ea9782106c
commit d2317d50ae
2 changed files with 16 additions and 1 deletions

View File

@ -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.

View File

@ -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__) */