xref: /kvm-unit-tests/lib/s390x/smp.h (revision 7b2e41767bb8caf91972ee32e4ca85ec630584e2)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * s390x smp
4  *
5  * Copyright (c) 2019 IBM Corp
6  *
7  * Authors:
8  *  Janosch Frank <frankja@linux.ibm.com>
9  */
10 #ifndef _S390X_SMP_H_
11 #define _S390X_SMP_H_
12 
13 #include <asm/arch_def.h>
14 
15 struct cpu_status {
16     uint64_t    fprs[16];                       /* 0x0000 */
17     uint64_t    grs[16];                        /* 0x0080 */
18     struct psw  psw;                            /* 0x0100 */
19     uint8_t     pad_0x0110[0x0118 - 0x0110];    /* 0x0110 */
20     uint32_t    prefix;                         /* 0x0118 */
21     uint32_t    fpc;                            /* 0x011c */
22     uint8_t     pad_0x0120[0x0124 - 0x0120];    /* 0x0120 */
23     uint32_t    todpr;                          /* 0x0124 */
24     uint64_t    cputm;                          /* 0x0128 */
25     uint64_t    ckc;                            /* 0x0130 */
26     uint8_t     pad_0x0138[0x0140 - 0x0138];    /* 0x0138 */
27     uint32_t    ars[16];                        /* 0x0140 */
28     uint64_t    crs[16];                        /* 0x0384 */
29 };
30 
31 int smp_query_num_cpus(void);
32 struct cpu *smp_cpu_from_addr(uint16_t addr);
33 struct cpu *smp_cpu_from_idx(uint16_t idx);
34 uint16_t smp_cpu_addr(uint16_t idx);
35 bool smp_cpu_stopped(uint16_t idx);
36 bool smp_sense_running_status(uint16_t idx);
37 int smp_cpu_restart(uint16_t idx);
38 int smp_cpu_restart_nowait(uint16_t idx);
39 int smp_cpu_start(uint16_t idx, struct psw psw);
40 int smp_cpu_stop(uint16_t idx);
41 int smp_cpu_stop_nowait(uint16_t idx);
42 int smp_cpu_stop_store_status(uint16_t idx);
43 int smp_cpu_destroy(uint16_t idx);
44 int smp_cpu_setup(uint16_t idx, struct psw psw);
45 void smp_teardown(void);
46 void smp_setup(void);
47 int smp_sigp(uint16_t idx, uint8_t order, unsigned long parm, uint32_t *status);
48 struct lowcore *smp_get_lowcore(uint16_t idx);
49 
50 #endif
51