2008-10-17 11:17:52 +09:00
/ *
* Support r o u t i n e s f o r X e n h y p e r c a l l s
*
* Copyright ( C ) 2 0 0 5 D a n M a g e n h e i m e r < d a n . m a g e n h e i m e r @hp.com>
* Copyright ( C ) 2 0 0 8 Y a o z u ( E d d i e ) D o n g < e d d i e . d o n g @intel.com>
* /
# include < a s m / a s m m a c r o . h >
# include < a s m / i n t r i n s i c s . h >
# include < a s m / x e n / p r i v o p . h >
2009-03-04 21:06:55 +09:00
# ifdef _ _ I N T E L _ C O M P I L E R
2008-10-17 11:17:52 +09:00
/ *
* Hypercalls w i t h o u t p a r a m e t e r .
* /
# define _ _ H C A L L 0 ( n a m e ,h c a l l ) \
GLOBAL_ E N T R Y ( n a m e ) ; \
break h c a l l ; \
br. r e t . s p t k . m a n y r p ; \
END( n a m e )
/ *
* Hypercalls w i t h 1 p a r a m e t e r .
* /
# define _ _ H C A L L 1 ( n a m e ,h c a l l ) \
GLOBAL_ E N T R Y ( n a m e ) ; \
mov r8 =r32 ; \
break h c a l l ; \
br. r e t . s p t k . m a n y r p ; \
END( n a m e )
/ *
* Hypercalls w i t h 2 p a r a m e t e r s .
* /
# define _ _ H C A L L 2 ( n a m e ,h c a l l ) \
GLOBAL_ E N T R Y ( n a m e ) ; \
mov r8 =r32 ; \
mov r9 =r33 ; \
break h c a l l ; \
br. r e t . s p t k . m a n y r p ; \
END( n a m e )
_ _ HCALL0 ( x e n _ g e t _ p s r , H Y P E R P R I V O P _ G E T _ P S R )
_ _ HCALL0 ( x e n _ g e t _ i v r , H Y P E R P R I V O P _ G E T _ I V R )
_ _ HCALL0 ( x e n _ g e t _ t p r , H Y P E R P R I V O P _ G E T _ T P R )
_ _ HCALL0 ( x e n _ h y p e r _ s s m _ i , H Y P E R P R I V O P _ S S M _ I )
_ _ HCALL1 ( x e n _ s e t _ t p r , H Y P E R P R I V O P _ S E T _ T P R )
_ _ HCALL1 ( x e n _ e o i , H Y P E R P R I V O P _ E O I )
_ _ HCALL1 ( x e n _ t h a s h , H Y P E R P R I V O P _ T H A S H )
_ _ HCALL1 ( x e n _ s e t _ i t m , H Y P E R P R I V O P _ S E T _ I T M )
_ _ HCALL1 ( x e n _ g e t _ r r , H Y P E R P R I V O P _ G E T _ R R )
_ _ HCALL1 ( x e n _ f c , H Y P E R P R I V O P _ F C )
_ _ HCALL1 ( x e n _ g e t _ c p u i d , H Y P E R P R I V O P _ G E T _ C P U I D )
_ _ HCALL1 ( x e n _ g e t _ p m d , H Y P E R P R I V O P _ G E T _ P M D )
_ _ HCALL2 ( x e n _ p t c g a , H Y P E R P R I V O P _ P T C _ G A )
_ _ HCALL2 ( x e n _ s e t _ r r , H Y P E R P R I V O P _ S E T _ R R )
_ _ HCALL2 ( x e n _ s e t _ k r , H Y P E R P R I V O P _ S E T _ K R )
GLOBAL_ E N T R Y ( x e n _ s e t _ r r0 _ t o _ r r4 )
mov r8 =r32
mov r9 =r33
mov r10 =r34
mov r11 =r35
mov r14 =r36
XEN_ H Y P E R _ S E T _ R R 0 _ T O _ R R 4
br. r e t . s p t k . m a n y r p
;;
END( x e n _ s e t _ r r0 _ t o _ r r4 )
2009-03-04 21:06:55 +09:00
# endif
2008-10-17 11:17:52 +09:00
GLOBAL_ E N T R Y ( x e n _ s e n d _ i p i )
mov r14 =r32
mov r15 =r33
mov r2 =0x400
break 0 x10 0 0
;;
br. r e t . s p t k . m a n y r p
;;
END( x e n _ s e n d _ i p i )
GLOBAL_ E N T R Y ( _ _ h y p e r c a l l )
mov r2 =r37
break 0 x10 0 0
br. r e t . s p t k . m a n y b0
;;
END( _ _ h y p e r c a l l )