2005-04-17 02:20:36 +04:00
/ *
* This f i l e i s s u b j e c t t o t h e t e r m s a n d c o n d i t i o n s o f t h e G N U G e n e r a l P u b l i c
* License. S e e t h e f i l e " C O P Y I N G " i n t h e m a i n d i r e c t o r y o f t h i s a r c h i v e
* for m o r e d e t a i l s .
*
2006-07-07 17:07:18 +04:00
* Copyright ( C ) 1 9 9 5 - 9 9 , 2 0 0 0 - 0 2 , 0 6 R a l f B a e c h l e < r a l f @linux-mips.org>
2005-04-17 02:20:36 +04:00
* Copyright ( C ) 2 0 0 1 M I P S T e c h n o l o g i e s , I n c .
* Copyright ( C ) 2 0 0 4 T h i e m o S e u f e r
* /
# include < l i n u x / e r r n o . h >
# include < a s m / a s m . h >
# include < a s m / a s m m a c r o . h >
2006-07-07 17:07:18 +04:00
# include < a s m / i r q f l a g s . h >
2005-04-17 02:20:36 +04:00
# include < a s m / m i p s r e g s . h >
# include < a s m / r e g d e f . h >
# include < a s m / s t a c k f r a m e . h >
# include < a s m / i s a d e p . h >
# include < a s m / s y s m i p s . h >
# include < a s m / t h r e a d _ i n f o . h >
# include < a s m / u n i s t d . h >
# include < a s m / w a r . h >
2005-09-10 00:32:31 +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
/* Highest syscall used of any syscall flavour */
# define M A X _ S Y S C A L L _ N O _ _ N R _ O 3 2 _ L i n u x + _ _ N R _ O 3 2 _ L i n u x _ s y s c a l l s
.align 5
NESTED( h a n d l e _ s y s , P T _ S I Z E , s p )
.set noat
SAVE_ S O M E
2006-09-26 18:43:40 +04:00
TRACE_ I R Q S _ O N _ R E L O A D
2005-04-17 02:20:36 +04:00
STI
.set at
lw t 1 , P T _ E P C ( s p ) # s k i p s y s c a l l o n r e t u r n
subu v0 , v0 , _ _ N R _ O 3 2 _ L i n u x # c h e c k s y s c a l l n u m b e r
sltiu t 0 , v0 , _ _ N R _ O 3 2 _ L i n u x _ s y s c a l l s + 1
addiu t 1 , 4 # s k i p t o n e x t i n s t r u c t i o n
sw t 1 , P T _ E P C ( s p )
beqz t 0 , i l l e g a l _ s y s c a l l
sll t 0 , v0 , 3
la t 1 , s y s _ c a l l _ t a b l e
addu t 1 , t 0
lw t 2 , ( t 1 ) # s y s c a l l r o u t i n e
lw t 3 , 4 ( t 1 ) # > = 0 i f w e n e e d s t a c k a r g u m e n t s
beqz t 2 , i l l e g a l _ s y s c a l l
sw a3 , P T _ R 2 6 ( s p ) # s a v e a 3 f o r s y s c a l l r e s t a r t i n g
bgez t 3 , s t a c k a r g s
stack_done :
lw t 0 , T I _ F L A G S ( $ 2 8 ) # s y s c a l l t r a c i n g e n a b l e d ?
li t 1 , _ T I F _ S Y S C A L L _ T R A C E | _ T I F _ S Y S C A L L _ A U D I T
and t 0 , t 1
bnez t 0 , s y s c a l l _ t r a c e _ e n t r y # - > y e s
jalr t 2 # D o T h e R e a l T h i n g ( T M )
li t 0 , - E M A X E R R N O - 1 # e r r o r ?
sltu t 0 , t 0 , v0
sw t 0 , P T _ R 7 ( s p ) # s e t e r r o r f l a g
beqz t 0 , 1 f
2010-09-28 21:50:37 +04:00
lw t 1 , P T _ R 2 ( s p ) # s y s c a l l n u m b e r
2005-04-17 02:20:36 +04:00
negu v0 # e r r o r
2010-09-28 21:50:37 +04:00
sw t 1 , P T _ R 0 ( s p ) # s a v e i t f o r s y s c a l l r e s t a r t i n g
2005-04-17 02:20:36 +04:00
1 : sw v0 , P T _ R 2 ( s p ) # r e s u l t
o32_syscall_exit :
local_ i r q _ d i s a b l e # m a k e s u r e n e e d _ r e s c h e d a n d
# signals d o n t c h a n g e b e t w e e n
# sampling a n d r e t u r n
lw a2 , T I _ F L A G S ( $ 2 8 ) # c u r r e n t - > w o r k
li t 0 , _ T I F _ A L L W O R K _ M A S K
and t 0 , a2
bnez t 0 , o 3 2 _ s y s c a l l _ e x i t _ w o r k
j r e s t o r e _ p a r t i a l
o32_syscall_exit_work :
j s y s c a l l _ e x i t _ w o r k _ p a r t i a l
/* ------------------------------------------------------------------------ */
syscall_trace_entry :
SAVE_ S T A T I C
move s0 , t 2
move a0 , s p
2011-05-19 12:21:29 +04:00
jal s y s c a l l _ t r a c e _ e n t e r
2005-04-17 02:20:36 +04:00
2005-11-30 19:24:57 +03:00
move t 0 , s0
RESTORE_ S T A T I C
2005-04-17 02:20:36 +04:00
lw a0 , P T _ R 4 ( s p ) # R e s t o r e a r g u m e n t r e g i s t e r s
lw a1 , P T _ R 5 ( s p )
lw a2 , P T _ R 6 ( s p )
lw a3 , P T _ R 7 ( s p )
2005-11-30 19:24:57 +03:00
jalr t 0
2005-04-17 02:20:36 +04:00
li t 0 , - E M A X E R R N O - 1 # e r r o r ?
sltu t 0 , t 0 , v0
sw t 0 , P T _ R 7 ( s p ) # s e t e r r o r f l a g
beqz t 0 , 1 f
2010-09-28 21:50:37 +04:00
lw t 1 , P T _ R 2 ( s p ) # s y s c a l l n u m b e r
2005-04-17 02:20:36 +04:00
negu v0 # e r r o r
2010-09-28 21:50:37 +04:00
sw t 1 , P T _ R 0 ( s p ) # s a v e i t f o r s y s c a l l r e s t a r t i n g
2005-04-17 02:20:36 +04:00
1 : sw v0 , P T _ R 2 ( s p ) # r e s u l t
j s y s c a l l _ e x i t
/* ------------------------------------------------------------------------ */
/ *
* More t h a n f o u r a r g u m e n t s . T r y t o d e a l w i t h i t b y c o p y i n g t h e
* stack a r g u m e n t s f r o m t h e u s e r s t a c k t o t h e k e r n e l s t a c k .
* This S u c k s ( T M ) .
* /
stackargs :
lw t 0 , P T _ R 2 9 ( s p ) # g e t o l d u s e r s t a c k p o i n t e r
/ *
* We i n t e n t i o n a l l y k e e p t h e k e r n e l s t a c k a l i t t l e b e l o w t h e t o p o f
* userspace s o w e d o n ' t h a v e t o d o a s l o w e r b y t e a c c u r a t e c h e c k h e r e .
* /
lw t 5 , T I _ A D D R _ L I M I T ( $ 2 8 )
addu t 4 , t 0 , 3 2
and t 5 , t 4
bltz t 5 , b a d _ s t a c k # - > s p i s b a d
/ * Ok, c o p y t h e a r g s f r o m t h e l u s e r s t a c k t o t h e k e r n e l s t a c k .
* t3 i s t h e p r e c o m p u t e d n u m b e r o f i n s t r u c t i o n b y t e s n e e d e d t o
* load o r s t o r e a r g u m e n t s 6 - 8 .
* /
la t 1 , 5 f # l o a d u p t o 3 a r g u m e n t s
subu t 1 , t 3
1 : lw t 5 , 1 6 ( t 0 ) # a r g u m e n t # 5 f r o m u s p
.set push
.set noreorder
.set nomacro
jr t 1
addiu t 1 , 6 f - 5 f
2 : lw t 8 , 2 8 ( t 0 ) # a r g u m e n t # 8 f r o m u s p
3 : lw t 7 , 2 4 ( t 0 ) # a r g u m e n t # 7 f r o m u s p
4 : lw t 6 , 2 0 ( t 0 ) # a r g u m e n t # 6 f r o m u s p
5 : jr t 1
sw t 5 , 1 6 ( s p ) # a r g u m e n t # 5 t o k s p
sw t 8 , 2 8 ( s p ) # a r g u m e n t # 8 t o k s p
sw t 7 , 2 4 ( s p ) # a r g u m e n t # 7 t o k s p
sw t 6 , 2 0 ( s p ) # a r g u m e n t # 6 t o k s p
6 : j s t a c k _ d o n e # g o b a c k
nop
.set pop
.section _ _ ex_ t a b l e ," a "
PTR 1 b ,b a d _ s t a c k
PTR 2 b ,b a d _ s t a c k
PTR 3 b ,b a d _ s t a c k
PTR 4 b ,b a d _ s t a c k
.previous
/ *
* The s t a c k p o i n t e r f o r a c a l l w i t h m o r e t h a n 4 a r g u m e n t s i s b a d .
* We p r o b a b l y s h o u l d h a n d l e t h i s c a s e a b i t m o r e d r a s t i c .
* /
bad_stack :
2010-09-28 21:50:47 +04:00
li v0 , E F A U L T
2005-04-17 02:20:36 +04:00
sw v0 , P T _ R 2 ( s p )
li t 0 , 1 # s e t e r r o r f l a g
sw t 0 , P T _ R 7 ( s p )
j o 3 2 _ s y s c a l l _ e x i t
/ *
* The s y s t e m c a l l d o e s n o t e x i s t i n t h i s k e r n e l
* /
illegal_syscall :
2008-10-24 20:17:22 +04:00
li v0 , E N O S Y S # e r r o r
2005-04-17 02:20:36 +04:00
sw v0 , P T _ R 2 ( s p )
li t 0 , 1 # s e t e r r o r f l a g
sw t 0 , P T _ R 7 ( s p )
j o 3 2 _ s y s c a l l _ e x i t
END( h a n d l e _ s y s )
LEAF( s y s _ s y s c a l l )
subu t 0 , a0 , _ _ N R _ O 3 2 _ L i n u x # c h e c k s y s c a l l n u m b e r
sltiu v0 , t 0 , _ _ N R _ O 3 2 _ L i n u x _ s y s c a l l s + 1
2008-11-19 02:05:46 +03:00
beqz t 0 , e i n v a l # d o n o t r e c u r s e
2005-04-17 02:20:36 +04:00
sll t 1 , t 0 , 3
beqz v0 , e i n v a l
lw t 2 , s y s _ c a l l _ t a b l e ( t 1 ) # s y s c a l l r o u t i n e
/ * Some s y s c a l l s l i k e e x e c v e g e t t h e i r a r g u m e n t s f r o m s t r u c t p t _ r e g s
and c l a i m z e r o a r g u m e n t s i n t h e s y s c a l l t a b l e . T h u s w e h a v e t o
assume t h e w o r s t c a s e a n d s h u f f l e a r o u n d a l l p o t e n t i a l a r g u m e n t s .
If y o u w a n t p e r f o r m a n c e , d o n ' t u s e i n d i r e c t s y s c a l l s . * /
move a0 , a1 # s h i f t a r g u m e n t r e g i s t e r s
move a1 , a2
move a2 , a3
lw a3 , 1 6 ( s p )
lw t 4 , 2 0 ( s p )
lw t 5 , 2 4 ( s p )
lw t 6 , 2 8 ( s p )
sw t 4 , 1 6 ( s p )
sw t 5 , 2 0 ( s p )
sw t 6 , 2 4 ( s p )
sw a0 , P T _ R 4 ( s p ) # . . a n d p u s h b a c k a 0 - a3 , s o m e
sw a1 , P T _ R 5 ( s p ) # s y s c a l l s e x p e c t t h e m t h e r e
sw a2 , P T _ R 6 ( s p )
sw a3 , P T _ R 7 ( s p )
sw a3 , P T _ R 2 6 ( s p ) # u p d a t e a 3 f o r s y s c a l l r e s t a r t i n g
jr t 2
/* Unreached */
2008-10-24 20:17:23 +04:00
einval : li v0 , - E N O S Y S
2005-04-17 02:20:36 +04:00
jr r a
END( s y s _ s y s c a l l )
.macro fifty ptr, n a r g s , f r o m =1 , t o =50
sys \ p t r \ n a r g s
.if \ to- \ f r o m
fifty \ p t r ,\ n a r g s ," ( \ f r o m + 1 ) " ,\ t o
.endif
.endm
.macro mille ptr, n a r g s , f r o m =1 , t o =20
fifty \ p t r ,\ n a r g s
.if \ to- \ f r o m
mille \ p t r ,\ n a r g s ," ( \ f r o m + 1 ) " ,\ t o
.endif
.endm
.macro syscalltable
sys s y s _ s y s c a l l 8 / * 4 0 0 0 * /
sys s y s _ e x i t 1
sys s y s _ f o r k 0
sys s y s _ r e a d 3
sys s y s _ w r i t e 3
sys s y s _ o p e n 3 / * 4 0 0 5 * /
sys s y s _ c l o s e 1
sys s y s _ w a i t p i d 3
sys s y s _ c r e a t 2
sys s y s _ l i n k 2
sys s y s _ u n l i n k 1 / * 4 0 1 0 * /
sys s y s _ e x e c v e 0
sys s y s _ c h d i r 1
sys s y s _ t i m e 1
sys s y s _ m k n o d 3
sys s y s _ c h m o d 2 / * 4 0 1 5 * /
sys s y s _ l c h o w n 3
sys s y s _ n i _ s y s c a l l 0
sys s y s _ n i _ s y s c a l l 0 / * w a s s y s _ s t a t * /
sys s y s _ l s e e k 3
sys s y s _ g e t p i d 0 / * 4 0 2 0 * /
sys s y s _ m o u n t 5
sys s y s _ o l d u m o u n t 1
sys s y s _ s e t u i d 1
sys s y s _ g e t u i d 0
sys s y s _ s t i m e 1 / * 4 0 2 5 * /
sys s y s _ p t r a c e 4
sys s y s _ a l a r m 1
sys s y s _ n i _ s y s c a l l 0 / * w a s s y s _ f s t a t * /
sys s y s _ p a u s e 0
sys s y s _ u t i m e 2 / * 4 0 3 0 * /
sys s y s _ n i _ s y s c a l l 0
sys s y s _ n i _ s y s c a l l 0
sys s y s _ a c c e s s 2
sys s y s _ n i c e 1
sys s y s _ n i _ s y s c a l l 0 / * 4 0 3 5 * /
sys s y s _ s y n c 0
sys s y s _ k i l l 2
sys s y s _ r e n a m e 2
sys s y s _ m k d i r 2
sys s y s _ r m d i r 1 / * 4 0 4 0 * /
sys s y s _ d u p 1
2008-07-20 16:16:46 +04:00
sys s y s m _ p i p e 0
2005-04-17 02:20:36 +04:00
sys s y s _ t i m e s 1
sys s y s _ n i _ s y s c a l l 0
sys s y s _ b r k 1 / * 4 0 4 5 * /
sys s y s _ s e t g i d 1
sys s y s _ g e t g i d 0
sys s y s _ n i _ s y s c a l l 0 / * w a s s i g n a l ( 2 ) * /
sys s y s _ g e t e u i d 0
sys s y s _ g e t e g i d 0 / * 4 0 5 0 * /
sys s y s _ a c c t 1
sys s y s _ u m o u n t 2
sys s y s _ n i _ s y s c a l l 0
sys s y s _ i o c t l 3
sys s y s _ f c n t l 3 / * 4 0 5 5 * /
sys s y s _ n i _ s y s c a l l 2
sys s y s _ s e t p g i d 2
sys s y s _ n i _ s y s c a l l 0
sys s y s _ o l d u n a m e 1
sys s y s _ u m a s k 1 / * 4 0 6 0 * /
sys s y s _ c h r o o t 1
sys s y s _ u s t a t 2
sys s y s _ d u p2 2
sys s y s _ g e t p p i d 0
sys s y s _ g e t p g r p 0 / * 4 0 6 5 * /
sys s y s _ s e t s i d 0
sys s y s _ s i g a c t i o n 3
sys s y s _ s g e t m a s k 0
sys s y s _ s s e t m a s k 1
sys s y s _ s e t r e u i d 2 / * 4 0 7 0 * /
sys s y s _ s e t r e g i d 2
sys s y s _ s i g s u s p e n d 0
sys s y s _ s i g p e n d i n g 1
sys s y s _ s e t h o s t n a m e 2
sys s y s _ s e t r l i m i t 2 / * 4 0 7 5 * /
sys s y s _ g e t r l i m i t 2
sys s y s _ g e t r u s a g e 2
sys s y s _ g e t t i m e o f d a y 2
sys s y s _ s e t t i m e o f d a y 2
sys s y s _ g e t g r o u p s 2 / * 4 0 8 0 * /
sys s y s _ s e t g r o u p s 2
sys s y s _ n i _ s y s c a l l 0 / * o l d _ s e l e c t * /
sys s y s _ s y m l i n k 2
sys s y s _ n i _ s y s c a l l 0 / * w a s s y s _ l s t a t * /
sys s y s _ r e a d l i n k 3 / * 4 0 8 5 * /
sys s y s _ u s e l i b 1
sys s y s _ s w a p o n 2
sys s y s _ r e b o o t 3
2009-01-14 16:13:55 +03:00
sys s y s _ o l d _ r e a d d i r 3
2009-02-08 19:00:26 +03:00
sys s y s _ m i p s _ m m a p 6 / * 4 0 9 0 * /
2005-04-17 02:20:36 +04:00
sys s y s _ m u n m a p 2
sys s y s _ t r u n c a t e 2
sys s y s _ f t r u n c a t e 2
sys s y s _ f c h m o d 2
sys s y s _ f c h o w n 3 / * 4 0 9 5 * /
sys s y s _ g e t p r i o r i t y 2
sys s y s _ s e t p r i o r i t y 3
sys s y s _ n i _ s y s c a l l 0
sys s y s _ s t a t f s 2
sys s y s _ f s t a t f s 2 / * 4 1 0 0 * /
sys s y s _ n i _ s y s c a l l 0 / * w a s i o p e r m ( 2 ) * /
sys s y s _ s o c k e t c a l l 2
sys s y s _ s y s l o g 3
sys s y s _ s e t i t i m e r 3
sys s y s _ g e t i t i m e r 2 / * 4 1 0 5 * /
sys s y s _ n e w s t a t 2
sys s y s _ n e w l s t a t 2
sys s y s _ n e w f s t a t 2
sys s y s _ u n a m e 1
sys s y s _ n i _ s y s c a l l 0 / * 4 1 1 0 w a s i o p l ( 2 ) * /
sys s y s _ v h a n g u p 0
sys s y s _ n i _ s y s c a l l 0 / * w a s s y s _ i d l e ( ) * /
sys s y s _ n i _ s y s c a l l 0 / * w a s s y s _ v m 8 6 * /
sys s y s _ w a i t 4 4
sys s y s _ s w a p o f f 1 / * 4 1 1 5 * /
sys s y s _ s y s i n f o 1
sys s y s _ i p c 6
sys s y s _ f s y n c 1
sys s y s _ s i g r e t u r n 0
sys s y s _ c l o n e 0 / * 4 1 2 0 * /
sys s y s _ s e t d o m a i n n a m e 2
sys s y s _ n e w u n a m e 1
sys s y s _ n i _ s y s c a l l 0 / * s y s _ m o d i f y _ l d t * /
sys s y s _ a d j t i m e x 1
sys s y s _ m p r o t e c t 3 / * 4 1 2 5 * /
sys s y s _ s i g p r o c m a s k 3
sys s y s _ n i _ s y s c a l l 0 / * w a s c r e a t e _ m o d u l e * /
sys s y s _ i n i t _ m o d u l e 5
sys s y s _ d e l e t e _ m o d u l e 1
sys s y s _ n i _ s y s c a l l 0 / * 4 1 3 0 w a s g e t _ k e r n e l _ s y m s * /
sys s y s _ q u o t a c t l 4
sys s y s _ g e t p g i d 1
sys s y s _ f c h d i r 1
sys s y s _ b d f l u s h 2
sys s y s _ s y s f s 3 / * 4 1 3 5 * /
sys s y s _ p e r s o n a l i t y 1
sys s y s _ n i _ s y s c a l l 0 / * f o r a f s _ s y s c a l l * /
sys s y s _ s e t f s u i d 1
sys s y s _ s e t f s g i d 1
sys s y s _ l l s e e k 5 / * 4 1 4 0 * /
sys s y s _ g e t d e n t s 3
sys s y s _ s e l e c t 5
sys s y s _ f l o c k 2
sys s y s _ m s y n c 3
sys s y s _ r e a d v 3 / * 4 1 4 5 * /
sys s y s _ w r i t e v 3
sys s y s _ c a c h e f l u s h 3
sys s y s _ c a c h e c t l 3
sys s y s _ s y s m i p s 4
sys s y s _ n i _ s y s c a l l 0 / * 4 1 5 0 * /
sys s y s _ g e t s i d 1
sys s y s _ f d a t a s y n c 1
sys s y s _ s y s c t l 1
sys s y s _ m l o c k 2
sys s y s _ m u n l o c k 2 / * 4 1 5 5 * /
sys s y s _ m l o c k a l l 1
sys s y s _ m u n l o c k a l l 0
sys s y s _ s c h e d _ s e t p a r a m 2
sys s y s _ s c h e d _ g e t p a r a m 2
sys s y s _ s c h e d _ s e t s c h e d u l e r 3 / * 4 1 6 0 * /
sys s y s _ s c h e d _ g e t s c h e d u l e r 1
sys s y s _ s c h e d _ y i e l d 0
sys s y s _ s c h e d _ g e t _ p r i o r i t y _ m a x 1
sys s y s _ s c h e d _ g e t _ p r i o r i t y _ m i n 1
sys s y s _ s c h e d _ r r _ g e t _ i n t e r v a l 2 / * 4 1 6 5 * /
sys s y s _ n a n o s l e e p , 2
2006-06-23 13:04:14 +04:00
sys s y s _ m r e m a p , 5
2005-04-17 02:20:36 +04:00
sys s y s _ a c c e p t 3
sys s y s _ b i n d 3
sys s y s _ c o n n e c t 3 / * 4 1 7 0 * /
sys s y s _ g e t p e e r n a m e 3
sys s y s _ g e t s o c k n a m e 3
sys s y s _ g e t s o c k o p t 5
sys s y s _ l i s t e n 2
sys s y s _ r e c v 4 / * 4 1 7 5 * /
sys s y s _ r e c v f r o m 6
sys s y s _ r e c v m s g 3
sys s y s _ s e n d 4
sys s y s _ s e n d m s g 3
sys s y s _ s e n d t o 6 / * 4 1 8 0 * /
sys s y s _ s e t s o c k o p t 5
sys s y s _ s h u t d o w n 2
sys s y s _ s o c k e t 3
sys s y s _ s o c k e t p a i r 4
sys s y s _ s e t r e s u i d 3 / * 4 1 8 5 * /
sys s y s _ g e t r e s u i d 3
sys s y s _ n i _ s y s c a l l 0 / * w a s s y s _ q u e r y _ m o d u l e * /
sys s y s _ p o l l 3
2011-08-27 02:03:11 +04:00
sys s y s _ n i _ s y s c a l l 0 / * w a s n f s s e r v c t l * /
2005-04-17 02:20:36 +04:00
sys s y s _ s e t r e s g i d 3 / * 4 1 9 0 * /
sys s y s _ g e t r e s g i d 3
sys s y s _ p r c t l 5
sys s y s _ r t _ s i g r e t u r n 0
sys s y s _ r t _ s i g a c t i o n 4
sys s y s _ r t _ s i g p r o c m a s k 4 / * 4 1 9 5 * /
sys s y s _ r t _ s i g p e n d i n g 2
sys s y s _ r t _ s i g t i m e d w a i t 4
sys s y s _ r t _ s i g q u e u e i n f o 3
sys s y s _ r t _ s i g s u s p e n d 0
sys s y s _ p r e a d64 6 / * 4 2 0 0 * /
sys s y s _ p w r i t e 6 4 6
sys s y s _ c h o w n 3
sys s y s _ g e t c w d 2
sys s y s _ c a p g e t 2
sys s y s _ c a p s e t 2 / * 4 2 0 5 * /
sys s y s _ s i g a l t s t a c k 0
sys s y s _ s e n d f i l e 4
sys s y s _ n i _ s y s c a l l 0
sys s y s _ n i _ s y s c a l l 0
2009-02-08 19:00:26 +03:00
sys s y s _ m i p s _ m m a p2 6 / * 4 2 1 0 * /
2005-04-17 02:20:36 +04:00
sys s y s _ t r u n c a t e 6 4 4
sys s y s _ f t r u n c a t e 6 4 4
sys s y s _ s t a t 6 4 2
sys s y s _ l s t a t 6 4 2
sys s y s _ f s t a t 6 4 2 / * 4 2 1 5 * /
sys s y s _ p i v o t _ r o o t 2
sys s y s _ m i n c o r e 3
sys s y s _ m a d v i s e 3
sys s y s _ g e t d e n t s64 3
sys s y s _ f c n t l 6 4 3 / * 4 2 2 0 * /
sys s y s _ n i _ s y s c a l l 0
sys s y s _ g e t t i d 0
sys s y s _ r e a d a h e a d 5
sys s y s _ s e t x a t t r 5
sys s y s _ l s e t x a t t r 5 / * 4 2 2 5 * /
sys s y s _ f s e t x a t t r 5
sys s y s _ g e t x a t t r 4
sys s y s _ l g e t x a t t r 4
sys s y s _ f g e t x a t t r 4
sys s y s _ l i s t x a t t r 3 / * 4 2 3 0 * /
sys s y s _ l l i s t x a t t r 3
sys s y s _ f l i s t x a t t r 3
sys s y s _ r e m o v e x a t t r 2
sys s y s _ l r e m o v e x a t t r 2
sys s y s _ f r e m o v e x a t t r 2 / * 4 2 3 5 * /
sys s y s _ t k i l l 2
sys s y s _ s e n d f i l e 6 4 5
2005-03-13 03:07:00 +03:00
sys s y s _ f u t e x 6
2006-04-05 12:45:47 +04:00
# ifdef C O N F I G _ M I P S _ M T _ F P A F F
/ *
* For F P U a f f i n i t y s c h e d u l i n g o n M I P S M T p r o c e s s o r s , w e n e e d t o
* intercept s y s _ s c h e d _ x x x a f f i n i t y ( ) c a l l s u n t i l w e g e t a p r o p e r h o o k
* in k e r n e l / s c h e d . c . C o n s i d e r e d o n l y t e m p o r a r y w e o n l y s u p p o r t t h e s e
* hooks f o r t h e 3 2 - b i t k e r n e l - t h e r e i s n o M I P S 6 4 M T p r o c e s s o r a t m .
* /
sys m i p s m t _ s y s _ s c h e d _ s e t a f f i n i t y 3
sys m i p s m t _ s y s _ s c h e d _ g e t a f f i n i t y 3
# else
2005-04-17 02:20:36 +04:00
sys s y s _ s c h e d _ s e t a f f i n i t y 3
sys s y s _ s c h e d _ g e t a f f i n i t y 3 / * 4 2 4 0 * /
2006-04-05 12:45:47 +04:00
# endif / * C O N F I G _ M I P S _ M T _ F P A F F * /
2005-04-17 02:20:36 +04:00
sys s y s _ i o _ s e t u p 2
sys s y s _ i o _ d e s t r o y 1
sys s y s _ i o _ g e t e v e n t s 5
sys s y s _ i o _ s u b m i t 3
sys s y s _ i o _ c a n c e l 3 / * 4 2 4 5 * /
sys s y s _ e x i t _ g r o u p 1
2005-10-18 15:48:31 +04:00
sys s y s _ l o o k u p _ d c o o k i e 4
2005-04-17 02:20:36 +04:00
sys s y s _ e p o l l _ c r e a t e 1
sys s y s _ e p o l l _ c t l 4
sys s y s _ e p o l l _ w a i t 3 / * 4 2 5 0 * /
sys s y s _ r e m a p _ f i l e _ p a g e s 5
sys s y s _ s e t _ t i d _ a d d r e s s 1
sys s y s _ r e s t a r t _ s y s c a l l 0
sys s y s _ f a d v i s e 6 4 _ 6 4 7
sys s y s _ s t a t f s64 3 / * 4 2 5 5 * /
sys s y s _ f s t a t f s64 2
sys s y s _ t i m e r _ c r e a t e 3
sys s y s _ t i m e r _ s e t t i m e 4
sys s y s _ t i m e r _ g e t t i m e 2
sys s y s _ t i m e r _ g e t o v e r r u n 1 / * 4 2 6 0 * /
sys s y s _ t i m e r _ d e l e t e 1
sys s y s _ c l o c k _ s e t t i m e 2
sys s y s _ c l o c k _ g e t t i m e 2
sys s y s _ c l o c k _ g e t r e s 2
sys s y s _ c l o c k _ n a n o s l e e p 4 / * 4 2 6 5 * /
sys s y s _ t g k i l l 3
sys s y s _ u t i m e s 2
sys s y s _ m b i n d 4
sys s y s _ n i _ s y s c a l l 0 / * s y s _ g e t _ m e m p o l i c y * /
sys s y s _ n i _ s y s c a l l 0 / * 4 2 7 0 s y s _ s e t _ m e m p o l i c y * /
sys s y s _ m q _ o p e n 4
sys s y s _ m q _ u n l i n k 1
sys s y s _ m q _ t i m e d s e n d 5
sys s y s _ m q _ t i m e d r e c e i v e 5
sys s y s _ m q _ n o t i f y 2 / * 4 2 7 5 * /
sys s y s _ m q _ g e t s e t a t t r 3
sys s y s _ n i _ s y s c a l l 0 / * s y s _ v s e r v e r * /
2005-02-17 00:19:59 +03:00
sys s y s _ w a i t i d 5
2005-04-17 02:20:36 +04:00
sys s y s _ n i _ s y s c a l l 0 / * a v a i l a b l e , w a s s e t a l t r o o t * /
2005-05-31 15:49:19 +04:00
sys s y s _ a d d _ k e y 5 / * 4 2 8 0 * /
2005-04-17 02:20:36 +04:00
sys s y s _ r e q u e s t _ k e y 4
sys s y s _ k e y c t l 5
2005-04-13 21:43:59 +04:00
sys s y s _ s e t _ t h r e a d _ a r e a 1
2005-07-13 15:48:45 +04:00
sys s y s _ i n o t i f y _ i n i t 0
sys s y s _ i n o t i f y _ a d d _ w a t c h 3 / * 4 2 8 5 * /
sys s y s _ i n o t i f y _ r m _ w a t c h 2
2006-02-08 16:38:50 +03:00
sys s y s _ m i g r a t e _ p a g e s 4
sys s y s _ o p e n a t 4
sys s y s _ m k d i r a t 3
sys s y s _ m k n o d a t 4 / * 4 2 9 0 * /
sys s y s _ f c h o w n a t 5
sys s y s _ f u t i m e s a t 3
2006-02-13 12:07:30 +03:00
sys s y s _ f s t a t a t 6 4 4
2006-02-08 16:38:50 +03:00
sys s y s _ u n l i n k a t 3
sys s y s _ r e n a m e a t 4 / * 4 2 9 5 * /
2006-02-25 00:04:21 +03:00
sys s y s _ l i n k a t 5
2006-02-08 16:38:50 +03:00
sys s y s _ s y m l i n k a t 3
sys s y s _ r e a d l i n k a t 4
sys s y s _ f c h m o d a t 3
sys s y s _ f a c c e s s a t 3 / * 4 3 0 0 * /
sys s y s _ p s e l e c t 6 6
sys s y s _ p p o l l 5
sys s y s _ u n s h a r e 1
2008-12-03 19:33:17 +03:00
sys s y s _ s p l i c e 6
2006-04-01 10:49:21 +04:00
sys s y s _ s y n c _ f i l e _ r a n g e 7 / * 4 3 0 5 * /
2006-04-15 13:16:19 +04:00
sys s y s _ t e e 4
2006-07-02 19:31:14 +04:00
sys s y s _ v m s p l i c e 4
sys s y s _ m o v e _ p a g e s 6
2006-09-06 17:42:02 +04:00
sys s y s _ s e t _ r o b u s t _ l i s t 2
2006-10-19 02:52:17 +04:00
sys s y s _ g e t _ r o b u s t _ l i s t 3 / * 4 3 1 0 * /
2006-10-18 17:14:55 +04:00
sys s y s _ k e x e c _ l o a d 4
2006-10-30 00:07:40 +03:00
sys s y s _ g e t c p u 3
sys s y s _ e p o l l _ p w a i t 6
2007-03-06 20:04:49 +03:00
sys s y s _ i o p r i o _ s e t 3
2007-05-29 18:29:40 +04:00
sys s y s _ i o p r i o _ g e t 2 / * 4 3 1 5 * /
sys s y s _ u t i m e n s a t 4
sys s y s _ s i g n a l f d 3
2011-04-13 22:50:46 +04:00
sys s y s _ n i _ s y s c a l l 0 / * w a s t i m e r f d * /
2007-05-29 18:29:40 +04:00
sys s y s _ e v e n t f d 1
2007-07-26 06:38:24 +04:00
sys s y s _ f a l l o c a t e 6 / * 4 3 2 0 * /
2008-02-19 00:02:37 +03:00
sys s y s _ t i m e r f d _ c r e a t e 2
sys s y s _ t i m e r f d _ g e t t i m e 2
sys s y s _ t i m e r f d _ s e t t i m e 4
2008-07-31 14:16:43 +04:00
sys s y s _ s i g n a l f d4 4
sys s y s _ e v e n t f d2 2 / * 4 3 2 5 * /
sys s y s _ e p o l l _ c r e a t e 1 1
sys s y s _ d u p3 3
sys s y s _ p i p e 2 2
sys s y s _ i n o t i f y _ i n i t 1 1
2009-04-03 03:59:24 +04:00
sys s y s _ p r e a d v 6 / * 4 3 3 0 * /
sys s y s _ p w r i t e v 6
2009-06-26 20:53:57 +04:00
sys s y s _ r t _ t g s i g q u e u e i n f o 4
perf: Do the big rename: Performance Counters -> Performance Events
Bye-bye Performance Counters, welcome Performance Events!
In the past few months the perfcounters subsystem has grown out its
initial role of counting hardware events, and has become (and is
becoming) a much broader generic event enumeration, reporting, logging,
monitoring, analysis facility.
Naming its core object 'perf_counter' and naming the subsystem
'perfcounters' has become more and more of a misnomer. With pending
code like hw-breakpoints support the 'counter' name is less and
less appropriate.
All in one, we've decided to rename the subsystem to 'performance
events' and to propagate this rename through all fields, variables
and API names. (in an ABI compatible fashion)
The word 'event' is also a bit shorter than 'counter' - which makes
it slightly more convenient to write/handle as well.
Thanks goes to Stephane Eranian who first observed this misnomer and
suggested a rename.
User-space tooling and ABI compatibility is not affected - this patch
should be function-invariant. (Also, defconfigs were not touched to
keep the size down.)
This patch has been generated via the following script:
FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')
sed -i \
-e 's/PERF_EVENT_/PERF_RECORD_/g' \
-e 's/PERF_COUNTER/PERF_EVENT/g' \
-e 's/perf_counter/perf_event/g' \
-e 's/nb_counters/nb_events/g' \
-e 's/swcounter/swevent/g' \
-e 's/tpcounter_event/tp_event/g' \
$FILES
for N in $(find . -name perf_counter.[ch]); do
M=$(echo $N | sed 's/perf_counter/perf_event/g')
mv $N $M
done
FILES=$(find . -name perf_event.*)
sed -i \
-e 's/COUNTER_MASK/REG_MASK/g' \
-e 's/COUNTER/EVENT/g' \
-e 's/\<event\>/event_id/g' \
-e 's/counter/event/g' \
-e 's/Counter/Event/g' \
$FILES
... to keep it as correct as possible. This script can also be
used by anyone who has pending perfcounters patches - it converts
a Linux kernel tree over to the new naming. We tried to time this
change to the point in time where the amount of pending patches
is the smallest: the end of the merge window.
Namespace clashes were fixed up in a preparatory patch - and some
stylistic fallout will be fixed up in a subsequent patch.
( NOTE: 'counters' are still the proper terminology when we deal
with hardware registers - and these sed scripts are a bit
over-eager in renaming them. I've undone some of that, but
in case there's something left where 'counter' would be
better than 'event' we can undo that on an individual basis
instead of touching an otherwise nicely automated patch. )
Suggested-by: Stephane Eranian <eranian@google.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Paul Mackerras <paulus@samba.org>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <linux-arch@vger.kernel.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-21 14:02:48 +04:00
sys s y s _ p e r f _ e v e n t _ o p e n 5
2009-08-03 20:27:19 +04:00
sys s y s _ a c c e p t 4 4
2010-08-24 01:10:37 +04:00
sys s y s _ r e c v m m s g 5 / * 4 3 3 5 * /
sys s y s _ f a n o t i f y _ i n i t 2
sys s y s _ f a n o t i f y _ m a r k 6
sys s y s _ p r l i m i t 6 4 4
2011-03-18 20:37:23 +03:00
sys s y s _ n a m e _ t o _ h a n d l e _ a t 5
sys s y s _ o p e n _ b y _ h a n d l e _ a t 3 / * 4 3 4 0 * /
sys s y s _ c l o c k _ a d j t i m e 2
2011-03-25 20:45:20 +03:00
sys s y s _ s y n c f s 1
2011-05-28 16:22:58 +04:00
sys s y s _ s e n d m m s g 4
2011-05-28 06:28:27 +04:00
sys s y s _ s e t n s 2
2005-04-17 02:20:36 +04:00
.endm
/ * We p r e - c o m p u t e t h e n u m b e r o f _ i n s t r u c t i o n _ b y t e s n e e d e d t o
load o r s t o r e t h e a r g u m e n t s 6 - 8 . N e g a t i v e v a l u e s a r e i g n o r e d . * /
.macro sys function, n a r g s
PTR \ f u n c t i o n
LONG ( \ n a r g s < < 2 ) - ( 5 < < 2 )
.endm
.align 3
.type sys_ c a l l _ t a b l e ,@object
EXPORT( s y s _ c a l l _ t a b l e )
syscalltable
.size sys_ c a l l _ t a b l e , . - s y s _ c a l l _ t a b l e