2013-06-03 21:05:43 +04:00
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* hypercall. S
*
* Xen h y p e r c a l l w r a p p e r s
*
* Stefano S t a b e l l i n i < s t e f a n o . s t a b e l l i n i @eu.citrix.com>, Citrix, 2012
*
* 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 v e r s i o n 2
* 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 ; or, when distributed
* separately f r o m t h e L i n u x k e r n e l o r i n c o r p o r a t e d i n t o o t h e r
* software p a c k a g e s , s u b j e c t t o t h e f o l l o w i n g l i c e n s e :
*
* Permission i s h e r e b y g r a n t e d , f r e e o f c h a r g e , t o a n y p e r s o n o b t a i n i n g a c o p y
* of t h i s s o u r c e f i l e ( t h e " S o f t w a r e " ) , t o d e a l i n t h e S o f t w a r e w i t h o u t
* restriction, i n c l u d i n g w i t h o u t l i m i t a t i o n t h e r i g h t s t o u s e , c o p y , m o d i f y ,
* merge, p u b l i s h , d i s t r i b u t e , s u b l i c e n s e , a n d / o r s e l l c o p i e s o f t h e S o f t w a r e ,
* and t o p e r m i t p e r s o n s t o w h o m t h e S o f t w a r e i s f u r n i s h e d t o d o s o , s u b j e c t t o
* the f o l l o w i n g c o n d i t i o n s :
*
* The a b o v e c o p y r i g h t n o t i c e a n d t h i s p e r m i s s i o n n o t i c e s h a l l b e i n c l u d e d i n
* all c o p i e s o r s u b s t a n t i a l p o r t i o n s o f t h e S o f t w a r e .
*
* THE S O F T W A R E I S P R O V I D E D " A S I S " , W I T H O U T W A R R A N T Y O F A N Y K I N D , E X P R E S S O R
* IMPLIED, I N C L U D I N G B U T N O T L I M I T E D T O T H E W A R R A N T I E S O F M E R C H A N T A B I L I T Y ,
* FITNESS F O R A P A R T I C U L A R P U R P O S E A N D N O N I N F R I N G E M E N T . I N N O E V E N T S H A L L T H E
* AUTHORS O R C O P Y R I G H T H O L D E R S B E L I A B L E F O R A N Y C L A I M , D A M A G E S O R O T H E R
* LIABILITY, W H E T H E R I N A N A C T I O N O F C O N T R A C T , T O R T O R O T H E R W I S E , A R I S I N G
* FROM, O U T O F O R I N C O N N E C T I O N W I T H T H E S O F T W A R E O R T H E U S E O R O T H E R D E A L I N G S
* IN T H E S O F T W A R E .
* /
/ *
* The X e n h y p e r c a l l c a l l i n g c o n v e n t i o n i s v e r y s i m i l a r t o t h e p r o c e d u r e
* call s t a n d a r d f o r t h e A R M 6 4 - b i t a r c h i t e c t u r e : t h e f i r s t p a r a m e t e r i s
* passed i n x0 , t h e s e c o n d i n x1 , t h e t h i r d i n x2 , t h e f o u r t h i n x3 a n d
* the f i f t h i n x4 .
*
* The h y p e r c a l l n u m b e r i s p a s s e d i n x16 .
*
* The r e t u r n v a l u e i s i n x0 .
*
* The h v c I S S i s r e q u i r e d t o b e 0 x E A 1 , t h a t i s t h e X e n s p e c i f i c A R M
* hypercall t a g .
*
* Parameter s t r u c t s p a s s e d t o h y p e r c a l l s a r e l a i d o u t a c c o r d i n g t o
* the A R M 6 4 - b i t E A B I s t a n d a r d .
* /
# 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 < x e n / i n t e r f a c e / x e n . h >
# define X E N _ I M M 0 x E A 1
# define H Y P E R C A L L _ S I M P L E ( h y p e r c a l l ) \
ENTRY( H Y P E R V I S O R _ ## h y p e r c a l l ) \
mov x16 , #_ _ H Y P E R V I S O R _ # # h y p e r c a l l ; \
hvc X E N _ I M M ; \
ret; \
ENDPROC( H Y P E R V I S O R _ ## h y p e r c a l l )
# define H Y P E R C A L L 0 H Y P E R C A L L _ S I M P L E
# define H Y P E R C A L L 1 H Y P E R C A L L _ S I M P L E
# define H Y P E R C A L L 2 H Y P E R C A L L _ S I M P L E
# define H Y P E R C A L L 3 H Y P E R C A L L _ S I M P L E
# define H Y P E R C A L L 4 H Y P E R C A L L _ S I M P L E
# define H Y P E R C A L L 5 H Y P E R C A L L _ S I M P L E
.text
HYPERCALL2 ( x e n _ v e r s i o n ) ;
HYPERCALL3 ( c o n s o l e _ i o ) ;
HYPERCALL3 ( g r a n t _ t a b l e _ o p ) ;
HYPERCALL2 ( s c h e d _ o p ) ;
HYPERCALL2 ( e v e n t _ c h a n n e l _ o p ) ;
HYPERCALL2 ( h v m _ o p ) ;
HYPERCALL2 ( m e m o r y _ o p ) ;
HYPERCALL2 ( p h y s d e v _ o p ) ;
HYPERCALL3 ( v c p u _ o p ) ;
2013-07-02 14:42:40 +04:00
HYPERCALL1 ( t m e m _ o p ) ;
2013-06-03 21:05:43 +04:00
ENTRY( p r i v c m d _ c a l l )
mov x16 , x0
mov x0 , x1
mov x1 , x2
mov x2 , x3
mov x3 , x4
mov x4 , x5
hvc X E N _ I M M
ret
ENDPROC( p r i v c m d _ c a l l ) ;