2006-12-07 04:59:39 +03:00
/ *
* iop1 3 x x l o w l e v e l i r q m a c r o s
* Copyright ( c ) 2 0 0 5 - 2 0 0 6 , I n t e l C o r p o r a t i o n .
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify it
* under t h e t e r m s a n d c o n d i t i o n s o f t h e G N U G e n e r a l P u b l i c L i c e n s e ,
* version 2 , a s p u b l i s h e d b y t h e F r e e S o f t w a r e F o u n d a t i o n .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e i t w i l l b e u s e f u l , b u t W I T H O U T
* ANY W A R R A N T Y ; without even the implied warranty of MERCHANTABILITY or
* FITNESS F O R A P A R T I C U L A R P U R P O S E . S e e t h e G N U G e n e r a l P u b l i c L i c e n s e f o r
* more d e t a i l s .
*
* You s h o u l d h a v e r e c e i v e d a c o p y o f t h e G N U G e n e r a l P u b l i c L i c e n s e a l o n g w i t h
* this p r o g r a m ; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - S u i t e 3 3 0 , B o s t o n , M A 0 2 1 1 1 - 1 3 0 7 U S A .
*
* /
.macro disable_fiq
.endm
2007-02-17 00:16:32 +03:00
.macro get_ i r q n r _ p r e a m b l e , b a s e , t m p
mrc p15 , 0 , \ t m p , c15 , c1 , 0
orr \ t m p , \ t m p , #( 1 < < 6 )
mcr p15 , 0 , \ t m p , c15 , c1 , 0 @ Enable cp6 access
.endm
2006-12-07 04:59:39 +03:00
/ *
* Note : a 1 - c y c l e w i n d o w e x i s t s w h e r e i i n t v e c w i l l r e t u r n t h e v a l u e
* of i i n t b a s e , s o w e e x p l i c i t l y c h e c k f o r " b a d z e r o s "
* /
.macro get_ i r q n r _ a n d _ b a s e , i r q n r , i r q s t a t , b a s e , t m p
mrc p6 , 0 , \ i r q n r , c3 , c2 , 0 @ Read IINTVEC
cmp \ i r q n r , #0
mrceq p6 , 0 , \ i r q n r , c3 , c2 , 0 @ Re-read on potentially bad zero
adds \ i r q s t a t , \ i r q n r , #1 @ Check for 0xffffffff
movne \ i r q n r , \ i r q n r , l s r #2 @ Convert to irqnr
2007-02-17 00:16:32 +03:00
.endm
2006-12-07 04:59:39 +03:00
2007-02-17 00:16:32 +03:00
.macro arch_ r e t _ t o _ u s e r , t m p1 , t m p2
mrc p15 , 0 , \ t m p1 , c15 , c1 , 0
ands \ t m p2 , \ t m p1 , #( 1 < < 6 )
bicne \ t m p1 , \ t m p1 , #( 1 < < 6 )
mcrne p15 , 0 , \ t m p1 , c15 , c1 , 0 @ Disable cp6 access
2006-12-07 04:59:39 +03:00
.endm