2005-04-17 02:20:36 +04:00
/ *
*
* Linux/ P A R I S C P r o j e c t ( h t t p : / / w w w . p a r i s c - l i n u x . o r g / )
*
* System c a l l e n t r y c o d e C o p y r i g h t ( c ) M a t t h e w W i l c o x 1 9 9 9 < w i l l y @bofh.ai>
* Licensed u n d e r t h e G N U G P L .
* thanks t o P h i l i p p R u m p f , M i k e S h a v e r a n d v a r i o u s o t h e r s
* sorry a b o u t t h e w a l l , p u f f i n . .
* /
# include < a s m / a s s e m b l y . h >
2005-09-09 22:57:26 +04:00
# include < a s m / a s m - o f f s e t s . h >
2005-04-17 02:20:36 +04:00
# include < a s m / u n i s t d . h >
# include < a s m / e r r n o . h >
2007-01-28 18:43:32 +03:00
# include < l i n u x / l i n k a g e . h >
2005-04-17 02:20:36 +04:00
2007-01-28 18:43:32 +03:00
.level LEVEL
2008-05-22 22:36:31 +04:00
.text
2005-04-17 02:20:36 +04:00
.import hpux_call_table
.import hpux_ s y s c a l l _ e x i t ,c o d e
2007-10-18 11:04:53 +04:00
.align PAGE_SIZE
2007-01-28 18:43:32 +03:00
ENTRY( h p u x _ g a t e w a y _ p a g e )
2005-04-17 02:20:36 +04:00
nop
2007-01-28 18:43:32 +03:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
# warning N E E D S W O R K f o r 6 4 - b i t
# endif
ldw - 6 4 ( % r30 ) , % r29 ;! 8th argument
ldw - 6 0 ( % r30 ) , % r19 ;! 7th argument
ldw - 5 6 ( % r30 ) , % r20 ;! 6th argument
ldw - 5 2 ( % r30 ) , % r21 ;! 5th argument
gate . + 8 , % r0 / * b e c o m e p r i v i l e g e d * /
mtsp % r0 ,% s r4 / * g e t k e r n e l s p a c e i n t o s r4 * /
mtsp % r0 ,% s r5 / * g e t k e r n e l s p a c e i n t o s r5 * /
mtsp % r0 ,% s r6 / * g e t k e r n e l s p a c e i n t o s r6 * /
mfsp % s r7 ,% r1 / * s a v e u s e r s r7 * /
mtsp % r1 ,% s r3 / * a n d s t o r e i t i n s r3 * /
mtctl % r30 ,% c r28
mfctl % c r30 ,% r1
xor % r1 ,% r30 ,% r30 / * y e o l d e x o r t r i c k * /
xor % r1 ,% r30 ,% r1
xor % r1 ,% r30 ,% r30
ldo T A S K _ S Z _ A L G N + F R A M E _ S I Z E ( % r30 ) ,% r30 / * s e t u p k e r n e l s t a c k * /
/ * N. B . : I t i s c r i t i c a l t h a t w e d o n ' t s e t s r7 t o 0 u n t i l r30
* contains a v a l i d k e r n e l s t a c k p o i n t e r . I t i s a l s o
* critical t h a t w e d o n ' t s t a r t u s i n g t h e k e r n e l s t a c k
* until a f t e r s r7 h a s b e e n s e t t o 0 .
* /
mtsp % r0 ,% s r7 / * g e t k e r n e l s p a c e i n t o s r7 * /
STREG % r1 ,T A S K _ P T _ G R 3 0 - T A S K _ S Z _ A L G N - F R A M E _ S I Z E ( % r30 ) / * s a v e u s p * /
ldo - T A S K _ S Z _ A L G N - F R A M E _ S I Z E ( % r30 ) ,% r1 / * g e t t a s k p t r i n % r1 * /
/ * Save s o m e r e g i s t e r s f o r s i g c o n t e x t a n d p o t e n t i a l t a s k
switch ( s e e e n t r y . S f o r t h e d e t a i l s o f w h i c h o n e s a r e
saved/ r e s t o r e d ) . T A S K _ P T _ P S W i s z e r o e d s o w e c a n s e e w h e t h e r
a p r o c e s s i s o n a s y s c a l l o r n o t . F o r a n i n t e r r u p t t h e r e a l
PSW v a l u e i s s t o r e d . T h i s i s n e e d e d f o r g d b a n d s y s _ p t r a c e . * /
STREG % r0 , T A S K _ P T _ P S W ( % r1 )
STREG % r2 , T A S K _ P T _ G R 2 ( % r1 ) / * p r e s e r v e r p * /
STREG % r19 , T A S K _ P T _ G R 1 9 ( % r1 ) / * 7 t h a r g u m e n t * /
STREG % r20 , T A S K _ P T _ G R 2 0 ( % r1 ) / * 6 t h a r g u m e n t * /
STREG % r21 , T A S K _ P T _ G R 2 1 ( % r1 ) / * 5 t h a r g u m e n t * /
STREG % r22 , T A S K _ P T _ G R 2 2 ( % r1 ) / * s y s c a l l # * /
STREG % r23 , T A S K _ P T _ G R 2 3 ( % r1 ) / * 4 t h a r g u m e n t * /
STREG % r24 , T A S K _ P T _ G R 2 4 ( % r1 ) / * 3 r d a r g u m e n t * /
STREG % r25 , T A S K _ P T _ G R 2 5 ( % r1 ) / * 2 n d a r g u m e n t * /
STREG % r26 , T A S K _ P T _ G R 2 6 ( % r1 ) / * 1 s t a r g u m e n t * /
STREG % r27 , T A S K _ P T _ G R 2 7 ( % r1 ) / * u s e r d p * /
STREG % r28 , T A S K _ P T _ G R 2 8 ( % r1 ) / * r e t u r n v a l u e 0 * /
STREG % r28 , T A S K _ P T _ O R I G _ R 2 8 ( % r1 ) / * r e t u r n v a l u e 0 ( s a v e d f o r s i g n a l s ) * /
STREG % r29 , T A S K _ P T _ G R 2 9 ( % r1 ) / * 8 t h a r g u m e n t * /
STREG % r31 , T A S K _ P T _ G R 3 1 ( % r1 ) / * p r e s e r v e s y s c a l l r e t u r n p t r * /
ldo T A S K _ P T _ F R 0 ( % r1 ) , % r27 / * s a v e f p r e g s f r o m t h e k e r n e l * /
save_ f p % r27 / * o r p o t e n t i a l t a s k s w i t c h * /
mfctl % c r11 , % r27 / * i . e . S A R * /
STREG % r27 , T A S K _ P T _ S A R ( % r1 )
loadgp
stw % r21 , - 5 2 ( % r30 ) ;! 5th argument
stw % r20 , - 5 6 ( % r30 ) ;! 6th argument
stw % r19 , - 6 0 ( % r30 ) ;! 7th argument
stw % r29 , - 6 4 ( % r30 ) ;! 8th argument
ldil L % h p u x _ c a l l _ t a b l e , % r21
ldo R % h p u x _ c a l l _ t a b l e ( % r21 ) , % r21
comiclr,> > = _ _ N R _ H P U X _ s y s c a l l s , % r22 , % r0
b,n s y s c a l l _ n o s y s
2007-01-28 18:43:32 +03:00
LDREGX % r22 ( % r21 ) , % r21
2005-04-17 02:20:36 +04:00
ldil L % h p u x _ s y s c a l l _ e x i t ,% r2
be 0 ( % s r7 ,% r21 )
ldo R % h p u x _ s y s c a l l _ e x i t ( % r2 ) ,% r2
syscall_nosys :
ldil L % h p u x _ s y s c a l l _ e x i t ,% r1
be R % h p u x _ s y s c a l l _ e x i t ( % s r7 ,% r1 )
ldo - E N O S Y S ( % r0 ) ,% r28
2007-01-28 18:43:32 +03:00
ENDPROC( h p u x _ g a t e w a y _ p a g e )
2005-04-17 02:20:36 +04:00
2007-10-18 11:04:53 +04:00
.align PAGE_SIZE
2007-01-28 18:43:32 +03:00
ENTRY( e n d _ h p u x _ g a t e w a y _ p a g e )