2005-07-27 22:44:44 +04:00
/ *
* Copyright ( C ) 2 0 0 0 - 2 0 0 3 A x i s C o m m u n i c a t i o n s A B
*
* Authors : Bjorn W e s e n ( b j o r n w @axis.com)
* Tobias A n d e r b e r g ( t o b i a s a @axis.com), CRISv32 port.
*
* Code f o r t h e s y s t e m - c a l l a n d f a u l t l o w - l e v e l h a n d l i n g r o u t i n e s .
*
* NOTE : This c o d e h a n d l e s s i g n a l - r e c o g n i t i o n , w h i c h h a p p e n s e v e r y t i m e
* after a t i m e r - i n t e r r u p t a n d a f t e r e a c h s y s t e m c a l l .
*
* Stack l a y o u t i n ' r e t _ f r o m _ s y s t e m _ c a l l ' :
2007-11-30 17:44:07 +03:00
* ptrace n e e d s t o h a v e a l l r e g s o n t h e s t a c k .
2005-07-27 22:44:44 +04:00
* if t h e o r d e r h e r e i s c h a n g e d , i t n e e d s t o b e
* updated i n f o r k . c : c o p y _ p r o c e s s , s i g n a l . c : d o _ s i g n a l ,
* ptrace. c a n d p t r a c e . h
*
* /
# include < l i n u x / l i n k a g e . h >
# include < l i n u x / s y s . h >
# include < a s m / u n i s t d . h >
# include < a s m / e r r n o . h >
# include < a s m / t h r e a d _ i n f o . h >
2005-09-10 00:44:31 +04:00
# include < a s m / a s m - o f f s e t s . h >
2005-07-27 22:44:44 +04:00
2008-10-21 19:45:58 +04:00
# include < h w r e g s / a s m / r e g _ m a p _ a s m . h >
# include < h w r e g s / a s m / i n t r _ v e c t _ d e f s _ a s m . h >
2005-07-27 22:44:44 +04:00
;; Exported functions.
.globl system_call
.globl ret_from_intr
.globl ret_from_fork
.globl resume
.globl multiple_interrupt
.globl nmi_interrupt
.globl spurious_interrupt
.globl do_sigtrap
.globl gdb_handle_exception
.globl sys_call_table
; Check if preemptive kernel scheduling should be done.
# ifdef C O N F I G _ P R E E M P T
_resume_kernel :
di
; Load current task struct.
movs. w - 8 1 9 2 , $ r0 ; THREAD_SIZE = 8192
and. d $ s p , $ r0
addoq + T I _ p r e e m p t _ c o u n t , $ r0 , $ a c r
move. d [ $ a c r ] , $ r10 ; Preemption disabled?
bne _ R e x i t
nop
_need_resched :
addoq + T I _ f l a g s , $ r0 , $ a c r
move. d [ $ a c r ] , $ r10
btstq T I F _ N E E D _ R E S C H E D , $ r10 ; Check if need_resched is set.
bpl _ R e x i t
nop
; Do preemptive kernel scheduling.
jsr p r e e m p t _ s c h e d u l e _ i r q
nop
; Load new task struct.
movs. w - 8 1 9 2 , $ r0 ; THREAD_SIZE = 8192.
and. d $ s p , $ r0
; One more time with new task.
ba _ n e e d _ r e s c h e d
nop
# else
# define _ r e s u m e _ k e r n e l _ R e x i t
# endif
; Called at exit from fork. schedule_tail must be called to drop
; spinlock if CONFIG_PREEMPT.
2010-08-02 20:05:17 +04:00
.type ret_ f r o m _ f o r k ,@function
2005-07-27 22:44:44 +04:00
ret_from_fork :
jsr s c h e d u l e _ t a i l
nop
ba r e t _ f r o m _ s y s _ c a l l
nop
2010-08-02 20:05:17 +04:00
.size ret_ f r o m _ f o r k , . - r e t _ f r o m _ f o r k
2005-07-27 22:44:44 +04:00
2010-08-02 20:05:17 +04:00
.type ret_ f r o m _ i n t r ,@function
2005-07-27 22:44:44 +04:00
ret_from_intr :
;; Check for resched if preemptive kernel, or if we're going back to
;; user-mode. This test matches the user_regs(regs) macro. Don't simply
;; test CCS since that doesn't necessarily reflect what mode we'll
;; return into.
addoq + P T _ c c s , $ s p , $ a c r
move. d [ $ a c r ] , $ r0
btstq 1 6 , $ r0 ; User-mode flag.
bpl _ r e s u m e _ k e r n e l
2010-08-02 20:05:17 +04:00
.size ret_ f r o m _ i n t r , . - r e t _ f r o m _ i n t r + 2 ; +2 includes the dslot.
2005-07-27 22:44:44 +04:00
; Note that di below is in delay slot.
2010-08-02 20:05:17 +04:00
.type _ resume_ u s e r s p a c e ,@function
2005-07-27 22:44:44 +04:00
_resume_userspace :
di ; So need_resched and sigpending don't change.
movs. w - 8 1 9 2 , $ r0 ; THREAD_SIZE == 8192
and. d $ s p , $ r0
addoq + T I _ f l a g s , $ r0 , $ a c r ; current->work
move. d [ $ a c r ] , $ r10
and. d _ T I F _ W O R K _ M A S K , $ r10 ; Work to be done on return?
bne _ w o r k _ p e n d i n g
nop
ba _ R e x i t
nop
2010-08-02 20:05:17 +04:00
.size _ resume_ u s e r s p a c e , . - _ r e s u m e _ u s e r s p a c e
2005-07-27 22:44:44 +04:00
;; The system_call is called by a BREAK instruction, which looks pretty
;; much like any other exception.
;;
;; System calls can't be made from interrupts but we still stack ERP
;; to have a complete stack frame.
;;
;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,
;; r13,mof,srp
;;
;; This function looks on the _surface_ like spaghetti programming, but it's
;; really designed so that the fast-path does not force cache-loading of
;; non-used instructions. Only the non-common cases cause the outlined code
;; to run..
2010-08-02 20:05:17 +04:00
.type system_ c a l l ,@function
2005-07-27 22:44:44 +04:00
system_call :
;; Stack-frame similar to the irq heads, which is reversed in
;; ret_from_sys_call.
2010-08-02 20:13:45 +04:00
sub. d 9 2 , $ s p ; Skip EXS and EDA.
movem $ r13 , [ $ s p ]
move. d $ s p , $ r8
addq 1 4 * 4 , $ r8
move. d $ a c r , $ r0
move $ s r s , $ r1
move $ m o f , $ r2
move $ s p c , $ r3
move $ c c s , $ r4
move $ s r p , $ r5
move $ e r p , $ r6
2005-07-27 22:44:44 +04:00
subq 4 , $ s p
2010-08-02 20:13:45 +04:00
movem $ r6 , [ $ r8 ]
ei ; Enable interrupts while processing syscalls.
move. d $ r10 , [ $ s p ]
2005-07-27 22:44:44 +04:00
2010-08-02 20:13:45 +04:00
; Set S-bit when kernel debugging to keep hardware breakpoints active.
2005-07-27 22:44:44 +04:00
# ifdef C O N F I G _ E T R A X _ K G D B
move $ c c s , $ r0
or. d ( 1 < < 9 ) , $ r0
move $ r0 , $ c c s
# endif
movs. w - E N O S Y S , $ r0
addoq + P T _ r10 , $ s p , $ a c r
move. d $ r0 , [ $ a c r ]
;; Check if this process is syscall-traced.
movs. w - 8 1 9 2 , $ r0 ; THREAD_SIZE == 8192
and. d $ s p , $ r0
addoq + T I _ f l a g s , $ r0 , $ a c r
move. d [ $ a c r ] , $ r0
btstq T I F _ S Y S C A L L _ T R A C E , $ r0
bmi _ s y s c a l l _ t r a c e _ e n t r y
nop
_syscall_traced :
;; Check for sanity in the requested syscall number.
cmpu. w N R _ s y s c a l l s , $ r9
bhs r e t _ f r o m _ s y s _ c a l l
lslq 2 , $ r9 ; Multiply by 4, in the delay slot.
;; The location on the stack for the register structure is passed as a
;; seventh argument. Some system calls need this.
move. d $ s p , $ r0
subq 4 , $ s p
move. d $ r0 , [ $ s p ]
;; The registers carrying parameters (R10-R13) are intact. The optional
2011-03-31 05:57:33 +04:00
;; fifth and sixth parameters is in MOF and SRP respectively. Put them
2005-07-27 22:44:44 +04:00
;; back on the stack.
subq 4 , $ s p
move $ s r p , [ $ s p ]
subq 4 , $ s p
move $ m o f , [ $ s p ]
;; Actually to the system call.
addo. d + s y s _ c a l l _ t a b l e , $ r9 , $ a c r
move. d [ $ a c r ] , $ a c r
jsr $ a c r
nop
addq 3 * 4 , $ s p ; Pop the mof, srp and regs parameters.
addoq + P T _ r10 , $ s p , $ a c r
move. d $ r10 , [ $ a c r ] ; Save the return value.
moveq 1 , $ r9 ; "Parameter" to ret_from_sys_call to
; show it was a sys call.
;; Fall through into ret_from_sys_call to return.
ret_from_sys_call :
;; R9 is a parameter:
;; >= 1 from syscall
;; 0 from irq
;; Get the current task-struct pointer.
movs. w - 8 1 9 2 , $ r0 ; THREAD_SIZE == 8192
and. d $ s p , $ r0
di ; Make sure need_resched and sigpending don't change.
addoq + T I _ f l a g s , $ r0 , $ a c r
move. d [ $ a c r ] , $ r1
and. d _ T I F _ A L L W O R K _ M A S K , $ r1
bne _ s y s c a l l _ e x i t _ w o r k
nop
2010-08-02 20:05:17 +04:00
.size system_ c a l l , . - s y s t e m _ c a l l
2005-07-27 22:44:44 +04:00
2010-08-02 20:05:17 +04:00
.type _ Rexit,@function
2005-07-27 22:44:44 +04:00
_Rexit :
;; This epilogue MUST match the prologues in multiple_interrupt, irq.h
;; and ptregs.h.
addq 4 , $ s p ; Skip orig_r10.
movem [ $ s p + ] , $ r13 ; Registers R0-R13.
move. d [ $ s p + ] , $ a c r
move [ $ s p ] , $ s r s
addq 4 , $ s p
move [ $ s p + ] , $ m o f
move [ $ s p + ] , $ s p c
move [ $ s p + ] , $ c c s
move [ $ s p + ] , $ s r p
move [ $ s p + ] , $ e r p
addq 8 , $ s p ; Skip EXS, EDA.
jump $ e r p
rfe ; Restore condition code stack in delay-slot.
2010-08-02 20:05:17 +04:00
.size _ Rexit, . - _ R e x i t
2005-07-27 22:44:44 +04:00
;; We get here after doing a syscall if extra work might need to be done
;; perform syscall exit tracing if needed.
2010-08-02 20:05:17 +04:00
.type _ syscall_ e x i t _ w o r k ,@function
2005-07-27 22:44:44 +04:00
_syscall_exit_work :
;; R0 contains current at this point and irq's are disabled.
addoq + T I _ f l a g s , $ r0 , $ a c r
move. d [ $ a c r ] , $ r1
btstq T I F _ S Y S C A L L _ T R A C E , $ r1
bpl _ w o r k _ p e n d i n g
nop
ei
move. d $ r9 , $ r1 ; Preserve R9.
jsr d o _ s y s c a l l _ t r a c e
nop
move. d $ r1 , $ r9
ba _ r e s u m e _ u s e r s p a c e
nop
2010-08-02 20:05:17 +04:00
.size _ syscall_ e x i t _ w o r k , . - _ s y s c a l l _ e x i t _ w o r k
2005-07-27 22:44:44 +04:00
2010-08-02 20:05:17 +04:00
.type _ work_ p e n d i n g ,@function
2005-07-27 22:44:44 +04:00
_work_pending :
addoq + T I _ f l a g s , $ r0 , $ a c r
move. d [ $ a c r ] , $ r10
btstq T I F _ N E E D _ R E S C H E D , $ r10 ; Need resched?
bpl _ w o r k _ n o t i f y s i g ; No, must be signal/notify.
nop
2010-08-02 20:05:17 +04:00
.size _ work_ p e n d i n g , . - _ w o r k _ p e n d i n g
2005-07-27 22:44:44 +04:00
2010-08-02 20:05:17 +04:00
.type _ work_ r e s c h e d ,@function
2005-07-27 22:44:44 +04:00
_work_resched :
move. d $ r9 , $ r1 ; Preserve R9.
jsr s c h e d u l e
nop
move. d $ r1 , $ r9
di
addoq + T I _ f l a g s , $ r0 , $ a c r
move. d [ $ a c r ] , $ r1
and. d _ T I F _ W O R K _ M A S K , $ r1 ; Ignore sycall trace counter.
beq _ R e x i t
nop
btstq T I F _ N E E D _ R E S C H E D , $ r1
bmi _ w o r k _ r e s c h e d ; current->work.need_resched.
nop
2010-08-02 20:05:17 +04:00
.size _ work_ r e s c h e d , . - _ w o r k _ r e s c h e d
2005-07-27 22:44:44 +04:00
2010-08-02 20:05:17 +04:00
.type _ work_ n o t i f y s i g ,@function
2005-07-27 22:44:44 +04:00
_work_notifysig :
;; Deal with pending signals and notify-resume requests.
addoq + T I _ f l a g s , $ r0 , $ a c r
2007-11-30 17:44:07 +03:00
move. d [ $ a c r ] , $ r12 ; The thread_info_flags parameter.
move. d $ s p , $ r11 ; The regs param.
2005-07-27 22:44:44 +04:00
jsr d o _ n o t i f y _ r e s u m e
2007-11-30 17:44:07 +03:00
move. d $ r9 , $ r10 ; do_notify_resume syscall/irq param.
2005-07-27 22:44:44 +04:00
ba _ R e x i t
nop
2010-08-02 20:05:17 +04:00
.size _ work_ n o t i f y s i g , . - _ w o r k _ n o t i f y s i g
2005-07-27 22:44:44 +04:00
;; We get here as a sidetrack when we've entered a syscall with the
;; trace-bit set. We need to call do_syscall_trace and then continue
;; with the call.
_syscall_trace_entry :
;; PT_r10 in the frame contains -ENOSYS as required, at this point.
jsr d o _ s y s c a l l _ t r a c e
nop
;; Now re-enter the syscall code to do the syscall itself. We need to
;; restore R9 here to contain the wanted syscall, and the other
;; parameter-bearing registers.
addoq + P T _ r9 , $ s p , $ a c r
move. d [ $ a c r ] , $ r9
addoq + P T _ o r i g _ r10 , $ s p , $ a c r
move. d [ $ a c r ] , $ r10 ; PT_r10 is already -ENOSYS.
addoq + P T _ r11 , $ s p , $ a c r
move. d [ $ a c r ] , $ r11
addoq + P T _ r12 , $ s p , $ a c r
move. d [ $ a c r ] , $ r12
addoq + P T _ r13 , $ s p , $ a c r
move. d [ $ a c r ] , $ r13
addoq + P T _ m o f , $ s p , $ a c r
move [ $ a c r ] , $ m o f
addoq + P T _ s r p , $ s p , $ a c r
move [ $ a c r ] , $ s r p
ba _ s y s c a l l _ t r a c e d
nop
;; Resume performs the actual task-switching, by switching stack
;; pointers. Input arguments are:
;;
;; R10 = prev
;; R11 = next
;; R12 = thread offset in task struct.
;;
;; Returns old current in R10.
2010-08-02 20:05:17 +04:00
.type resume,@function
2005-07-27 22:44:44 +04:00
resume :
2010-08-02 20:09:56 +04:00
subq 4 , $ s p ; Make space for srp.
2005-07-27 22:44:44 +04:00
add. d $ r12 , $ r10 ; R10 = current tasks tss.
addoq + T H R E A D _ c c s , $ r10 , $ a c r
2010-08-02 20:09:56 +04:00
move $ s r p , [ $ s p ] ; Keep old/new PC on the stack.
2005-07-27 22:44:44 +04:00
move $ c c s , [ $ a c r ] ; Save IRQ enable state.
di
addoq + T H R E A D _ u s p , $ r10 , $ a c r
2010-08-02 20:09:56 +04:00
subq 1 0 * 4 , $ s p ; Make room for R9.
2005-07-27 22:44:44 +04:00
move $ u s p , [ $ a c r ] ; Save user-mode stackpointer.
;; See copy_thread for the reason why register R9 is saved.
movem $ r9 , [ $ s p ] ; Save non-scratch registers and R9.
addoq + T H R E A D _ k s p , $ r10 , $ a c r
2010-08-02 20:09:56 +04:00
move. d $ s p , $ r10 ; Return last running task in R10.
2005-07-27 22:44:44 +04:00
move. d $ s p , [ $ a c r ] ; Save kernel SP for old task.
and. d - 8 1 9 2 , $ r10 ; Get thread_info from stackpointer.
addoq + T I _ t a s k , $ r10 , $ a c r
add. d $ r12 , $ r11 ; Find the new tasks tss.
2010-08-02 20:09:56 +04:00
move. d [ $ a c r ] , $ r10 ; Get task.
2005-07-27 22:44:44 +04:00
addoq + T H R E A D _ k s p , $ r11 , $ a c r
move. d [ $ a c r ] , $ s p ; Switch to new stackframe.
2010-08-02 20:09:56 +04:00
addoq + T H R E A D _ u s p , $ r11 , $ a c r
2005-07-27 22:44:44 +04:00
movem [ $ s p + ] , $ r9 ; Restore non-scratch registers and R9.
move [ $ a c r ] , $ u s p ; Restore user-mode stackpointer.
addoq + T H R E A D _ c c s , $ r11 , $ a c r
2010-08-02 20:09:56 +04:00
move. d [ $ s p + ] , $ r11
jump $ r11 ; Restore PC.
2005-07-27 22:44:44 +04:00
move [ $ a c r ] , $ c c s ; Restore IRQ enable status.
2010-08-02 20:05:17 +04:00
.size resume, . - r e s u m e
2005-07-27 22:44:44 +04:00
nmi_interrupt :
;; If we receive a watchdog interrupt while it is not expected, then set
;; up a canonical frame and dump register contents before dying.
;; This prologue MUST match the one in irq.h and the struct in ptregs.h!
subq 1 2 , $ s p ; Skip EXS, EDA.
move $ n r p , [ $ s p ]
subq 4 , $ s p
move $ s r p , [ $ s p ]
subq 4 , $ s p
move $ c c s , [ $ s p ]
subq 4 , $ s p
move $ s p c , [ $ s p ]
subq 4 , $ s p
move $ m o f , [ $ s p ]
subq 4 , $ s p
move $ s r s , [ $ s p ]
subq 4 , $ s p
move. d $ a c r , [ $ s p ]
subq 1 4 * 4 , $ s p ; Make room for R0-R13.
movem $ r13 , [ $ s p ] ; Push R0-R13.
subq 4 , $ s p
move. d $ r10 , [ $ s p ] ; Push orig_r10.
move. d R E G _ A D D R ( i n t r _ v e c t , r e g i _ i r q , r _ n m i ) , $ r0
move. d [ $ r0 ] , $ r0
btstq R E G _ B I T ( i n t r _ v e c t , r _ n m i , w a t c h d o g ) , $ r0
bpl 1 f
nop
2007-11-30 17:44:07 +03:00
jsr h a n d l e _ w a t c h d o g _ b i t e ; In time.c.
2005-07-27 22:44:44 +04:00
move. d $ s p , $ r10 ; Pointer to registers
1 : btstq R E G _ B I T ( i n t r _ v e c t , r _ n m i , e x t ) , $ r0
bpl 1 f
nop
jsr h a n d l e _ n m i
move. d $ s p , $ r10 ; Pointer to registers
1 : addq 4 , $ s p ; Skip orig_r10
movem [ $ s p + ] , $ r13
move. d [ $ s p + ] , $ a c r
move [ $ s p ] , $ s r s
addq 4 , $ s p
move [ $ s p + ] , $ m o f
move [ $ s p + ] , $ s p c
move [ $ s p + ] , $ c c s
move [ $ s p + ] , $ s r p
move [ $ s p + ] , $ n r p
addq 8 , $ s p ; Skip EXS, EDA.
jump $ n r p
rfn
.comm cause_ o f _ d e a t h , 4 ;; Don't declare this anywhere.
spurious_interrupt :
di
jump h a r d _ r e s e t _ n o w
nop
;; This handles the case when multiple interrupts arrive at the same
;; time. Jump to the first set interrupt bit in a priotiry fashion. The
;; hardware will call the unserved interrupts after the handler
;; finishes.
2010-08-02 20:05:17 +04:00
.type multiple_ i n t e r r u p t , @function
2005-07-27 22:44:44 +04:00
multiple_interrupt :
;; This prologue MUST match the one in irq.h and the struct in ptregs.h!
subq 1 2 , $ s p ; Skip EXS, EDA.
move $ e r p , [ $ s p ]
subq 4 , $ s p
move $ s r p , [ $ s p ]
subq 4 , $ s p
move $ c c s , [ $ s p ]
subq 4 , $ s p
move $ s p c , [ $ s p ]
subq 4 , $ s p
move $ m o f , [ $ s p ]
subq 4 , $ s p
move $ s r s , [ $ s p ]
subq 4 , $ s p
move. d $ a c r , [ $ s p ]
subq 1 4 * 4 , $ s p ; Make room for R0-R13.
movem $ r13 , [ $ s p ] ; Push R0-R13.
subq 4 , $ s p
move. d $ r10 , [ $ s p ] ; Push orig_r10.
; Set S-bit when kernel debugging to keep hardware breakpoints active.
# ifdef C O N F I G _ E T R A X _ K G D B
move $ c c s , $ r0
or. d ( 1 < < 9 ) , $ r0
move $ r0 , $ c c s
# endif
jsr c r i s v32 _ d o _ m u l t i p l e
move. d $ s p , $ r10
jump r e t _ f r o m _ i n t r
nop
2010-08-02 20:05:17 +04:00
.size multiple_ i n t e r r u p t , . - m u l t i p l e _ i n t e r r u p t
2005-07-27 22:44:44 +04:00
do_sigtrap :
;; Sigtraps the process that executed the BREAK instruction. Creates a
;; frame that Rexit expects.
subq 4 , $ s p
move $ e d a , [ $ s p ]
subq 4 , $ s p
move $ e x s , [ $ s p ]
subq 4 , $ s p
move $ e r p , [ $ s p ]
subq 4 , $ s p
move $ s r p , [ $ s p ]
subq 4 , $ s p
move $ c c s , [ $ s p ]
subq 4 , $ s p
move $ s p c , [ $ s p ]
subq 4 , $ s p
move $ m o f , [ $ s p ]
subq 4 , $ s p
move $ s r s , [ $ s p ]
subq 4 , $ s p
move. d $ a c r , [ $ s p ]
di ; Need to disable irq's at this point.
subq 1 4 * 4 , $ s p ; Make room for r0-r13.
movem $ r13 , [ $ s p ] ; Push the r0-r13 registers.
subq 4 , $ s p
move. d $ r10 , [ $ s p ] ; Push orig_r10.
movs. w - 8 1 9 2 , $ r9 ; THREAD_SIZE == 8192
and. d $ s p , $ r9
;; thread_info as first parameter
move. d $ r9 , $ r10
moveq 5 , $ r11 ; SIGTRAP as second argument.
jsr u g d b _ t r a p _ u s e r
nop
jump r e t _ f r o m _ i n t r ; Use the return routine for interrupts.
nop
gdb_handle_exception :
subq 4 , $ s p
move. d $ r0 , [ $ s p ]
# ifdef C O N F I G _ E T R A X _ K G D B
move $ c c s , $ r0 ; U-flag not affected by previous insns.
btstq 1 6 , $ r0 ; Test the U-flag.
bmi _ u g d b _ h a n d l e _ e x c e p t i o n ; Go to user mode debugging.
nop ; Empty delay-slot (cannot pop R0 here).
ba k g d b _ h a n d l e _ e x c e p t i o n ; Go to kernel debugging.
move. d [ $ s p + ] , $ r0 ; Restore R0 in delay slot.
# endif
_ugdb_handle_exception :
ba d o _ s i g t r a p ; SIGTRAP the offending process.
move. d [ $ s p + ] , $ r0 ; Restore R0 in delay slot.
2007-11-30 17:44:07 +03:00
.global kernel_execve
2010-08-02 20:05:17 +04:00
.type kernel_ e x e c v e ,@function
2007-11-30 17:44:07 +03:00
kernel_execve :
move. d _ _ N R _ e x e c v e , $ r9
break 1 3
ret
nop
2010-08-02 20:05:17 +04:00
.size kernel_ e x e c v e , . - k e r n e l _ e x e c v e
2007-11-30 17:44:07 +03:00
2005-07-27 22:44:44 +04:00
.data
.section .rodata , " a"
sys_call_table :
.long sys_restart_syscall ; 0 - old "setup()" system call, used
; for restarting.
.long sys_exit
.long sys_fork
.long sys_read
.long sys_write
.long sys_open /* 5 */
.long sys_close
.long sys_waitpid
.long sys_creat
.long sys_link
.long sys_unlink /* 10 */
.long sys_execve
.long sys_chdir
.long sys_time
.long sys_mknod
.long sys_chmod /* 15 */
.long sys_lchown16
.long sys_ni_syscall /* old break syscall holder */
.long sys_stat
.long sys_lseek
.long sys_getpid /* 20 */
.long sys_mount
.long sys_oldumount
.long sys_setuid16
.long sys_getuid16
.long sys_stime /* 25 */
.long sys_ptrace
.long sys_alarm
.long sys_fstat
.long sys_pause
.long sys_utime /* 30 */
.long sys_ni_syscall /* old stty syscall holder */
.long sys_ni_syscall /* old gtty syscall holder */
.long sys_access
.long sys_nice
.long sys_ni_syscall /* 35 old ftime syscall holder */
.long sys_sync
.long sys_kill
.long sys_rename
.long sys_mkdir
.long sys_rmdir /* 40 */
.long sys_dup
.long sys_pipe
.long sys_times
.long sys_ni_syscall /* old prof syscall holder */
.long sys_brk /* 45 */
.long sys_setgid16
.long sys_getgid16
.long sys_signal
.long sys_geteuid16
.long sys_getegid16 /* 50 */
.long sys_acct
.long sys_umount /* recycled never used phys( */
.long sys_ni_syscall /* old lock syscall holder */
.long sys_ioctl
.long sys_fcntl /* 55 */
.long sys_ni_syscall /* old mpx syscall holder */
.long sys_setpgid
.long sys_ni_syscall /* old ulimit syscall holder */
.long sys_ni_syscall /* old sys_olduname holder */
.long sys_umask /* 60 */
.long sys_chroot
.long sys_ustat
.long sys_dup2
.long sys_getppid
.long sys_getpgrp /* 65 */
.long sys_setsid
.long sys_sigaction
.long sys_sgetmask
.long sys_ssetmask
.long sys_setreuid16 /* 70 */
.long sys_setregid16
.long sys_sigsuspend
.long sys_sigpending
.long sys_sethostname
.long sys_setrlimit /* 75 */
.long sys_old_getrlimit
.long sys_getrusage
.long sys_gettimeofday
.long sys_settimeofday
.long sys_getgroups16 /* 80 */
.long sys_setgroups16
.long sys_select /* was old_select in Linux/E100 */
.long sys_symlink
.long sys_lstat
.long sys_readlink /* 85 */
.long sys_uselib
.long sys_swapon
.long sys_reboot
2009-01-14 16:13:55 +03:00
.long sys_old_readdir
2010-03-11 02:21:15 +03:00
.long sys_old_mmap /* 90 */
2005-07-27 22:44:44 +04:00
.long sys_munmap
.long sys_truncate
.long sys_ftruncate
.long sys_fchmod
.long sys_fchown16 /* 95 */
.long sys_getpriority
.long sys_setpriority
.long sys_ni_syscall /* old profil syscall holder */
.long sys_statfs
.long sys_fstatfs /* 100 */
.long sys_ni_syscall /* sys_ioperm in i386 */
.long sys_socketcall
.long sys_syslog
.long sys_setitimer
.long sys_getitimer /* 105 */
.long sys_newstat
.long sys_newlstat
.long sys_newfstat
.long sys_ni_syscall /* old sys_uname holder */
.long sys_ni_syscall /* sys_iopl in i386 */
.long sys_vhangup
.long sys_ni_syscall /* old "idle" system call */
.long sys_ni_syscall /* vm86old in i386 */
.long sys_wait4
.long sys_swapoff /* 115 */
.long sys_sysinfo
.long sys_ipc
.long sys_fsync
.long sys_sigreturn
.long sys_clone /* 120 */
.long sys_setdomainname
.long sys_newuname
.long sys_ni_syscall /* sys_modify_ldt */
.long sys_adjtimex
.long sys_mprotect /* 125 */
.long sys_sigprocmask
.long sys_ni_syscall /* old "create_module" */
.long sys_init_module
.long sys_delete_module
.long sys_ni_syscall /* 130: old "get_kernel_syms" */
.long sys_quotactl
.long sys_getpgid
.long sys_fchdir
.long sys_bdflush
.long sys_sysfs /* 135 */
.long sys_personality
.long sys_ni_syscall /* for afs_syscall */
.long sys_setfsuid16
.long sys_setfsgid16
.long sys_llseek /* 140 */
.long sys_getdents
.long sys_select
.long sys_flock
.long sys_msync
.long sys_readv /* 145 */
.long sys_writev
.long sys_getsid
.long sys_fdatasync
.long sys_sysctl
.long sys_mlock /* 150 */
.long sys_munlock
.long sys_mlockall
.long sys_munlockall
.long sys_sched_setparam
.long sys_sched_getparam /* 155 */
.long sys_sched_setscheduler
.long sys_sched_getscheduler
.long sys_sched_yield
.long sys_sched_get_priority_max
.long sys_sched_get_priority_min /* 160 */
.long sys_sched_rr_get_interval
.long sys_nanosleep
.long sys_mremap
.long sys_setresuid16
.long sys_getresuid16 /* 165 */
.long sys_ni_syscall /* sys_vm86 */
.long sys_ni_syscall /* Old sys_query_module */
.long sys_poll
2011-08-27 02:03:11 +04:00
.long sys_ni_syscall /* Old nfsservctl */
2005-07-27 22:44:44 +04:00
.long sys_setresgid16 /* 170 */
.long sys_getresgid16
.long sys_prctl
.long sys_rt_sigreturn
.long sys_rt_sigaction
.long sys_rt_sigprocmask /* 175 */
.long sys_rt_sigpending
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
.long sys_rt_sigsuspend
.long sys_pread64 /* 180 */
.long sys_pwrite64
.long sys_chown16
.long sys_getcwd
.long sys_capget
.long sys_capset /* 185 */
.long sys_sigaltstack
.long sys_sendfile
.long sys_ni_syscall /* streams1 */
.long sys_ni_syscall /* streams2 */
.long sys_vfork /* 190 */
.long sys_getrlimit
.long sys_mmap2
.long sys_truncate64
.long sys_ftruncate64
.long sys_stat64 /* 195 */
.long sys_lstat64
.long sys_fstat64
.long sys_lchown
.long sys_getuid
.long sys_getgid /* 200 */
.long sys_geteuid
.long sys_getegid
.long sys_setreuid
.long sys_setregid
.long sys_getgroups /* 205 */
.long sys_setgroups
.long sys_fchown
.long sys_setresuid
.long sys_getresuid
.long sys_setresgid /* 210 */
.long sys_getresgid
.long sys_chown
.long sys_setuid
.long sys_setgid
.long sys_setfsuid /* 215 */
.long sys_setfsgid
.long sys_pivot_root
.long sys_mincore
.long sys_madvise
.long sys_getdents64 /* 220 */
.long sys_fcntl64
.long sys_ni_syscall /* reserved for TUX */
.long sys_ni_syscall
.long sys_gettid
.long sys_readahead /* 225 */
.long sys_setxattr
.long sys_lsetxattr
.long sys_fsetxattr
.long sys_getxattr
.long sys_lgetxattr /* 230 */
.long sys_fgetxattr
.long sys_listxattr
.long sys_llistxattr
.long sys_flistxattr
.long sys_removexattr /* 235 */
.long sys_lremovexattr
.long sys_fremovexattr
.long sys_tkill
.long sys_sendfile64
.long sys_futex /* 240 */
.long sys_sched_setaffinity
.long sys_sched_getaffinity
.long sys_ni_syscall /* sys_set_thread_area */
.long sys_ni_syscall /* sys_get_thread_area */
.long sys_io_setup /* 245 */
.long sys_io_destroy
.long sys_io_getevents
.long sys_io_submit
.long sys_io_cancel
.long sys_fadvise64 /* 250 */
.long sys_ni_syscall
.long sys_exit_group
.long sys_lookup_dcookie
.long sys_epoll_create
.long sys_epoll_ctl /* 255 */
.long sys_epoll_wait
.long sys_remap_file_pages
2007-11-30 17:44:07 +03:00
.long sys_set_tid_address
.long sys_timer_create
.long sys_timer_settime /* 260 */
.long sys_timer_gettime
.long sys_timer_getoverrun
.long sys_timer_delete
.long sys_clock_settime
.long sys_clock_gettime /* 265 */
.long sys_clock_getres
.long sys_clock_nanosleep
2005-07-27 22:44:44 +04:00
.long sys_statfs64
.long sys_fstatfs64
.long sys_tgkill /* 270 */
.long sys_utimes
2007-11-30 17:44:07 +03:00
.long sys_fadvise64_64
2005-07-27 22:44:44 +04:00
.long sys_ni_syscall /* sys_vserver */
.long sys_ni_syscall /* sys_mbind */
.long sys_ni_syscall /* 275 sys_get_mempolicy */
.long sys_ni_syscall /* sys_set_mempolicy */
.long sys_mq_open
.long sys_mq_unlink
.long sys_mq_timedsend
.long sys_mq_timedreceive /* 280 */
.long sys_mq_notify
.long sys_mq_getsetattr
.long sys_ni_syscall /* reserved for kexec */
.long sys_waitid
2007-11-30 17:44:07 +03:00
.long sys_ni_syscall /* 285 */ /* available */
.long sys_add_key
.long sys_request_key
.long sys_keyctl
.long sys_ioprio_set
.long sys_ioprio_get /* 290 */
.long sys_inotify_init
.long sys_inotify_add_watch
.long sys_inotify_rm_watch
.long sys_migrate_pages
.long sys_openat /* 295 */
.long sys_mkdirat
.long sys_mknodat
.long sys_fchownat
.long sys_futimesat
.long sys_fstatat64 /* 300 */
.long sys_unlinkat
.long sys_renameat
.long sys_linkat
.long sys_symlinkat
.long sys_readlinkat /* 305 */
.long sys_fchmodat
.long sys_faccessat
.long sys_pselect6
.long sys_ppoll
.long sys_unshare /* 310 */
.long sys_set_robust_list
.long sys_get_robust_list
.long sys_splice
.long sys_sync_file_range
.long sys_tee /* 315 */
.long sys_vmsplice
.long sys_move_pages
.long sys_getcpu
.long sys_epoll_pwait
.long sys_utimensat /* 320 */
.long sys_signalfd
2008-02-08 13:54:30 +03:00
.long sys_timerfd_create
2007-11-30 17:44:07 +03:00
.long sys_eventfd
.long sys_fallocate
2008-02-08 13:54:30 +03:00
.long sys_timerfd_settime /* 325 */
.long sys_timerfd_gettime
2009-04-28 18:42:39 +04:00
.long sys_signalfd4
.long sys_eventfd2
.long sys_epoll_create1
.long sys_dup3 /* 330 */
.long sys_pipe2
.long sys_inotify_init1
.long sys_preadv
.long sys_pwritev
2011-05-28 06:28:27 +04:00
.long sys_setns /* 335 */
2005-07-27 22:44:44 +04:00
/ *
* NOTE! ! T h i s d o e s n ' t h a v e t o b e e x a c t - w e j u s t h a v e
* to m a k e s u r e w e h a v e _ e n o u g h _ o f t h e " s y s _ n i _ s y s c a l l "
* entries. D o n ' t p a n i c i f y o u n o t i c e t h a t t h i s h a s n ' t
* been s h r u n k e v e r y t i m e w e a d d a n e w s y s t e m c a l l .
* /
.rept NR_syscalls - ( . - sys_ c a l l _ t a b l e ) / 4
.long sys_ni_syscall
.endr