2008-10-17 06:17:58 +04:00
/ *
* Support r o u t i n e s f o r X e n
*
* 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>
* /
# include < a s m / p r o c e s s o r . h >
# include < a s m / a s m m a c r o . h >
# include < a s m / p g t a b l e . h >
# include < a s m / p a r a v i r t . h >
# include < a s m / x e n / p r i v o p . h >
# include < l i n u x / e l f n o t e . h >
# include < l i n u x / i n i t . h >
# include < x e n / i n t e r f a c e / e l f n o t e . h >
2010-02-20 03:03:44 +03:00
.section .data . .read_mostly
2008-10-17 06:17:58 +04:00
.align 8
.global xen_domain_type
xen_domain_type :
data4 X E N _ N A T I V E _ A S M
.previous
_ _ INIT
ENTRY( s t a r t u p _ x e n )
/ / Calculate l o a d o f f s e t .
/ / The c o n s t a n t , L O A D _ O F F S E T , c a n ' t b e u s e d b e c a u s e t h e b o o t
/ / loader d o e s n ' t a l w a y s l o a d t o t h e L M A s p e c i f i e d b y t h e v m l i n u x . l d s .
mov r9 =ip / / m u s t b e t h e f i r s t i n s t r u c t i o n t o m a k e s u r e
/ / that r9 = t h e p h y s i c a l a d d r e s s o f s t a r t u p _ x e n .
/ / Usually r9 = s t a r t u p _ x e n - L O A D _ O F F S E T
movl r8 =startup_xen
;;
sub r9 =r9 ,r8 / / U s u a l l y r9 = - L O A D _ O F F S E T .
mov r10 =PARAVIRT_HYPERVISOR_TYPE_XEN
movl r11 =_start
;;
add r11 =r11 ,r9
movl r8 =hypervisor_type
;;
add r8 =r8 ,r9
mov b0 =r11
;;
st8 [ r8 ] =r10
br. c o n d . s p t k . m a n y b0
;;
END( s t a r t u p _ x e n )
ELFNOTE( X e n , X E N _ E L F N O T E _ G U E S T _ O S , . a s c i z " l i n u x " )
ELFNOTE( X e n , X E N _ E L F N O T E _ G U E S T _ V E R S I O N , . a s c i z " 2 . 6 " )
ELFNOTE( X e n , X E N _ E L F N O T E _ X E N _ V E R S I O N , . a s c i z " x e n - 3 . 0 " )
ELFNOTE( X e n , X E N _ E L F N O T E _ E N T R Y , d a t a8 . u a s t a r t u p _ x e n - L O A D _ O F F S E T )
# define i s B P p3 / / a r e w e t h e B o o t s t r a p P r o c e s s o r ?
GLOBAL_ E N T R Y ( x e n _ s e t u p _ h o o k )
mov r8 =XEN_PV_DOMAIN_ASM
( isBP) m o v l r9 =xen_domain_type ;;
( isBP) s t 4 [ r9 ] =r8
movl r10 =xen_ivt ;;
mov c r . i v a =r10
/* Set xsi base. */
# define F W _ H Y P E R C A L L _ S E T _ S H A R E D _ I N F O _ V A 0 x60 0
( isBP) m o v r2 =FW_HYPERCALL_SET_SHARED_INFO_VA
( isBP) m o v l r28 =XSI_BASE ;;
( isBP) b r e a k 0 x10 0 0 ;;
/* setup pv_ops */
( isBP) m o v r4 =rp
;;
( isBP) b r . c a l l . s p t k . m a n y r p =xen_setup_pv_ops
;;
( isBP) m o v r p =r4
;;
br. r e t . s p t k . m a n y r p
;;
END( x e n _ s e t u p _ h o o k )