xref: /openbmc/qemu/tests/tcg/s390x/mc.S (revision 05caa062)
1    .org 0x8d
2ilc:
3    .org 0x8e
4program_interruption_code:
5    .org 0x94
6monitor_class:
7    .org 0xb0
8monitor_code:
9    .org 0x150
10program_old_psw:
11    .org 0x1d0                              /* program new PSW */
12    .quad 0x180000000,pgm                   /* 64-bit mode */
13    .org 0x200                              /* lowcore padding */
14    .globl _start
15_start:
16    stctg %c8,%c8,c8                        /* enable only monitor class 1 */
17    mvhhi c8+6,0x4000
18    lctlg %c8,%c8,c8
19mc_nop:
20    mc 123,0
21mc_monitor_event:
22    mc 321,1
23    j failure
24mc_specification:
25    mc 333,16
26    j failure
27pgm:
28    lgrl %r0,program_old_psw+8              /* ilc adjustment */
29    llgc %r1,ilc
30    sgr %r0,%r1
31    larl %r1,mc_monitor_event               /* dispatch based on old PSW */
32    cgrje %r0,%r1,pgm_monitor_event
33    larl %r1,mc_specification
34    cgrje %r0,%r1,pgm_specification
35    j failure
36pgm_monitor_event:
37    chhsi program_interruption_code,0x40    /* monitor event? */
38    jne failure
39    chhsi monitor_class,1                   /* class from mc_monitor_event? */
40    jne failure
41    cghsi monitor_code,321                  /* code from mc_monitor_event? */
42    jne failure
43    j mc_specification                      /* next test */
44pgm_specification:
45    chhsi program_interruption_code,6       /* specification exception? */
46    jne failure
47    lpswe success_psw
48failure:
49    lpswe failure_psw
50    .align 8
51c8:
52    .quad 0
53success_psw:
54    .quad 0x2000000000000,0xfff             /* see is_special_wait_psw() */
55failure_psw:
56    .quad 0x2000000000000,0                 /* disabled wait */
57