2005-04-16 15:20:36 -07:00
/ *
* Access t o t h e s h a r e d d a t a p a g e b y t h e v D S O & s y s c a l l m a p
*
* Copyright ( C ) 2 0 0 4 B e n j a m i n H e r r e n s c h m u i d t ( b e n h @kernel.crashing.org), IBM Corp.
*
* 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
* 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 ; either version
* 2 of t h e L i c e n s e , o r ( a t 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 .
* /
# include < l i n u x / c o n f i g . h >
# include < a s m / p r o c e s s o r . h >
# include < a s m / p p c _ a s m . h >
2005-09-09 20:57:26 +02:00
# include < a s m / a s m - o f f s e t s . h >
2005-04-16 15:20:36 -07:00
# include < a s m / u n i s t d . h >
# include < a s m / v d s o . h >
.text
V_ F U N C T I O N _ B E G I N ( _ _ g e t _ d a t a p a g e )
.cfi_startproc
/ * We d o n ' t w a n t t h a t e x p o s e d o r o v e r r i d a b l e a s w e w a n t o t h e r o b j e c t s
* to b e a b l e t o b l d i r e c t l y t o h e r e
* /
.protected __get_datapage
.hidden __get_datapage
mflr r0
.cfi_register lr,r0
bcl 2 0 ,3 1 ,1 f
.global _ _ kernel_ d a t a p a g e _ o f f s e t ;
__kernel_datapage_offset :
.long 0
1 :
mflr r3
mtlr r0
lwz r0 ,0 ( r3 )
add r3 ,r0 ,r3
blr
.cfi_endproc
V_ F U N C T I O N _ E N D ( _ _ g e t _ d a t a p a g e )
/ *
* void * _ _ k e r n e l _ g e t _ s y s c a l l _ m a p ( u n s i g n e d i n t * s y s c a l l _ c o u n t ) ;
*
* returns a p o i n t e r t o t h e s y s c a l l m a p . t h e m a p i s a g n o s t i c t o t h e
* size o f " l o n g " , u n l i k e k e r n e l b i t o p s , i t s t o r e s b i t s f r o m t o p t o
* bottom s o t h a t m e m o r y a c t u a l l y c o n t a i n s a l i n e a r b i t m a p
* check f o r s y s c a l l N b y t e s t i n g b i t ( 0 x80 0 0 0 0 0 0 > > ( N & 0 x1 f ) ) o f
* 3 2 bits i n t a t N > > 5 .
* /
V_ F U N C T I O N _ B E G I N ( _ _ k e r n e l _ g e t _ s y s c a l l _ m a p )
.cfi_startproc
mflr r12
.cfi_register lr,r12
mr r4 ,r3
bl _ _ g e t _ d a t a p a g e @local
mtlr r12
addi r3 ,r3 ,C F G _ S Y S C A L L _ M A P 3 2
cmpli c r0 ,r4 ,0
beqlr
li r0 ,_ _ N R _ s y s c a l l s
stw r0 ,0 ( r4 )
blr
.cfi_endproc
V_ F U N C T I O N _ E N D ( _ _ k e r n e l _ g e t _ s y s c a l l _ m a p )
2005-11-11 21:15:21 +11:00
/ *
* void u n s i g n e d l o n g l o n g _ _ k e r n e l _ g e t _ t b f r e q ( v o i d ) ;
*
* returns t h e t i m e b a s e f r e q u e n c y i n H Z
* /
V_ F U N C T I O N _ B E G I N ( _ _ k e r n e l _ g e t _ t b f r e q )
.cfi_startproc
mflr r12
.cfi_register lr,r12
bl _ _ g e t _ d a t a p a g e @local
lwz r3 ,C F G _ T B _ T I C K S _ P E R _ S E C ( r3 )
lwz r4 ,( C F G _ T B _ T I C K S _ P E R _ S E C + 4 ) ( r3 )
mtlr r12
.cfi_endproc
V_ F U N C T I O N _ E N D ( _ _ k e r n e l _ g e t _ t b f r e q )