2012-12-10 16:40:18 +00:00
/ *
* Copyright ( C ) 2 0 1 2 ,2 0 1 3 - A R M L t d
* Author : Marc Z y n g i e r < m a r c . z y n g i e r @arm.com>
*
* 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 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 a s
* published 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 t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY o r F I T N E S S 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
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e 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
* along w i t h t h i s p r o g r a m . I f n o t , s e e < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > .
* /
# include < l i n u x / l i n k a g e . h >
2015-01-29 13:52:12 +00:00
# include < a s m / a l t e r n a t i v e . h >
2014-11-24 13:59:30 +00:00
# include < a s m / a s s e m b l e r . h >
2015-01-29 13:52:12 +00:00
# include < a s m / c p u f e a t u r e . h >
2012-12-10 16:40:18 +00:00
2014-02-26 18:47:36 +00:00
/ *
2016-02-16 13:52:39 +01:00
* u6 4 _ _ k v m _ c a l l _ h y p ( v o i d * h y p f n , . . . ) ;
2014-02-26 18:47:36 +00:00
*
* This i s n o t r e a l l y a v a r i a d i c f u n c t i o n i n t h e c l a s s i c C - w a y a n d c a r e m u s t
* be t a k e n w h e n c a l l i n g t h i s t o e n s u r e p a r a m e t e r s a r e p a s s e d i n r e g i s t e r s
* only, s i n c e t h e s t a c k w i l l c h a n g e b e t w e e n t h e c a l l e r a n d t h e c a l l e e .
*
* Call t h e f u n c t i o n w i t h t h e f i r s t a r g u m e n t c o n t a i n i n g a p o i n t e r t o t h e
* function y o u w i s h t o c a l l i n H y p m o d e , a n d s u b s e q u e n t a r g u m e n t s w i l l b e
* passed a s x0 , x1 , a n d x2 ( a m a x i m u m o f 3 a r g u m e n t s i n a d d i t i o n t o t h e
* function p o i n t e r c a n b e p a s s e d ) . T h e f u n c t i o n b e i n g c a l l e d m u s t b e m a p p e d
* in H y p m o d e ( s e e i n i t _ h y p _ m o d e i n a r c h / a r m / k v m / a r m . c ) . R e t u r n v a l u e s a r e
2015-10-25 15:51:41 +00:00
* passed i n x0 .
2014-02-26 18:47:36 +00:00
*
* A f u n c t i o n p o i n t e r w i t h a v a l u e o f 0 h a s a s p e c i a l m e a n i n g , a n d i s
* used t o i m p l e m e n t _ _ h y p _ g e t _ v e c t o r s i n t h e s a m e w a y a s i n
* arch/ a r m 6 4 / k e r n e l / h y p _ s t u b . S .
* /
2016-02-16 13:52:39 +01:00
ENTRY( _ _ k v m _ c a l l _ h y p )
2015-01-29 13:52:12 +00:00
alternative_ i f _ n o t A R M 6 4 _ H A S _ V I R T _ H O S T _ E X T N
2012-12-10 16:40:18 +00:00
hvc #0
ret
2015-01-29 13:52:12 +00:00
alternative_ e l s e
b _ _ v h e _ h y p _ c a l l
nop
alternative_ e n d i f
2016-02-16 13:52:39 +01:00
ENDPROC( _ _ k v m _ c a l l _ h y p )