| 1 | /* |
| 2 | * Test clock comparator. |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | */ |
| 6 | .org 0x130 |
| 7 | ext_old_psw: |
| 8 | .org 0x1b0 |
| 9 | ext_new_psw: |
| 10 | .quad 0x180000000, _ext /* 64-bit mode */ |
| 11 | .org 0x1d0 |
| 12 | pgm_new_psw: |
| 13 | .quad 0x2000000000000,0 /* disabled wait */ |
| 14 | .org 0x200 /* lowcore padding */ |
| 15 | |
| 16 | .globl _start |
| 17 | _start: |
| 18 | lpswe start31_psw |
| 19 | _start31: |
| 20 | stctg %c0,%c0,c0 |
| 21 | oi c0+6,8 /* set clock-comparator subclass mask */ |
| 22 | lctlg %c0,%c0,c0 |
| 23 | |
| 24 | 0: |
| 25 | brasl %r14,_f /* %r14's most significant bit is 1 */ |
| 26 | jg 0b |
| 27 | _f: |
| 28 | br %r14 /* it must not end up in ext_old_psw */ |
| 29 | |
| 30 | _ext: |
| 31 | stg %r0,ext_saved_r0 |
| 32 | |
| 33 | lg %r0,ext_counter |
| 34 | aghi %r0,1 |
| 35 | stg %r0,ext_counter |
| 36 | |
| 37 | cgfi %r0,0x1000 |
| 38 | jnz 0f |
| 39 | lpswe success_psw |
| 40 | 0: |
| 41 | |
| 42 | stck clock |
| 43 | lg %r0,clock |
| 44 | agfi %r0,0x40000 /* 64us * 0x1000 =~ 0.25s */ |
| 45 | stg %r0,clock |
| 46 | sckc clock |
| 47 | |
| 48 | lg %r0,ext_saved_r0 |
| 49 | lpswe ext_old_psw |
| 50 | |
| 51 | .align 8 |
| 52 | start31_psw: |
| 53 | .quad 0x100000080000000,_start31 /* EX, 31-bit mode */ |
| 54 | success_psw: |
| 55 | .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ |
| 56 | c0: |
| 57 | .skip 8 |
| 58 | clock: |
| 59 | .quad 0 |
| 60 | ext_counter: |
| 61 | .quad 0 |
| 62 | ext_saved_r0: |
| 63 | .skip 8 |