2005-04-16 15:20:36 -07:00
# include < l i n u x / c o n f i g . h > / * f o r C O N F I G _ A R C H _ x x x x * /
# include < l i n u x / l i n k a g e . h >
# include < a s m / a s s e m b l e r . h >
# include < a s m / c o n s t a n t s . h >
# include < a s m / e r r n o . h >
# include < a s m / h a r d w a r e . h >
# include < a s m / a r c h / i r q s . h >
# include < a s m / a r c h / e n t r y - m a c r o . S >
.macro zero_fp
# ifdef C O N F I G _ F R A M E _ P O I N T E R
mov f p , #0
# endif
.endm
.text
@ Bad Abort numbers
@ -----------------
@
# define B A D _ P R E F E T C H 0
# define B A D _ D A T A 1
# define B A D _ A D D R E X C P T N 2
# define B A D _ I R Q 3
# define B A D _ U N D E F I N S T R 4
@
2005-04-26 15:18:59 +01:00
@ Most of the stack format comes from struct pt_regs, but with
@ the addition of 8 bytes for storing syscall args 5 and 6.
2005-04-16 15:20:36 -07:00
@
# define S _ O F F 8
2005-04-26 15:18:59 +01:00
/ *
* The S W I c o d e r e l i e s o n t h e f a c t t h a t R 0 i s a t t h e b o t t o m o f t h e s t a c k
* ( due t o s l o w / f a s t r e s t o r e u s e r r e g s ) .
* /
# if S _ R 0 ! = 0
# error " P l e a s e f i x "
# endif
2005-04-16 15:20:36 -07:00
# if _ _ L I N U X _ A R M _ A R C H _ _ > = 6
2005-04-26 15:18:26 +01:00
.macro disable_irq
2005-04-16 15:20:36 -07:00
cpsid i
.endm
2005-04-26 15:18:26 +01:00
.macro enable_irq
2005-04-16 15:20:36 -07:00
cpsie i
.endm
# else
2005-04-26 15:18:26 +01:00
.macro disable_irq
msr c p s r _ c , #P S R _ I _ B I T | S V C _ M O D E
2005-04-16 15:20:36 -07:00
.endm
2005-04-26 15:18:26 +01:00
.macro enable_irq
msr c p s r _ c , #S V C _ M O D E
2005-04-16 15:20:36 -07:00
.endm
# endif
.macro get_ t h r e a d _ i n f o , r d
mov \ r d , s p , l s r #13
mov \ r d , \ r d , l s l #13
.endm
.macro alignment_ t r a p , r b a s e , r t e m p , s y m
# ifdef C O N F I G _ A L I G N M E N T _ T R A P
# define O F F _ C R _ A L I G N M E N T ( x ) c r _ a l i g n m e n t - x
ldr \ r t e m p , [ \ r b a s e , #O F F _ C R _ A L I G N M E N T ( \ s y m ) ]
mcr p15 , 0 , \ r t e m p , c1 , c0
# endif
.endm
/ *
* These a r e t h e r e g i s t e r s u s e d i n t h e s y s c a l l h a n d l e r , a n d a l l o w u s t o
* have i n t h e o r y u p t o 7 a r g u m e n t s t o a f u n c t i o n - r0 t o r6 .
*
* r7 i s r e s e r v e d f o r t h e s y s t e m c a l l n u m b e r f o r t h u m b m o d e .
*
* Note t h a t t b l = = w h y i s i n t e n t i o n a l .
*
* We m u s t s e t a t l e a s t " t s k " a n d " w h y " w h e n c a l l i n g r e t _ w i t h _ r e s c h e d u l e .
* /
scno . r e q r7 @ syscall number
tbl . r e q r8 @ syscall table pointer
why . r e q r8 @ Linux syscall (!= 0)
tsk . r e q r9 @ current thread_info