2008-05-28 02:08:01 +04:00
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* linux/ a r c h / i a64 / x e n / p a r a v i r t e n t r y . S
*
* Copyright ( c ) 2 0 0 8 I s a k u Y a m a h a t a < y a m a h a t a a t v a l i n u x c o j p >
* VA L i n u x S y s t e m s J a p a n K . K .
*
* 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 a s p u b l i s h e d b y
* the 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 the License, or
* ( at 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 .
*
* 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 ; if not, write to the Free Software
* Foundation, I n c . , 5 9 T e m p l e P l a c e , S u i t e 3 3 0 , B o s t o n , M A 0 2 1 1 1 - 1 3 0 7 U S A
*
* /
2009-03-04 15:06:52 +03:00
# include < l i n u x / i n i t . h >
2008-05-28 02:08:01 +04:00
# include < a s m / a s m m a c r o . h >
# include < a s m / a s m - o f f s e t s . h >
2009-03-04 15:06:52 +03:00
# include < a s m / p a r a v i r t _ p r i v o p . h >
# include < a s m / p a r a v i r t _ p a t c h . h >
2008-05-28 02:08:01 +04:00
# include " e n t r y . h "
# define D A T A 8 ( s y m , i n i t _ v a l u e ) \
2010-02-20 03:03:44 +03:00
.pushsection .data . .read_mostly ; \
2008-05-28 02:08:01 +04:00
.align 8 ; \
.global sym ; \
sym : ; \
data8 i n i t _ v a l u e ; \
.popsection
2009-03-04 15:06:52 +03:00
# define B R A N C H ( t a r g , r e g , b r e g , t y p e ) \
PARAVIRT_ P A T C H _ S I T E _ B R ( P A R A V I R T _ P A T C H _ T Y P E _ B R _ ## t y p e ) ; \
;; \
movl r e g =targ ; \
;; \
ld8 r e g = [ r e g ] ; \
;; \
mov b r e g =reg ; \
2008-05-28 02:08:01 +04:00
br. c o n d . s p t k . m a n y b r e g
2009-03-04 15:06:52 +03:00
# define B R A N C H _ P R O C ( s y m , r e g , b r e g , t y p e ) \
DATA8 ( p a r a v i r t _ ## s y m # # _ t a r g , i a 64 _ n a t i v e _ ## s y m ) ; \
GLOBAL_ E N T R Y ( p a r a v i r t _ ## s y m ) ; \
BRANCH( p a r a v i r t _ ## s y m # # _ t a r g , r e g , b r e g , t y p e ) ; \
2008-05-28 02:08:01 +04:00
END( p a r a v i r t _ ## s y m )
2009-03-04 15:06:52 +03:00
# define B R A N C H _ P R O C _ U N W I N F O ( s y m , r e g , b r e g , t y p e ) \
DATA8 ( p a r a v i r t _ ## s y m # # _ t a r g , i a 64 _ n a t i v e _ ## s y m ) ; \
GLOBAL_ E N T R Y ( p a r a v i r t _ ## s y m ) ; \
PT_ R E G S _ U N W I N D _ I N F O ( 0 ) ; \
BRANCH( p a r a v i r t _ ## s y m # # _ t a r g , r e g , b r e g , t y p e ) ; \
2008-05-28 02:08:01 +04:00
END( p a r a v i r t _ ## s y m )
2009-03-04 15:06:52 +03:00
BRANCH_ P R O C ( s w i t c h _ t o , r22 , b7 , S W I T C H _ T O )
BRANCH_ P R O C _ U N W I N F O ( l e a v e _ s y s c a l l , r22 , b7 , L E A V E _ S Y S C A L L )
BRANCH_ P R O C ( w o r k _ p r o c e s s e d _ s y s c a l l , r2 , b7 , W O R K _ P R O C E S S E D _ S Y S C A L L )
BRANCH_ P R O C _ U N W I N F O ( l e a v e _ k e r n e l , r22 , b7 , L E A V E _ K E R N E L )
2009-03-04 15:06:51 +03:00
# ifdef C O N F I G _ M O D U L E S
# define _ _ I N I T _ O R _ M O D U L E . t e x t
# define _ _ I N I T D A T A _ O R _ M O D U L E . d a t a
# else
# define _ _ I N I T _ O R _ M O D U L E _ _ I N I T
# define _ _ I N I T D A T A _ O R _ M O D U L E _ _ I N I T D A T A
# endif / * C O N F I G _ M O D U L E S * /
_ _ INIT_ O R _ M O D U L E
GLOBAL_ E N T R Y ( p a r a v i r t _ f c _ i )
fc. i r32
br. r e t . s p t k . m a n y r p
END( p a r a v i r t _ f c _ i )
_ _ FINIT
_ _ INIT_ O R _ M O D U L E
.align 32
GLOBAL_ E N T R Y ( p a r a v i r t _ n o p _ b _ i n s t _ b u n d l e )
{
nop. b 0
nop. b 0
nop. b 0
}
END( p a r a v i r t _ n o p _ b _ i n s t _ b u n d l e )
_ _ FINIT
/* NOTE: nop.[mfi] has same format */
_ _ INIT_ O R _ M O D U L E
GLOBAL_ E N T R Y ( p a r a v i r t _ n o p _ m f i _ i n s t _ b u n d l e )
{
nop. m 0
nop. f 0
nop. i 0
}
END( p a r a v i r t _ n o p _ m f i _ i n s t _ b u n d l e )
_ _ FINIT
_ _ INIT_ O R _ M O D U L E
GLOBAL_ E N T R Y ( p a r a v i r t _ n o p _ b u n d l e )
paravirt_nop_bundle_start :
{
nop 0
nop 0
nop 0
}
paravirt_nop_bundle_end :
END( p a r a v i r t _ n o p _ b u n d l e )
_ _ FINIT
_ _ INITDATA_ O R _ M O D U L E
.align 8
.global paravirt_nop_bundle_size
paravirt_nop_bundle_size :
data8 p a r a v i r t _ n o p _ b u n d l e _ e n d - p a r a v i r t _ n o p _ b u n d l e _ s t a r t