1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <asm/ppc_asm.h>
3 #include <asm/asm-compat.h>
5 /* unsigned long xmon_mfspr(sprn, default_value) */
7 PPC_LL r5, .Lmfspr_table@got(r2)
10 /* void xmon_mtspr(sprn, new_value) */
12 PPC_LL r5, .Lmtspr_table@got(r2)
17 * r4 = default or new value
22 * To index into the table of mxsprs we need:
23 * i = (sprn & 0x3ff) * 8
25 * i = (sprn << 3) & (0x3ff << 3)
27 rlwinm r3, r3, 3, 0x3ff << 3
30 mr r3, r4 /* put default_value in r3 for mfspr */