2010-10-27 17:28:55 +01:00
/ * SMP I P I l o w - l e v e l h a n d l e r
*
* Copyright ( C ) 2 0 0 6 - 2 0 0 7 M a t s u s h i t a E l e c t r i c I n d u s t r i a l C o . , L t d .
* All R i g h t s R e s e r v e d .
*
* 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 i t 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
* as p u b l i s h e d 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 ; either version
* 2 of t h e L i c e n s e , o r ( a t y o u r o p t i o n ) a n y l a t e r v e r s i o n .
*
* /
# include < l i n u x / s y s . h >
# include < l i n u x / l i n k a g e . h >
# include < a s m / s m p . h >
# include < a s m / t h r e a d _ i n f o . h >
# include < a s m / c p u - r e g s . h >
2012-03-28 18:30:02 +01:00
# include < a s m / i n t c t l - r e g s . h >
2010-10-27 17:28:55 +01:00
# include < p r o c / s m p - r e g s . h >
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / f r a m e . i n c >
.am33_2
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# IPI i n t e r r u p t h a n d l e r
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
.globl mn10300_low_ipi_handler
mn10300_low_ipi_handler :
add - 4 ,s p
mov d0 ,( s p )
movhu ( I A G R ) ,d0
and I A G R _ G N ,d0
lsr 0 x2 ,d0
# ifdef C O N F I G _ M N 1 0 3 0 0 _ C A C H E _ E N A B L E D
cmp F L U S H _ C A C H E _ I P I ,d0
beq m n 1 0 3 0 0 _ f l u s h _ c a c h e _ i p i
# endif
cmp S M P _ B O O T _ I R Q ,d0
beq m n 1 0 3 0 0 _ s m p _ b o o t _ i p i
/* OTHERS */
mov ( s p ) ,d0
add 4 ,s p
# ifdef C O N F I G _ G D B S T U B
jmp g d b s t u b _ i o _ r x _ h a n d l e r
# else
jmp e n d
# endif
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Cache f l u s h I P I i n t e r r u p t h a n d l e r
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# ifdef C O N F I G _ M N 1 0 3 0 0 _ C A C H E _ E N A B L E D
mn10300_flush_cache_ipi :
mov ( s p ) ,d0
add 4 ,s p
/* FLUSH_CACHE_IPI */
add - 4 ,s p
SAVE_ A L L
mov G x I C R _ D E T E C T ,d2
movbu d2 ,( G x I C R ( F L U S H _ C A C H E _ I P I ) ) # A C K t h e i n t e r r u p t
movhu ( G x I C R ( F L U S H _ C A C H E _ I P I ) ) ,d2
call s m p _ c a c h e _ i n t e r r u p t [ ] ,0
RESTORE_ A L L
jmp e n d
# endif
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# SMP b o o t C P U I P I i n t e r r u p t h a n d l e r
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
mn10300_smp_boot_ipi :
/* clear interrupt */
movhu ( G x I C R ( S M P _ B O O T _ I R Q ) ) ,d0
and ~ G x I C R _ R E Q U E S T ,d0
movhu d0 ,( G x I C R ( S M P _ B O O T _ I R Q ) )
mov ( s p ) ,d0
add 4 ,s p
# get s t a c k
mov ( C P U I D ) ,a0
add - 1 ,a0
add a0 ,a0
add a0 ,a0
mov ( s t a r t _ s t a c k ,a0 ) ,a0
mov a0 ,s p
jmp i n i t i a l i z e _ s e c o n d a r y
# Jump h e r e a f t e r R T I t o s u p p r e s s t h e i c a c h e l o o k a h e a d
end :