Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/sysinfo: Move stsi() to header file

Move stsi() inline assembly to header file so it is possible to use it
also for the decompressor.

Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Heiko Carstens and committed by
Vasily Gorbik
91d6e442 a130b6d6

+27 -27
+27 -1
arch/s390/include/asm/sysinfo.h
··· 11 11 #ifndef __ASM_S390_SYSINFO_H 12 12 #define __ASM_S390_SYSINFO_H 13 13 14 - #include <asm/bitsperlong.h> 15 14 #include <linux/uuid.h> 15 + #include <asm/bitsperlong.h> 16 + #include <asm/asm.h> 17 + 18 + /* 19 + * stsi - store system information 20 + * 21 + * Returns the current configuration level if function code 0 was specified. 22 + * Otherwise returns 0 on success or a negative value on error. 23 + */ 24 + static inline int stsi(void *sysinfo, int fc, int sel1, int sel2) 25 + { 26 + int r0 = (fc << 28) | sel1; 27 + int cc; 28 + 29 + asm volatile( 30 + " lr %%r0,%[r0]\n" 31 + " lr %%r1,%[r1]\n" 32 + " stsi %[sysinfo]\n" 33 + " lr %[r0],%%r0\n" 34 + CC_IPM(cc) 35 + : CC_OUT(cc, cc), [r0] "+d" (r0), [sysinfo] "=Q" (*(char *)sysinfo) 36 + : [r1] "d" (sel2) 37 + : CC_CLOBBER_LIST("0", "1", "memory")); 38 + if (cc == 3) 39 + return -EOPNOTSUPP; 40 + return fc ? 0 : (unsigned int)r0 >> 28; 41 + } 16 42 17 43 struct sysinfo_1_1_1 { 18 44 unsigned char p:1;
-26
arch/s390/kernel/sysinfo.c
··· 26 26 27 27 int topology_max_mnest; 28 28 29 - /* 30 - * stsi - store system information 31 - * 32 - * Returns the current configuration level if function code 0 was specified. 33 - * Otherwise returns 0 on success or a negative value on error. 34 - */ 35 - int stsi(void *sysinfo, int fc, int sel1, int sel2) 36 - { 37 - int r0 = (fc << 28) | sel1; 38 - int cc; 39 - 40 - asm volatile( 41 - " lr %%r0,%[r0]\n" 42 - " lr %%r1,%[r1]\n" 43 - " stsi %[sysinfo]\n" 44 - " lr %[r0],%%r0\n" 45 - CC_IPM(cc) 46 - : CC_OUT(cc, cc), [r0] "+d" (r0), [sysinfo] "=Q" (*(char *)sysinfo) 47 - : [r1] "d" (sel2) 48 - : CC_CLOBBER_LIST("0", "1", "memory")); 49 - if (cc == 3) 50 - return -EOPNOTSUPP; 51 - return fc ? 0 : (unsigned int)r0 >> 28; 52 - } 53 - EXPORT_SYMBOL(stsi); 54 - 55 29 #ifdef CONFIG_PROC_FS 56 30 57 31 static bool convert_ext_name(unsigned char encoding, char *name, size_t len)