xref: /kvm-unit-tests/lib/powerpc/handlers.c (revision ba33a96fdc5274e047d96919ae09ee3c97d4fd4e)
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  */
dec_handler_oneshot(struct pt_regs * regs,void * data)18 void dec_handler_oneshot(struct pt_regs *regs, void *data)
19 {
20 	regs->msr &= ~(1UL << MSR_EE_BIT);
21 }
22