xref: /kvm-unit-tests/lib/powerpc/handlers.c (revision 386ed5c2f9e98a2605817748c44c0cefa60dc88e)
1 /*
2  * Generic exception handlers for registration and use in tests
3  *
4  * Copyright 2016 Suraj Jitindar Singh, IBM.
5  *
6  * This work is licensed under the terms of the GNU LGPL, version 2.
7  */
8 
9 #include <libcflat.h>
10 #include <asm/handlers.h>
11 #include <asm/ptrace.h>
12 #include <asm/ppc_asm.h>
13 
14 /*
15  * Generic handler for decrementer exceptions (0x900)
16  * Return with MSR[EE] disabled.
17  */
18 void dec_handler_oneshot(struct pt_regs *regs, void *data)
19 {
20 	regs->msr &= ~(1UL << MSR_EE_BIT);
21 }
22