2009-03-27 16:25:20 +03:00
/ *
* Copyright ( C ) 2 0 0 7 - 2 0 0 9 M i c h a l S i m e k < m o n s t r @monstr.eu>
* Copyright ( C ) 2 0 0 7 - 2 0 0 9 P e t a L o g i x
* Copyright ( C ) 2 0 0 6 A t m a r k T e c h n o , I n c .
*
* 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 .
* /
# include < l i n u x / l i n k a g e . h >
# include < a s m / t h r e a d _ i n f o . h >
2009-05-26 18:30:26 +04:00
# include < l i n u x / e r r n o . h >
2009-03-27 16:25:20 +03:00
# include < a s m / e n t r y . h >
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / r e g i s t e r s . h >
# include < a s m / u n i s t d . h >
# include < a s m / p e r c p u . h >
# include < a s m / s i g n a l . h >
# if C O N F I G _ X I L I N X _ M I C R O B L A Z E 0 _ U S E _ M S R _ I N S T R
.macro disable_irq
msrclr r0 , M S R _ I E
.endm
.macro enable_irq
msrset r0 , M S R _ I E
.endm
.macro clear_bip
msrclr r0 , M S R _ B I P
.endm
# else
.macro disable_irq
mfs r11 , r m s r
andi r11 , r11 , ~ M S R _ I E
mts r m s r , r11
.endm
.macro enable_irq
mfs r11 , r m s r
ori r11 , r11 , M S R _ I E
mts r m s r , r11
.endm
.macro clear_bip
mfs r11 , r m s r
andi r11 , r11 , ~ M S R _ B I P
mts r m s r , r11
.endm
# endif
ENTRY( _ i n t e r r u p t )
swi r1 , r0 , P E R _ C P U ( E N T R Y _ S P ) / * s a v e t h e c u r r e n t s p * /
swi r11 , r0 , P E R _ C P U ( R 1 1 _ S A V E ) / * t e m p o r a r i l y s a v e r11 * /
lwi r11 , r0 , P E R _ C P U ( K M ) / * l o a d m o d e i n d i c a t o r * /
beqid r11 , 1 f
nop
brid 2 f / * j u m p o v e r * /
addik r1 , r1 , ( - P T _ S I Z E ) / * r o o m f o r p t _ r e g s ( d e l a y s l o t ) * /
1 : /* switch to kernel stack */
lwi r1 , r0 , P E R _ C P U ( C U R R E N T _ S A V E ) / * g e t t h e s a v e d c u r r e n t * /
lwi r1 , r1 , T S _ T H R E A D _ I N F O / * g e t t h e t h r e a d i n f o * /
/* calculate kernel stack pointer */
addik r1 , r1 , T H R E A D _ S I Z E - P T _ S I Z E
2 :
swi r11 , r1 , P T _ M O D E / * s t o r e t h e m o d e * /
lwi r11 , r0 , P E R _ C P U ( R 1 1 _ S A V E ) / * r e l o a d r11 * /
swi r2 , r1 , P T _ R 2
swi r3 , r1 , P T _ R 3
swi r4 , r1 , P T _ R 4
swi r5 , r1 , P T _ R 5
swi r6 , r1 , P T _ R 6
swi r7 , r1 , P T _ R 7
swi r8 , r1 , P T _ R 8
swi r9 , r1 , P T _ R 9
swi r10 , r1 , P T _ R 1 0
swi r11 , r1 , P T _ R 1 1
swi r12 , r1 , P T _ R 1 2
swi r13 , r1 , P T _ R 1 3
swi r14 , r1 , P T _ R 1 4
swi r14 , r1 , P T _ P C
swi r15 , r1 , P T _ R 1 5
swi r16 , r1 , P T _ R 1 6
swi r17 , r1 , P T _ R 1 7
swi r18 , r1 , P T _ R 1 8
swi r19 , r1 , P T _ R 1 9
swi r20 , r1 , P T _ R 2 0
swi r21 , r1 , P T _ R 2 1
swi r22 , r1 , P T _ R 2 2
swi r23 , r1 , P T _ R 2 3
swi r24 , r1 , P T _ R 2 4
swi r25 , r1 , P T _ R 2 5
swi r26 , r1 , P T _ R 2 6
swi r27 , r1 , P T _ R 2 7
swi r28 , r1 , P T _ R 2 8
swi r29 , r1 , P T _ R 2 9
swi r30 , r1 , P T _ R 3 0
swi r31 , r1 , P T _ R 3 1
/* special purpose registers */
mfs r11 , r m s r
swi r11 , r1 , P T _ M S R
mfs r11 , r e a r
swi r11 , r1 , P T _ E A R
mfs r11 , r e s r
swi r11 , r1 , P T _ E S R
mfs r11 , r f s r
swi r11 , r1 , P T _ F S R
/* reload original stack pointer and save it */
lwi r11 , r0 , P E R _ C P U ( E N T R Y _ S P )
swi r11 , r1 , P T _ R 1
/* update mode indicator we are in kernel mode */
addik r11 , r0 , 1
swi r11 , r0 , P E R _ C P U ( K M )
/* restore r31 */
lwi r31 , r0 , P E R _ C P U ( C U R R E N T _ S A V E )
/* prepare the link register, the argument and jump */
la r15 , r0 , r e t _ f r o m _ i n t r - 8
addk r6 , r0 , r15
braid d o _ I R Q
add r5 , r0 , r1
ret_from_intr :
lwi r11 , r1 , P T _ M O D E
bneid r11 , 3 f
lwi r6 , r31 , T S _ T H R E A D _ I N F O / * g e t t h r e a d i n f o * /
lwi r19 , r6 , T I _ F L A G S / * g e t f l a g s i n t h r e a d i n f o * /
/* do an extra work if any bits are set */
andi r11 , r19 , _ T I F _ N E E D _ R E S C H E D
beqi r11 , 1 f
bralid r15 , s c h e d u l e
nop
1 : andi r11 , r19 , _ T I F _ S I G P E N D I N G
beqid r11 , n o _ i n t r _ r e s h e d
addk r5 , r1 , r0
addk r7 , r0 , r0
bralid r15 , d o _ s i g n a l
addk r6 , r0 , r0
no_intr_reshed :
/* save mode indicator */
lwi r11 , r1 , P T _ M O D E
3 :
swi r11 , r0 , P E R _ C P U ( K M )
/* save r31 */
swi r31 , r0 , P E R _ C P U ( C U R R E N T _ S A V E )
restore_context :
/* special purpose registers */
lwi r11 , r1 , P T _ F S R
mts r f s r , r11
lwi r11 , r1 , P T _ E S R
mts r e s r , r11
lwi r11 , r1 , P T _ E A R
mts r e a r , r11
lwi r11 , r1 , P T _ M S R
mts r m s r , r11
lwi r31 , r1 , P T _ R 3 1
lwi r30 , r1 , P T _ R 3 0
lwi r29 , r1 , P T _ R 2 9
lwi r28 , r1 , P T _ R 2 8
lwi r27 , r1 , P T _ R 2 7
lwi r26 , r1 , P T _ R 2 6
lwi r25 , r1 , P T _ R 2 5
lwi r24 , r1 , P T _ R 2 4
lwi r23 , r1 , P T _ R 2 3
lwi r22 , r1 , P T _ R 2 2
lwi r21 , r1 , P T _ R 2 1
lwi r20 , r1 , P T _ R 2 0
lwi r19 , r1 , P T _ R 1 9
lwi r18 , r1 , P T _ R 1 8
lwi r17 , r1 , P T _ R 1 7
lwi r16 , r1 , P T _ R 1 6
lwi r15 , r1 , P T _ R 1 5
lwi r14 , r1 , P T _ P C
lwi r13 , r1 , P T _ R 1 3
lwi r12 , r1 , P T _ R 1 2
lwi r11 , r1 , P T _ R 1 1
lwi r10 , r1 , P T _ R 1 0
lwi r9 , r1 , P T _ R 9
lwi r8 , r1 , P T _ R 8
lwi r7 , r1 , P T _ R 7
lwi r6 , r1 , P T _ R 6
lwi r5 , r1 , P T _ R 5
lwi r4 , r1 , P T _ R 4
lwi r3 , r1 , P T _ R 3
lwi r2 , r1 , P T _ R 2
lwi r1 , r1 , P T _ R 1
rtid r14 , 0
nop
ENTRY( _ r e s e t )
brai 0 ;
ENTRY( _ u s e r _ e x c e p t i o n )
swi r1 , r0 , P E R _ C P U ( E N T R Y _ S P ) / * s a v e t h e c u r r e n t s p * /
swi r11 , r0 , P E R _ C P U ( R 1 1 _ S A V E ) / * t e m p o r a r i l y s a v e r11 * /
lwi r11 , r0 , P E R _ C P U ( K M ) / * l o a d m o d e i n d i c a t o r * /
beqid r11 , 1 f / * A l r e a d y i n k e r n e l m o d e ? * /
nop
brid 2 f / * j u m p o v e r * /
addik r1 , r1 , ( - P T _ S I Z E ) / * R o o m f o r p t _ r e g s ( d e l a y s l o t ) * /
1 : /* Switch to kernel stack */
lwi r1 , r0 , P E R _ C P U ( C U R R E N T _ S A V E ) / * g e t t h e s a v e d c u r r e n t * /
lwi r1 , r1 , T S _ T H R E A D _ I N F O / * g e t t h e t h r e a d i n f o * /
/* calculate kernel stack pointer */
addik r1 , r1 , T H R E A D _ S I Z E - P T _ S I Z E
swi r11 , r0 , P E R _ C P U ( R 1 1 _ S A V E ) / * t e m p o r a r i l y s a v e r11 * /
lwi r11 , r0 , P E R _ C P U ( K M ) / * l o a d m o d e i n d i c a t o r * /
2 :
swi r11 , r1 , P T _ M O D E / * s t o r e t h e m o d e * /
lwi r11 , r0 , P E R _ C P U ( R 1 1 _ S A V E ) / * r e l o a d r11 * /
/* save them on stack */
swi r2 , r1 , P T _ R 2
swi r3 , r1 , P T _ R 3 / * r3 : _ a l w a y s _ i n c l o b b e r l i s t ; see unistd.h */
swi r4 , r1 , P T _ R 4 / * r4 : _ a l w a y s _ i n c l o b b e r l i s t ; see unistd.h */
swi r5 , r1 , P T _ R 5
swi r6 , r1 , P T _ R 6
swi r7 , r1 , P T _ R 7
swi r8 , r1 , P T _ R 8
swi r9 , r1 , P T _ R 9
swi r10 , r1 , P T _ R 1 0
swi r11 , r1 , P T _ R 1 1
/* r12: _always_ in clobber list; see unistd.h */
swi r12 , r1 , P T _ R 1 2
swi r13 , r1 , P T _ R 1 3
/* r14: _always_ in clobber list; see unistd.h */
swi r14 , r1 , P T _ R 1 4
/* but we want to return to the next inst. */
addik r14 , r14 , 0 x4
swi r14 , r1 , P T _ P C / * i n c r e m e n t b y 4 a n d s t o r e i n p c * /
swi r15 , r1 , P T _ R 1 5
swi r16 , r1 , P T _ R 1 6
swi r17 , r1 , P T _ R 1 7
swi r18 , r1 , P T _ R 1 8
swi r19 , r1 , P T _ R 1 9
swi r20 , r1 , P T _ R 2 0
swi r21 , r1 , P T _ R 2 1
swi r22 , r1 , P T _ R 2 2
swi r23 , r1 , P T _ R 2 3
swi r24 , r1 , P T _ R 2 4
swi r25 , r1 , P T _ R 2 5
swi r26 , r1 , P T _ R 2 6
swi r27 , r1 , P T _ R 2 7
swi r28 , r1 , P T _ R 2 8
swi r29 , r1 , P T _ R 2 9
swi r30 , r1 , P T _ R 3 0
swi r31 , r1 , P T _ R 3 1
disable_ i r q
nop / * m a k e s u r e I E b i t i s i n e f f e c t * /
clear_ b i p / * o n c e I E i s i n e f f e c t i t i s s a f e t o c l e a r B I P * /
nop
/* special purpose registers */
mfs r11 , r m s r
swi r11 , r1 , P T _ M S R
mfs r11 , r e a r
swi r11 , r1 , P T _ E A R
mfs r11 , r e s r
swi r11 , r1 , P T _ E S R
mfs r11 , r f s r
swi r11 , r1 , P T _ F S R
/* reload original stack pointer and save it */
lwi r11 , r0 , P E R _ C P U ( E N T R Y _ S P )
swi r11 , r1 , P T _ R 1
/* update mode indicator we are in kernel mode */
addik r11 , r0 , 1
swi r11 , r0 , P E R _ C P U ( K M )
/* restore r31 */
lwi r31 , r0 , P E R _ C P U ( C U R R E N T _ S A V E )
/* re-enable interrupts now we are in kernel mode */
enable_ i r q
/* See if the system call number is valid. */
addi r11 , r12 , - _ _ N R _ s y s c a l l s
bgei r11 , 1 f / * r e t u r n t o u s e r i f n o t v a l i d * /
/* Figure out which function to use for this system call. */
/* Note Microblaze barrel shift is optional, so don't rely on it */
add r12 , r12 , r12 / * c o n v e r t n u m - > p t r * /
add r12 , r12 , r12
lwi r12 , r12 , s y s _ c a l l _ t a b l e / * G e t f u n c t i o n p o i n t e r * /
la r15 , r0 , r e t _ t o _ u s e r - 8 / * s e t r e t u r n a d d r e s s * /
bra r12 / * M a k e t h e s y s t e m c a l l . * /
bri 0 / * w o n ' t r e a c h h e r e * /
1 :
brid r e t _ t o _ u s e r / * j u m p t o s y s c a l l e p i l o g u e * /
addi r3 , r0 , - E N O S Y S / * s e t e r r n o i n d e l a y s l o t * /
/ *
* Debug t r a p s a r e l i k e a s y s t e m c a l l , b u t e n t e r e d v i a b r k i r14 , 0 x60
* All w e n e e d t o d o i s s e n d t h e S I G T R A P s i g n a l t o c u r r e n t , p t r a c e a n d d o _ s i g n a l
* will h a n d l e t h e r e s t
* /
ENTRY( _ d e b u g _ e x c e p t i o n )
swi r1 , r0 , P E R _ C P U ( E N T R Y _ S P ) / * s a v e t h e c u r r e n t s p * /
lwi r1 , r0 , P E R _ C P U ( C U R R E N T _ S A V E ) / * g e t t h e s a v e d c u r r e n t * /
lwi r1 , r1 , T S _ T H R E A D _ I N F O / * g e t t h e t h r e a d i n f o * /
addik r1 , r1 , T H R E A D _ S I Z E - P T _ S I Z E / * g e t t h e k e r n e l s t a c k * /
swi r11 , r0 , P E R _ C P U ( R 1 1 _ S A V E ) / * t e m p o r a r i l y s a v e r11 * /
lwi r11 , r0 , P E R _ C P U ( K M ) / * l o a d m o d e i n d i c a t o r * /
/ / save_context :
swi r11 , r1 , P T _ M O D E / * s t o r e t h e m o d e * /
lwi r11 , r0 , P E R _ C P U ( R 1 1 _ S A V E ) / * r e l o a d r11 * /
/* save them on stack */
swi r2 , r1 , P T _ R 2
swi r3 , r1 , P T _ R 3 / * r3 : _ a l w a y s _ i n c l o b b e r l i s t ; see unistd.h */
swi r4 , r1 , P T _ R 4 / * r4 : _ a l w a y s _ i n c l o b b e r l i s t ; see unistd.h */
swi r5 , r1 , P T _ R 5
swi r6 , r1 , P T _ R 6
swi r7 , r1 , P T _ R 7
swi r8 , r1 , P T _ R 8
swi r9 , r1 , P T _ R 9
swi r10 , r1 , P T _ R 1 0
swi r11 , r1 , P T _ R 1 1
/* r12: _always_ in clobber list; see unistd.h */
swi r12 , r1 , P T _ R 1 2
swi r13 , r1 , P T _ R 1 3
/* r14: _always_ in clobber list; see unistd.h */
swi r14 , r1 , P T _ R 1 4
swi r14 , r1 , P T _ P C / * W i l l r e t u r n t o i n t e r r u p t e d i n s t r u c t i o n * /
swi r15 , r1 , P T _ R 1 5
swi r16 , r1 , P T _ R 1 6
swi r17 , r1 , P T _ R 1 7
swi r18 , r1 , P T _ R 1 8
swi r19 , r1 , P T _ R 1 9
swi r20 , r1 , P T _ R 2 0
swi r21 , r1 , P T _ R 2 1
swi r22 , r1 , P T _ R 2 2
swi r23 , r1 , P T _ R 2 3
swi r24 , r1 , P T _ R 2 4
swi r25 , r1 , P T _ R 2 5
swi r26 , r1 , P T _ R 2 6
swi r27 , r1 , P T _ R 2 7
swi r28 , r1 , P T _ R 2 8
swi r29 , r1 , P T _ R 2 9
swi r30 , r1 , P T _ R 3 0
swi r31 , r1 , P T _ R 3 1
disable_ i r q
nop / * m a k e s u r e I E b i t i s i n e f f e c t * /
clear_ b i p / * o n c e I E i s i n e f f e c t i t i s s a f e t o c l e a r B I P * /
nop
/* special purpose registers */
mfs r11 , r m s r
swi r11 , r1 , P T _ M S R
mfs r11 , r e a r
swi r11 , r1 , P T _ E A R
mfs r11 , r e s r
swi r11 , r1 , P T _ E S R
mfs r11 , r f s r
swi r11 , r1 , P T _ F S R
/* reload original stack pointer and save it */
lwi r11 , r0 , P E R _ C P U ( E N T R Y _ S P )
swi r11 , r1 , P T _ R 1
/* update mode indicator we are in kernel mode */
addik r11 , r0 , 1
swi r11 , r0 , P E R _ C P U ( K M )
/* restore r31 */
lwi r31 , r0 , P E R _ C P U ( C U R R E N T _ S A V E )
/* re-enable interrupts now we are in kernel mode */
enable_ i r q
addi r5 , r0 , S I G T R A P / * s e n d i n g t h e t r a p s i g n a l * /
add r6 , r0 , r31 / * t o c u r r e n t * /
bralid r15 , s e n d _ s i g
add r7 , r0 , r0 / * 3 r d p a r a m z e r o * /
/* Restore r3/r4 to work around how ret_to_user works */
lwi r3 , r1 , P T _ R 3
lwi r4 , r1 , P T _ R 4
bri r e t _ t o _ u s e r
ENTRY( _ b r e a k )
bri 0
/ * struct t a s k _ s t r u c t * _ s w i t c h _ t o ( s t r u c t t h r e a d _ i n f o * p r e v ,
struct t h r e a d _ i n f o * n e x t ) ; */
ENTRY( _ s w i t c h _ t o )
/* prepare return value */
addk r3 , r0 , r31
/* save registers in cpu_context */
/* use r11 and r12, volatile registers, as temp register */
addik r11 , r5 , T I _ C P U _ C O N T E X T
swi r1 , r11 , C C _ R 1
swi r2 , r11 , C C _ R 2
/ * skip v o l a t i l e r e g i s t e r s .
* they a r e s a v e d o n s t a c k w h e n w e j u m p e d t o _ s w i t c h _ t o ( ) * /
/* dedicated registers */
swi r13 , r11 , C C _ R 1 3
swi r14 , r11 , C C _ R 1 4
swi r15 , r11 , C C _ R 1 5
swi r16 , r11 , C C _ R 1 6
swi r17 , r11 , C C _ R 1 7
swi r18 , r11 , C C _ R 1 8
/* save non-volatile registers */
swi r19 , r11 , C C _ R 1 9
swi r20 , r11 , C C _ R 2 0
swi r21 , r11 , C C _ R 2 1
swi r22 , r11 , C C _ R 2 2
swi r23 , r11 , C C _ R 2 3
swi r24 , r11 , C C _ R 2 4
swi r25 , r11 , C C _ R 2 5
swi r26 , r11 , C C _ R 2 6
swi r27 , r11 , C C _ R 2 7
swi r28 , r11 , C C _ R 2 8
swi r29 , r11 , C C _ R 2 9
swi r30 , r11 , C C _ R 3 0
/* special purpose registers */
mfs r12 , r m s r
swi r12 , r11 , C C _ M S R
mfs r12 , r e a r
swi r12 , r11 , C C _ E A R
mfs r12 , r e s r
swi r12 , r11 , C C _ E S R
mfs r12 , r f s r
swi r12 , r11 , C C _ F S R
/* update r31, the current */
lwi r31 , r6 , T I _ T A S K
swi r31 , r0 , P E R _ C P U ( C U R R E N T _ S A V E )
/* get new process' cpu context and restore */
addik r11 , r6 , T I _ C P U _ C O N T E X T
/* special purpose registers */
lwi r12 , r11 , C C _ F S R
mts r f s r , r12
lwi r12 , r11 , C C _ E S R
mts r e s r , r12
lwi r12 , r11 , C C _ E A R
mts r e a r , r12
lwi r12 , r11 , C C _ M S R
mts r m s r , r12
/* non-volatile registers */
lwi r30 , r11 , C C _ R 3 0
lwi r29 , r11 , C C _ R 2 9
lwi r28 , r11 , C C _ R 2 8
lwi r27 , r11 , C C _ R 2 7
lwi r26 , r11 , C C _ R 2 6
lwi r25 , r11 , C C _ R 2 5
lwi r24 , r11 , C C _ R 2 4
lwi r23 , r11 , C C _ R 2 3
lwi r22 , r11 , C C _ R 2 2
lwi r21 , r11 , C C _ R 2 1
lwi r20 , r11 , C C _ R 2 0
lwi r19 , r11 , C C _ R 1 9
/* dedicated registers */
lwi r18 , r11 , C C _ R 1 8
lwi r17 , r11 , C C _ R 1 7
lwi r16 , r11 , C C _ R 1 6
lwi r15 , r11 , C C _ R 1 5
lwi r14 , r11 , C C _ R 1 4
lwi r13 , r11 , C C _ R 1 3
/* skip volatile registers */
lwi r2 , r11 , C C _ R 2
lwi r1 , r11 , C C _ R 1
rtsd r15 , 8
nop
ENTRY( r e t _ f r o m _ f o r k )
addk r5 , r0 , r3
addk r6 , r0 , r1
brlid r15 , s c h e d u l e _ t a i l
nop
swi r31 , r1 , P T _ R 3 1 / * s a v e r31 i n u s e r c o n t e x t . * /
/* will soon be restored to r31 in ret_to_user */
addk r3 , r0 , r0
brid r e t _ t o _ u s e r
nop
work_pending :
andi r11 , r19 , _ T I F _ N E E D _ R E S C H E D
beqi r11 , 1 f
bralid r15 , s c h e d u l e
nop
1 : andi r11 , r19 , _ T I F _ S I G P E N D I N G
beqi r11 , n o _ w o r k _ p e n d i n g
addk r5 , r1 , r0
addik r7 , r0 , 1
bralid r15 , d o _ s i g n a l
addk r6 , r0 , r0
bri n o _ w o r k _ p e n d i n g
ENTRY( r e t _ t o _ u s e r )
disable_ i r q
swi r4 , r1 , P T _ R 4 / * r e t u r n v a l * /
swi r3 , r1 , P T _ R 3 / * r e t u r n v a l * /
lwi r6 , r31 , T S _ T H R E A D _ I N F O / * g e t t h r e a d i n f o * /
lwi r19 , r6 , T I _ F L A G S / * g e t f l a g s i n t h r e a d i n f o * /
bnei r19 , w o r k _ p e n d i n g / * d o a n e x t r a w o r k i f a n y b i t s a r e s e t * /
no_work_pending :
disable_ i r q
/* save r31 */
swi r31 , r0 , P E R _ C P U ( C U R R E N T _ S A V E )
/* save mode indicator */
lwi r18 , r1 , P T _ M O D E
swi r18 , r0 , P E R _ C P U ( K M )
/ / restore_context :
/* special purpose registers */
lwi r18 , r1 , P T _ F S R
mts r f s r , r18
lwi r18 , r1 , P T _ E S R
mts r e s r , r18
lwi r18 , r1 , P T _ E A R
mts r e a r , r18
lwi r18 , r1 , P T _ M S R
mts r m s r , r18
lwi r31 , r1 , P T _ R 3 1
lwi r30 , r1 , P T _ R 3 0
lwi r29 , r1 , P T _ R 2 9
lwi r28 , r1 , P T _ R 2 8
lwi r27 , r1 , P T _ R 2 7
lwi r26 , r1 , P T _ R 2 6
lwi r25 , r1 , P T _ R 2 5
lwi r24 , r1 , P T _ R 2 4
lwi r23 , r1 , P T _ R 2 3
lwi r22 , r1 , P T _ R 2 2
lwi r21 , r1 , P T _ R 2 1
lwi r20 , r1 , P T _ R 2 0
lwi r19 , r1 , P T _ R 1 9
lwi r18 , r1 , P T _ R 1 8
lwi r17 , r1 , P T _ R 1 7
lwi r16 , r1 , P T _ R 1 6
lwi r15 , r1 , P T _ R 1 5
lwi r14 , r1 , P T _ P C
lwi r13 , r1 , P T _ R 1 3
lwi r12 , r1 , P T _ R 1 2
lwi r11 , r1 , P T _ R 1 1
lwi r10 , r1 , P T _ R 1 0
lwi r9 , r1 , P T _ R 9
lwi r8 , r1 , P T _ R 8
lwi r7 , r1 , P T _ R 7
lwi r6 , r1 , P T _ R 6
lwi r5 , r1 , P T _ R 5
lwi r4 , r1 , P T _ R 4 / * r e t u r n v a l * /
lwi r3 , r1 , P T _ R 3 / * r e t u r n v a l * /
lwi r2 , r1 , P T _ R 2
lwi r1 , r1 , P T _ R 1
rtid r14 , 0
nop
2009-06-18 21:55:30 +04:00
sys_vfork :
brid m i c r o b l a z e _ v f o r k
2009-03-27 16:25:20 +03:00
addk r5 , r1 , r0
2009-06-18 21:55:30 +04:00
sys_clone :
brid m i c r o b l a z e _ c l o n e
2009-03-27 16:25:20 +03:00
addk r7 , r1 , r0
2009-06-18 21:55:30 +04:00
sys_execve :
brid m i c r o b l a z e _ e x e c v e
2009-03-27 16:25:20 +03:00
addk r8 , r1 , r0
sys_rt_sigreturn_wrapper :
brid s y s _ r t _ s i g r e t u r n
addk r5 , r1 , r0
sys_rt_sigsuspend_wrapper :
brid s y s _ r t _ s i g s u s p e n d
addk r7 , r1 , r0
/* Interrupt vector table */
.section .init .ivt , " ax"
.org 0x0
brai _ r e s e t
brai _ u s e r _ e x c e p t i o n
brai _ i n t e r r u p t
brai _ b r e a k
brai _ h w _ e x c e p t i o n _ h a n d l e r
.org 0x60
brai _ d e b u g _ e x c e p t i o n
.section .rodata , " a"
# include " s y s c a l l _ t a b l e . S "
syscall_ t a b l e _ s i z e = ( . - s y s _ c a l l _ t a b l e )