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>
18 #include <asm/ppc_asm.h>
22 /* unsigned long local_save_flags(void) */
23 _GLOBAL(local_get_flags)
24 lbz r3,PACAPROCENABLED(r13)
27 /* unsigned long local_irq_disable(void) */
28 _GLOBAL(local_irq_disable)
29 lbz r3,PACAPROCENABLED(r13)
31 stb r4,PACAPROCENABLED(r13)
34 /* void local_irq_restore(unsigned long flags) */
35 _GLOBAL(local_irq_restore)
36 lbz r5,PACAPROCENABLED(r13)
37 /* Check if things are setup the way we want _already_. */
40 /* are we enabling interrupts? */
42 stb r3,PACAPROCENABLED(r13)
44 /* Check pending interrupts */
45 /* A decrementer, IPI or PMC interrupt may have occurred
46 * while we were in the hypervisor (which enables) */
47 ld r4,PACALPPACAPTR(r13)
48 ld r4,LPPACAANYINT(r4)
53 * Handle pending interrupts in interrupt context