2012-03-05 15:49:32 +04:00
/ *
* Compat s y s t e m c a l l w r a p p e r s
*
* Copyright ( C ) 2 0 1 2 A R M L t d .
* Authors : Will D e a c o n < w i l l . d e a c o n @arm.com>
* Catalin M a r i n a s < c a t a l i n . m a r i n a s @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-03-16 19:32:22 +03:00
# include < l i n u x / c o n s t . h >
2012-03-05 15:49:32 +04:00
# include < a s m / a s s e m b l e r . h >
# include < a s m / a s m - o f f s e t s . h >
2015-03-16 19:32:22 +03:00
# include < a s m / e r r n o . h >
# include < a s m / p a g e . h >
2012-03-05 15:49:32 +04:00
/ *
* System c a l l w r a p p e r s f o r t h e A A r c h32 c o m p a t i b i l i t y l a y e r .
* /
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ s i g r e t u r n _ w r a p p e r )
2012-03-05 15:49:32 +04:00
mov x0 , s p
b c o m p a t _ s y s _ s i g r e t u r n
ENDPROC( c o m p a t _ s y s _ s i g r e t u r n _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ r t _ s i g r e t u r n _ w r a p p e r )
2012-03-05 15:49:32 +04:00
mov x0 , s p
b c o m p a t _ s y s _ r t _ s i g r e t u r n
ENDPROC( c o m p a t _ s y s _ r t _ s i g r e t u r n _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ s t a t f s64 _ w r a p p e r )
2012-03-05 15:49:32 +04:00
mov w3 , #84
cmp w1 , #88
csel w1 , w3 , w1 , e q
b c o m p a t _ s y s _ s t a t f s64
ENDPROC( c o m p a t _ s y s _ s t a t f s64 _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ f s t a t f s64 _ w r a p p e r )
2012-03-05 15:49:32 +04:00
mov w3 , #84
cmp w1 , #88
csel w1 , w3 , w1 , e q
b c o m p a t _ s y s _ f s t a t f s64
ENDPROC( c o m p a t _ s y s _ f s t a t f s64 _ w r a p p e r )
2015-03-16 19:32:22 +03:00
/ *
* Note : off_ 4 k ( w5 ) i s a l w a y s i n u n i t s o f 4 K . I f w e c a n ' t d o t h e
* requested o f f s e t b e c a u s e i t i s n o t p a g e - a l i g n e d , w e r e t u r n - E I N V A L .
* /
ENTRY( c o m p a t _ s y s _ m m a p2 _ w r a p p e r )
# if P A G E _ S H I F T > 1 2
tst w5 , #~ P A G E _ M A S K > > 12
b. n e 1 f
lsr w5 , w5 , #P A G E _ S H I F T - 12
# endif
b s y s _ m m a p _ p g o f f
1 : mov x0 , #- E I N V A L
ret
ENDPROC( c o m p a t _ s y s _ m m a p2 _ w r a p p e r )
2012-03-05 15:49:32 +04:00
/ *
* Wrappers f o r A A r c h32 s y s c a l l s t h a t e i t h e r t a k e 6 4 - b i t p a r a m e t e r s
* in r e g i s t e r s o r t h a t t a k e 3 2 - b i t p a r a m e t e r s w h i c h r e q u i r e s i g n
* extension.
* /
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ p r e a d64 _ w r a p p e r )
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x3 , x4 , x5
2012-03-05 15:49:32 +04:00
b s y s _ p r e a d64
ENDPROC( c o m p a t _ s y s _ p r e a d64 _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ p w r i t e 6 4 _ w r a p p e r )
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x3 , x4 , x5
2012-03-05 15:49:32 +04:00
b s y s _ p w r i t e 6 4
ENDPROC( c o m p a t _ s y s _ p w r i t e 6 4 _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ t r u n c a t e 6 4 _ w r a p p e r )
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x1 , x2 , x3
2012-03-05 15:49:32 +04:00
b s y s _ t r u n c a t e
ENDPROC( c o m p a t _ s y s _ t r u n c a t e 6 4 _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ f t r u n c a t e 6 4 _ w r a p p e r )
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x1 , x2 , x3
2012-03-05 15:49:32 +04:00
b s y s _ f t r u n c a t e
ENDPROC( c o m p a t _ s y s _ f t r u n c a t e 6 4 _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ r e a d a h e a d _ w r a p p e r )
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x1 , x2 , x3
2012-03-05 15:49:32 +04:00
mov w2 , w4
b s y s _ r e a d a h e a d
ENDPROC( c o m p a t _ s y s _ r e a d a h e a d _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ f a d v i s e 6 4 _ 6 4 _ w r a p p e r )
2012-03-05 15:49:32 +04:00
mov w6 , w1
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x1 , x2 , x3
regs_ t o _ 6 4 x2 , x4 , x5
2012-03-05 15:49:32 +04:00
mov w3 , w6
b s y s _ f a d v i s e 6 4 _ 6 4
ENDPROC( c o m p a t _ s y s _ f a d v i s e 6 4 _ 6 4 _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ s y n c _ f i l e _ r a n g e 2 _ w r a p p e r )
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x2 , x2 , x3
regs_ t o _ 6 4 x3 , x4 , x5
2012-03-05 15:49:32 +04:00
b s y s _ s y n c _ f i l e _ r a n g e 2
ENDPROC( c o m p a t _ s y s _ s y n c _ f i l e _ r a n g e 2 _ w r a p p e r )
2015-01-06 19:42:32 +03:00
ENTRY( c o m p a t _ s y s _ f a l l o c a t e _ w r a p p e r )
2013-10-11 17:52:13 +04:00
regs_ t o _ 6 4 x2 , x2 , x3
regs_ t o _ 6 4 x3 , x4 , x5
2012-03-05 15:49:32 +04:00
b s y s _ f a l l o c a t e
ENDPROC( c o m p a t _ s y s _ f a l l o c a t e _ w r a p p e r )