2 * This file contains miscellaneous low-level functions.
3 * Copyright (C) 1995-2005 IBM Corp
5 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
7 * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
8 * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
16 #include <asm/processor.h>
17 #include <asm/asm-offsets.h>
21 /* unsigned long local_save_flags(void) */
22 _GLOBAL(local_get_flags)
23 lbz r3,PACAPROCENABLED(r13)
26 /* unsigned long local_irq_disable(void) */
27 _GLOBAL(local_irq_disable)
28 lbz r3,PACAPROCENABLED(r13)
30 stb r4,PACAPROCENABLED(r13)
33 /* void local_irq_restore(unsigned long flags) */
34 _GLOBAL(local_irq_restore)
35 lbz r5,PACAPROCENABLED(r13)
36 /* Check if things are setup the way we want _already_. */
39 /* are we enabling interrupts? */
41 stb r3,PACAPROCENABLED(r13)
43 /* Check pending interrupts */
44 /* A decrementer, IPI or PMC interrupt may have occurred
45 * while we were in the hypervisor (which enables) */
46 ld r4,PACALPPACA+LPPACAANYINT(r13)
51 * Handle pending interrupts in interrupt context