2012-03-15 14:52:13 +04:00
/ *
* Copyright ( C ) 2 0 1 2 F r e e s c a l e S e m i c o n d u c t o r , I n c .
*
* 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 i t u n d e r t h e t e r m 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
* as 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 ; either version
* 2 of t h e L i c e n s e , o r ( a t y o u r o p t i o n ) a n y l a t e r v e r s i o n .
* /
# include < l i n u x / t h r e a d s . h >
2012-07-03 09:48:53 +04:00
# include < a s m / e p a p r _ h c a l l s . h >
2012-03-15 14:52:13 +04:00
# include < a s m / r e g . h >
# include < a s m / p a g e . h >
# include < a s m / c p u t a b l e . h >
# include < a s m / t h r e a d _ i n f o . h >
# include < a s m / p p c _ a s m . h >
2012-07-03 09:48:53 +04:00
# include < a s m / a s m - c o m p a t . h >
2012-03-15 14:52:13 +04:00
# include < a s m / a s m - o f f s e t s . h >
2016-01-14 07:33:46 +03:00
# include < a s m / e x p o r t . h >
2012-03-15 14:52:13 +04:00
2013-02-08 23:22:56 +04:00
# ifndef C O N F I G _ P P C 6 4
2012-07-03 09:48:53 +04:00
/* epapr_ev_idle() was derived from e500_idle() */
_ GLOBAL( e p a p r _ e v _ i d l e )
CURRENT_ T H R E A D _ I N F O ( r3 , r1 )
PPC_ L L r4 , T I _ L O C A L _ F L A G S ( r3 ) / * s e t n a p p i n g b i t * /
ori r4 , r4 ,_ T L F _ N A P P I N G / * s o w h e n w e t a k e a n e x c e p t i o n * /
PPC_ S T L r4 , T I _ L O C A L _ F L A G S ( r3 ) / * i t w i l l r e t u r n t o o u r c a l l e r * /
wrteei 1
idle_loop :
LOAD_ R E G _ I M M E D I A T E ( r11 , E V _ H C A L L _ T O K E N ( E V _ I D L E ) )
.global epapr_ev_idle_start
epapr_ev_idle_start :
li r3 , - 1
nop
nop
nop
/ *
* Guard a g a i n s t s p u r i o u s w a k e u p s f r o m a h y p e r v i s o r - -
* only i n t e r r u p t w i l l c a u s e u s t o r e t u r n t o L R d u e t o
* _ TLF_ N A P P I N G .
* /
b i d l e _ l o o p
2013-02-08 23:22:56 +04:00
# endif
2012-07-03 09:48:53 +04:00
2012-03-15 14:52:13 +04:00
/* Hypercall entry point. Will be patched with device tree instructions. */
.global epapr_hypercall_start
epapr_hypercall_start :
li r3 , - 1
nop
nop
nop
blr
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( e p a p r _ h y p e r c a l l _ s t a r t )