fix to allow usb modules to compile
[linux-2.4.21-pre4.git] / arch / ppc / kernel / iSeries_asm.h
1 /*
2  * BK Id: SCCS/s.iSeries_asm.h 1.4 10/15/01 20:29:24 paulus
3  */
4 /*
5  * arch/ppc/kernel/iSeries_asm.h
6  *
7  * Definitions used by various bits of low-level assembly code on iSeries.
8  *
9  * Copyright (C) 2001 IBM Corp.
10  *
11  *  This program is free software; you can redistribute it and/or
12  *  modify it under the terms of the GNU General Public License
13  *  as published by the Free Software Foundation; either version
14  *  2 of the License, or (at your option) any later version.
15  */
16
17 #define CHECKLPQUEUE(ra,rb,rc)         \
18         mfspr   rb,SPRG1;       /* Get Paca address */\
19         lbz ra,PACALPPACA+LPPACAIPIINT(rb); /* Get IPI int flag */\
20         cmpi    0,ra,0;         /* IPI occurred in hypervisor ? */\
21         bne 99f;            /* If so, skip rest */\
22         lwz ra,PACALPQUEUE(rb); /* Get LpQueue address */\
23         cmpi    0,ra,0;         /* Does LpQueue exist? */\
24         beq 99f;            /* If not skip rest */\
25         lbz rb,LPQINUSEWORD(ra);    /* Test for LpQueue recursion */\
26         cmpi    0,rb,1;         /* If we are about to recurse */\
27         beq 99f;            /* If so, skip rest */\
28         lwz rb,LPQCUREVENTPTR(ra);  /* Get current LpEvent */\
29         lbz rb,LPEVENTFLAGS(rb);    /* Get Valid bit */\
30         lbz rc,LPQOVERFLOW(ra); /* Get LpQueue overflow */\
31         andi.   ra,rb,0x0080;       /* Isolate Valid bit */\
32         or. ra,ra,rc;       /* 0 == no pending events */\
33 99:
34
35 #define CHECKDECR(ra,rb)           \
36         mfspr   rb,SPRG1;       /* Get Paca address */\
37         lbz ra,PACALPPACA+LPPACADECRINT(rb); /* Get DECR int flag */\
38         cmpi    0,ra,0;         /* DECR occurred in hypervisor ? */\
39         beq 99f;            /* If not, skip rest */\
40         xor ra,ra,ra;           \
41         stb ra,PACALPPACA+LPPACADECRINT(rb); /* Clear DECR int flag */\
42 99:
43
44 #define CHECKANYINT(ra,rb,rc)                   \
45         mfspr   rb,SPRG1;               /* Get Paca address */\
46         ld      ra,PACALPPACA+LPPACAANYINT(rb); /* Get all interrupt flags */\
47                                         /* Note use of ld, protected by soft/hard disabled */\
48         cmpldi  0,ra,0;                 /* Any interrupt occurred while soft disabled? */\
49         bne     99f;                    /* If so, skip rest */\
50         lwz     ra,PACALPQUEUE(rb);     /* Get LpQueue address */\
51         cmpi    0,ra,0;                 /* Does LpQueue exist? */\
52         beq     99f;                    /* If not skip rest */\
53         lwz     rb,LPQINUSEWORD(ra);    /* Test for LpQueue recursion */\
54         cmpi    0,rb,1;                 /* If we are about to recurse */\
55         beq     99f;                    /* If so, skip rest */\
56         lwz     rb,LPQCUREVENTPTR(ra);  /* Get current LpEvent */\
57         lbz     rb,LPEVENTFLAGS(rb);    /* Get Valid bit */\
58         lbz     rc,LPQOVERFLOW(ra);     /* Get LpQueue overflow */\
59         andi.   ra,rb,0x0080;           /* Isolate Valid bit */\
60         or.     ra,ra,rc;               /* 0 == no pending events */\
61 99:
62