1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <asm/ppc_asm.h>
4 /* unsigned long xmon_mfspr(sprn, default_value) */
6 PPC_LL r5, .Lmfspr_table@got(r2)
9 /* void xmon_mtspr(sprn, new_value) */
11 PPC_LL r5, .Lmtspr_table@got(r2)
16 * r4 = default or new value
21 * To index into the table of mxsprs we need:
22 * i = (sprn & 0x3ff) * 8
24 * i = (sprn << 3) & (0x3ff << 3)
26 rlwinm r3, r3, 3, 0x3ff << 3
29 mr r3, r4 /* put default_value in r3 for mfspr */