2008-05-19 16:53:02 -07:00
/ *
2005-04-16 15:20:36 -07:00
* head. S : T h e i n i t i a l b o o t c o d e f o r t h e S p a r c p o r t o f L i n u x .
*
* Copyright ( C ) 1 9 9 5 D a v i d S . M i l l e r ( d a v e m @caip.rutgers.edu)
* Copyright ( C ) 1 9 9 5 ,1 9 9 9 P e t e Z a i t c e v ( z a i t c e v @yahoo.com)
* Copyright ( C ) 1 9 9 6 M i g u e l d e I c a z a ( m i g u e l @nuclecu.unam.mx)
* Copyright ( C ) 1 9 9 7 J a k u b J e l i n e k ( j j @sunsite.mff.cuni.cz)
* Copyright ( C ) 1 9 9 7 M i c h a e l A . G r i f f i t h ( g r i f @acm.org)
*
* CompactPCI p l a t f o r m b y E r i c B r o w e r , 1 9 9 9 .
* /
# include < l i n u x / v e r s i o n . h >
# include < l i n u x / i n i t . h >
# include < a s m / h e a d . h >
# include < a s m / a s i . h >
# include < a s m / c o n t r e g s . h >
# include < a s m / p t r a c e . h >
# include < a s m / p s r . h >
# include < a s m / p a g e . h >
2007-05-14 03:22:08 -07:00
# include < a s m / k d e b u g . h >
2005-04-16 15:20:36 -07:00
# include < a s m / w i n m a c r o . h >
# include < a s m / t h r e a d _ i n f o . h > / * T I _ U W I N M A S K * /
# include < a s m / e r r n o . h >
# include < a s m / p g t s r m m u . h > / * S R M M U _ P G D I R _ S H I F T * /
.data
/ *
* The f o l l o w i n g a r e u s e d w i t h t h e p r o m _ v e c t o r n o d e - o p s t o f i g u r e o u t
* the c p u - t y p e
* /
.align 4
cputyp :
.word 1
.align 4
.globl cputypval
cputypval :
.asciz " sun4 c "
.ascii " "
cputypvalend :
cputypvallen = c p u t y p v a r - c p u t y p v a l
.align 4
/ *
* Sun p e o p l e c a n ' t s p e l l w o r t h d a m n . " c o m p a t a b i l i t y " i n d e e d .
* At l e a s t w e * k n o w * w e c a n ' t s p e l l , a n d u s e a s p e l l - c h e c k e r .
* /
/ * Uh, a c t u a l l y L i n u s i t i s I w h o c a n n o t s p e l l . T o o m u c h m u r k y
* Sparc a s s e m b l y w i l l d o t h i s t o y a .
* /
cputypvar :
.asciz " compatability"
/* Tested on SS-5, SS-10. Probably someone at Sun applied a spell-checker. */
.align 4
cputypvar_sun4m :
.asciz " compatible"
.align 4
sun4_notsup :
2008-08-31 20:59:37 -07:00
.asciz " Sparc- L i n u x s u n 4 s u p p o r t d o e s n o l o n g e r e x i s t . \ n \ n "
2005-04-16 15:20:36 -07:00
.align 4
sun4e_notsup :
.asciz " Sparc- L i n u x s u n 4 e s u p p o r t d o e s n o t e x i s t \ n \ n "
.align 4
/* The Sparc trap table, bootloader gives us control at _start. */
2009-04-25 22:11:08 -04:00
_ _ HEAD
2005-04-16 15:20:36 -07:00
.globl start, _ s t e x t , _ s t a r t , _ _ s t e x t
.globl trapbase
_start : /* danger danger */
__stext :
_stext :
start :
trapbase :
# ifdef C O N F I G _ S M P
trapbase_cpu0 :
# endif
/* We get control passed to us here at t_zero. */
t_zero : b g o k e r n e l ; nop; nop; nop;
t_tflt : SPARC_ T F A U L T / * I n s t . A c c e s s E x c e p t i o n * /
t_bins : TRAP_ E N T R Y ( 0 x2 , b a d _ i n s t r u c t i o n ) / * I l l e g a l I n s t r u c t i o n * /
t_pins : TRAP_ E N T R Y ( 0 x3 , p r i v _ i n s t r u c t i o n ) / * P r i v i l e g e d I n s t r u c t i o n * /
t_fpd : TRAP_ E N T R Y ( 0 x4 , f p d _ t r a p _ h a n d l e r ) / * F l o a t i n g P o i n t D i s a b l e d * /
t_wovf : WINDOW_ S P I L L / * W i n d o w O v e r f l o w * /
t_wunf : WINDOW_ F I L L / * W i n d o w U n d e r f l o w * /
t_mna : TRAP_ E N T R Y ( 0 x7 , m n a _ h a n d l e r ) / * M e m o r y A d d r e s s N o t A l i g n e d * /
t_fpe : TRAP_ E N T R Y ( 0 x8 , f p e _ t r a p _ h a n d l e r ) / * F l o a t i n g P o i n t E x c e p t i o n * /
t_dflt : SPARC_ D F A U L T / * D a t a M i s s E x c e p t i o n * /
t_tio : TRAP_ E N T R Y ( 0 x a , d o _ t a g _ o v e r f l o w ) / * T a g g e d I n s t r u c t i o n O v r f l w * /
t_wpt : TRAP_ E N T R Y ( 0 x b , d o _ w a t c h p o i n t ) / * W a t c h p o i n t D e t e c t e d * /
t_badc : BAD_ T R A P ( 0 x c ) B A D _ T R A P ( 0 x d ) B A D _ T R A P ( 0 x e ) B A D _ T R A P ( 0 x f ) B A D _ T R A P ( 0 x10 )
t_irq1 : TRAP_ E N T R Y _ I N T E R R U P T ( 1 ) / * I R Q S o f t w a r e / S B U S L e v e l 1 * /
t_irq2 : TRAP_ E N T R Y _ I N T E R R U P T ( 2 ) / * I R Q S B U S L e v e l 2 * /
t_irq3 : TRAP_ E N T R Y _ I N T E R R U P T ( 3 ) / * I R Q S C S I / D M A / S B U S L e v e l 3 * /
t_irq4 : TRAP_ E N T R Y _ I N T E R R U P T ( 4 ) / * I R Q S o f t w a r e L e v e l 4 * /
t_irq5 : TRAP_ E N T R Y _ I N T E R R U P T ( 5 ) / * I R Q S B U S / E t h e r n e t L e v e l 5 * /
t_irq6 : TRAP_ E N T R Y _ I N T E R R U P T ( 6 ) / * I R Q S o f t w a r e L e v e l 6 * /
t_irq7 : TRAP_ E N T R Y _ I N T E R R U P T ( 7 ) / * I R Q V i d e o / S B U S L e v e l 5 * /
t_irq8 : TRAP_ E N T R Y _ I N T E R R U P T ( 8 ) / * I R Q S B U S L e v e l 6 * /
t_irq9 : TRAP_ E N T R Y _ I N T E R R U P T ( 9 ) / * I R Q S B U S L e v e l 7 * /
t_irq10 : TRAP_ E N T R Y _ I N T E R R U P T ( 1 0 ) / * I R Q T i m e r #1 ( o n e w e u s e ) * /
t_irq11 : TRAP_ E N T R Y _ I N T E R R U P T ( 1 1 ) / * I R Q F l o p p y I n t r . * /
t_irq12 : TRAP_ E N T R Y _ I N T E R R U P T ( 1 2 ) / * I R Q Z i l o g s e r i a l c h i p * /
t_irq13 : TRAP_ E N T R Y _ I N T E R R U P T ( 1 3 ) / * I R Q A u d i o I n t r . * /
t_irq14 : TRAP_ E N T R Y _ I N T E R R U P T ( 1 4 ) / * I R Q T i m e r #2 * /
.globl t_nmi
# ifndef C O N F I G _ S M P
t_nmi : NMI_ T R A P / * L e v e l 1 5 ( N M I ) * /
# else
t_nmi : TRAP_ E N T R Y ( 0 x1 f , l i n u x _ t r a p _ i p i 1 5 _ s u n 4 m )
# endif
t_racc : TRAP_ E N T R Y ( 0 x20 , d o _ r e g _ a c c e s s ) / * G e n e r a l R e g i s t e r A c c e s s E r r o r * /
t_iacce : BAD_ T R A P ( 0 x21 ) / * I n s t r A c c e s s E r r o r * /
t_bad22 : BAD_ T R A P ( 0 x22 ) B A D _ T R A P ( 0 x23 )
t_cpdis : TRAP_ E N T R Y ( 0 x24 , d o _ c p _ d i s a b l e d ) / * C o - P r o c e s s o r D i s a b l e d * /
t_uflsh : SKIP_ T R A P ( 0 x25 , u n i m p _ f l u s h ) / * U n i m p l e m e n t e d F L U S H i n s t . * /
t_bad26 : BAD_ T R A P ( 0 x26 ) B A D _ T R A P ( 0 x27 )
t_cpexc : TRAP_ E N T R Y ( 0 x28 , d o _ c p _ e x c e p t i o n ) / * C o - P r o c e s s o r E x c e p t i o n * /
t_dacce : SPARC_ D F A U L T / * D a t a A c c e s s E r r o r * /
t_hwdz : TRAP_ E N T R Y ( 0 x2 a , d o _ h w _ d i v z e r o ) / * D i v i s i o n b y z e r o , y o u l o s e . . . * /
t_dserr : BAD_ T R A P ( 0 x2 b ) / * D a t a S t o r e E r r o r * /
t_daccm : BAD_ T R A P ( 0 x2 c ) / * D a t a A c c e s s M M U - M i s s * /
t_bad2d : BAD_ T R A P ( 0 x2 d ) B A D _ T R A P ( 0 x2 e ) B A D _ T R A P ( 0 x2 f ) B A D _ T R A P ( 0 x30 ) B A D _ T R A P ( 0 x31 )
t_bad32 : BAD_ T R A P ( 0 x32 ) B A D _ T R A P ( 0 x33 ) B A D _ T R A P ( 0 x34 ) B A D _ T R A P ( 0 x35 ) B A D _ T R A P ( 0 x36 )
t_bad37 : BAD_ T R A P ( 0 x37 ) B A D _ T R A P ( 0 x38 ) B A D _ T R A P ( 0 x39 ) B A D _ T R A P ( 0 x3 a ) B A D _ T R A P ( 0 x3 b )
t_iaccm : BAD_ T R A P ( 0 x3 c ) / * I n s t r A c c e s s M M U - M i s s * /
t_bad3d : BAD_ T R A P ( 0 x3 d ) B A D _ T R A P ( 0 x3 e ) B A D _ T R A P ( 0 x3 f ) B A D _ T R A P ( 0 x40 ) B A D _ T R A P ( 0 x41 )
t_bad42 : BAD_ T R A P ( 0 x42 ) B A D _ T R A P ( 0 x43 ) B A D _ T R A P ( 0 x44 ) B A D _ T R A P ( 0 x45 ) B A D _ T R A P ( 0 x46 )
t_bad47 : BAD_ T R A P ( 0 x47 ) B A D _ T R A P ( 0 x48 ) B A D _ T R A P ( 0 x49 ) B A D _ T R A P ( 0 x4 a ) B A D _ T R A P ( 0 x4 b )
t_bad4c : BAD_ T R A P ( 0 x4 c ) B A D _ T R A P ( 0 x4 d ) B A D _ T R A P ( 0 x4 e ) B A D _ T R A P ( 0 x4 f ) B A D _ T R A P ( 0 x50 )
t_bad51 : BAD_ T R A P ( 0 x51 ) B A D _ T R A P ( 0 x52 ) B A D _ T R A P ( 0 x53 ) B A D _ T R A P ( 0 x54 ) B A D _ T R A P ( 0 x55 )
t_bad56 : BAD_ T R A P ( 0 x56 ) B A D _ T R A P ( 0 x57 ) B A D _ T R A P ( 0 x58 ) B A D _ T R A P ( 0 x59 ) B A D _ T R A P ( 0 x5 a )
t_bad5b : BAD_ T R A P ( 0 x5 b ) B A D _ T R A P ( 0 x5 c ) B A D _ T R A P ( 0 x5 d ) B A D _ T R A P ( 0 x5 e ) B A D _ T R A P ( 0 x5 f )
t_bad60 : BAD_ T R A P ( 0 x60 ) B A D _ T R A P ( 0 x61 ) B A D _ T R A P ( 0 x62 ) B A D _ T R A P ( 0 x63 ) B A D _ T R A P ( 0 x64 )
t_bad65 : BAD_ T R A P ( 0 x65 ) B A D _ T R A P ( 0 x66 ) B A D _ T R A P ( 0 x67 ) B A D _ T R A P ( 0 x68 ) B A D _ T R A P ( 0 x69 )
t_bad6a : BAD_ T R A P ( 0 x6 a ) B A D _ T R A P ( 0 x6 b ) B A D _ T R A P ( 0 x6 c ) B A D _ T R A P ( 0 x6 d ) B A D _ T R A P ( 0 x6 e )
t_bad6f : BAD_ T R A P ( 0 x6 f ) B A D _ T R A P ( 0 x70 ) B A D _ T R A P ( 0 x71 ) B A D _ T R A P ( 0 x72 ) B A D _ T R A P ( 0 x73 )
t_bad74 : BAD_ T R A P ( 0 x74 ) B A D _ T R A P ( 0 x75 ) B A D _ T R A P ( 0 x76 ) B A D _ T R A P ( 0 x77 ) B A D _ T R A P ( 0 x78 )
t_bad79 : BAD_ T R A P ( 0 x79 ) B A D _ T R A P ( 0 x7 a ) B A D _ T R A P ( 0 x7 b ) B A D _ T R A P ( 0 x7 c ) B A D _ T R A P ( 0 x7 d )
t_bad7e : BAD_ T R A P ( 0 x7 e ) B A D _ T R A P ( 0 x7 f )
2008-04-20 02:14:23 -07:00
t_bad80 : BAD_ T R A P ( 0 x80 ) / * S u n O S S y s t e m C a l l * /
2005-04-16 15:20:36 -07:00
t_sbkpt : BREAKPOINT_ T R A P / * S o f t w a r e B r e a k p o i n t / K G D B * /
t_divz : TRAP_ E N T R Y ( 0 x82 , d o _ h w _ d i v z e r o ) / * D i v i d e b y z e r o t r a p * /
t_flwin : TRAP_ E N T R Y ( 0 x83 , d o _ f l u s h _ w i n d o w s ) / * F l u s h W i n d o w s T r a p * /
t_clwin : BAD_ T R A P ( 0 x84 ) / * C l e a n W i n d o w s T r a p * /
t_rchk : BAD_ T R A P ( 0 x85 ) / * R a n g e C h e c k * /
t_funal : BAD_ T R A P ( 0 x86 ) / * F i x U n a l i g n e d A c c e s s T r a p * /
t_iovf : BAD_ T R A P ( 0 x87 ) / * I n t e g e r O v e r f l o w T r a p * /
2008-04-20 02:14:23 -07:00
t_bad88 : BAD_ T R A P ( 0 x88 ) / * S l o w a r i s S y s t e m C a l l * /
t_bad89 : BAD_ T R A P ( 0 x89 ) / * N e t - B . S . S y s t e m C a l l * /
2005-04-16 15:20:36 -07:00
t_bad8a : BAD_ T R A P ( 0 x8 a ) B A D _ T R A P ( 0 x8 b ) B A D _ T R A P ( 0 x8 c ) B A D _ T R A P ( 0 x8 d ) B A D _ T R A P ( 0 x8 e )
t_bad8f : BAD_ T R A P ( 0 x8 f )
t_linux : LINUX_ S Y S C A L L _ T R A P / * L i n u x S y s t e m C a l l * /
t_bad91 : BAD_ T R A P ( 0 x91 ) B A D _ T R A P ( 0 x92 ) B A D _ T R A P ( 0 x93 ) B A D _ T R A P ( 0 x94 ) B A D _ T R A P ( 0 x95 )
t_bad96 : BAD_ T R A P ( 0 x96 ) B A D _ T R A P ( 0 x97 ) B A D _ T R A P ( 0 x98 ) B A D _ T R A P ( 0 x99 ) B A D _ T R A P ( 0 x9 a )
t_bad9b : BAD_ T R A P ( 0 x9 b ) B A D _ T R A P ( 0 x9 c ) B A D _ T R A P ( 0 x9 d ) B A D _ T R A P ( 0 x9 e ) B A D _ T R A P ( 0 x9 f )
t_getcc : GETCC_ T R A P / * G e t C o n d i t i o n C o d e s * /
t_setcc : SETCC_ T R A P / * S e t C o n d i t i o n C o d e s * /
t_getpsr : GETPSR_ T R A P / * G e t P S R R e g i s t e r * /
t_bada3 : BAD_ T R A P ( 0 x a3 ) B A D _ T R A P ( 0 x a4 ) B A D _ T R A P ( 0 x a5 ) B A D _ T R A P ( 0 x a6 )
2008-04-20 02:14:23 -07:00
t_bada7 : BAD_ T R A P ( 0 x a7 )
2005-04-16 15:20:36 -07:00
t_bada8 : BAD_ T R A P ( 0 x a8 ) B A D _ T R A P ( 0 x a9 ) B A D _ T R A P ( 0 x a a ) B A D _ T R A P ( 0 x a b )
t_badac : BAD_ T R A P ( 0 x a c ) B A D _ T R A P ( 0 x a d ) B A D _ T R A P ( 0 x a e ) B A D _ T R A P ( 0 x a f ) B A D _ T R A P ( 0 x b0 )
t_badb1 : BAD_ T R A P ( 0 x b1 ) B A D _ T R A P ( 0 x b2 ) B A D _ T R A P ( 0 x b3 ) B A D _ T R A P ( 0 x b4 ) B A D _ T R A P ( 0 x b5 )
t_badb6 : BAD_ T R A P ( 0 x b6 ) B A D _ T R A P ( 0 x b7 ) B A D _ T R A P ( 0 x b8 ) B A D _ T R A P ( 0 x b9 ) B A D _ T R A P ( 0 x b a )
t_badbb : BAD_ T R A P ( 0 x b b ) B A D _ T R A P ( 0 x b c ) B A D _ T R A P ( 0 x b d ) B A D _ T R A P ( 0 x b e ) B A D _ T R A P ( 0 x b f )
t_badc0 : BAD_ T R A P ( 0 x c0 ) B A D _ T R A P ( 0 x c1 ) B A D _ T R A P ( 0 x c2 ) B A D _ T R A P ( 0 x c3 ) B A D _ T R A P ( 0 x c4 )
t_badc5 : BAD_ T R A P ( 0 x c5 ) B A D _ T R A P ( 0 x c6 ) B A D _ T R A P ( 0 x c7 ) B A D _ T R A P ( 0 x c8 ) B A D _ T R A P ( 0 x c9 )
t_badca : BAD_ T R A P ( 0 x c a ) B A D _ T R A P ( 0 x c b ) B A D _ T R A P ( 0 x c c ) B A D _ T R A P ( 0 x c d ) B A D _ T R A P ( 0 x c e )
t_badcf : BAD_ T R A P ( 0 x c f ) B A D _ T R A P ( 0 x d0 ) B A D _ T R A P ( 0 x d1 ) B A D _ T R A P ( 0 x d2 ) B A D _ T R A P ( 0 x d3 )
t_badd4 : BAD_ T R A P ( 0 x d4 ) B A D _ T R A P ( 0 x d5 ) B A D _ T R A P ( 0 x d6 ) B A D _ T R A P ( 0 x d7 ) B A D _ T R A P ( 0 x d8 )
t_badd9 : BAD_ T R A P ( 0 x d9 ) B A D _ T R A P ( 0 x d a ) B A D _ T R A P ( 0 x d b ) B A D _ T R A P ( 0 x d c ) B A D _ T R A P ( 0 x d d )
t_badde : BAD_ T R A P ( 0 x d e ) B A D _ T R A P ( 0 x d f ) B A D _ T R A P ( 0 x e 0 ) B A D _ T R A P ( 0 x e 1 ) B A D _ T R A P ( 0 x e 2 )
t_bade3 : BAD_ T R A P ( 0 x e 3 ) B A D _ T R A P ( 0 x e 4 ) B A D _ T R A P ( 0 x e 5 ) B A D _ T R A P ( 0 x e 6 ) B A D _ T R A P ( 0 x e 7 )
t_bade8 : BAD_ T R A P ( 0 x e 8 ) B A D _ T R A P ( 0 x e 9 ) B A D _ T R A P ( 0 x e a ) B A D _ T R A P ( 0 x e b ) B A D _ T R A P ( 0 x e c )
t_baded : BAD_ T R A P ( 0 x e d ) B A D _ T R A P ( 0 x e e ) B A D _ T R A P ( 0 x e f ) B A D _ T R A P ( 0 x f0 ) B A D _ T R A P ( 0 x f1 )
t_badf2 : BAD_ T R A P ( 0 x f2 ) B A D _ T R A P ( 0 x f3 ) B A D _ T R A P ( 0 x f4 ) B A D _ T R A P ( 0 x f5 ) B A D _ T R A P ( 0 x f6 )
t_badf7 : BAD_ T R A P ( 0 x f7 ) B A D _ T R A P ( 0 x f8 ) B A D _ T R A P ( 0 x f9 ) B A D _ T R A P ( 0 x f a ) B A D _ T R A P ( 0 x f b )
2008-04-29 02:38:50 -07:00
t_badfc : BAD_ T R A P ( 0 x f c )
t_kgdb : KGDB_ T R A P ( 0 x f d )
2005-04-16 15:20:36 -07:00
dbtrap : BAD_ T R A P ( 0 x f e ) / * D e b u g g e r / P R O M b r e a k p o i n t #1 * /
dbtrap2 : BAD_ T R A P ( 0 x f f ) / * D e b u g g e r / P R O M b r e a k p o i n t #2 * /
.globl end_traptable
end_traptable :
# ifdef C O N F I G _ S M P
/* Trap tables for the other cpus. */
.globl trapbase_ c p u 1 , t r a p b a s e _ c p u 2 , t r a p b a s e _ c p u 3
trapbase_cpu1 :
BAD_ T R A P ( 0 x0 ) S R M M U _ T F A U L T T R A P _ E N T R Y ( 0 x2 , b a d _ i n s t r u c t i o n )
TRAP_ E N T R Y ( 0 x3 , p r i v _ i n s t r u c t i o n ) T R A P _ E N T R Y ( 0 x4 , f p d _ t r a p _ h a n d l e r )
WINDOW_ S P I L L W I N D O W _ F I L L T R A P _ E N T R Y ( 0 x7 , m n a _ h a n d l e r )
TRAP_ E N T R Y ( 0 x8 , f p e _ t r a p _ h a n d l e r ) S R M M U _ D F A U L T
TRAP_ E N T R Y ( 0 x a , d o _ t a g _ o v e r f l o w ) T R A P _ E N T R Y ( 0 x b , d o _ w a t c h p o i n t )
BAD_ T R A P ( 0 x c ) B A D _ T R A P ( 0 x d ) B A D _ T R A P ( 0 x e ) B A D _ T R A P ( 0 x f ) B A D _ T R A P ( 0 x10 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 ) T R A P _ E N T R Y _ I N T E R R U P T ( 2 )
TRAP_ E N T R Y _ I N T E R R U P T ( 3 ) T R A P _ E N T R Y _ I N T E R R U P T ( 4 )
TRAP_ E N T R Y _ I N T E R R U P T ( 5 ) T R A P _ E N T R Y _ I N T E R R U P T ( 6 )
TRAP_ E N T R Y _ I N T E R R U P T ( 7 ) T R A P _ E N T R Y _ I N T E R R U P T ( 8 )
TRAP_ E N T R Y _ I N T E R R U P T ( 9 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 0 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 1 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 2 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 3 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 4 )
TRAP_ E N T R Y ( 0 x1 f , l i n u x _ t r a p _ i p i 1 5 _ s u n 4 m )
TRAP_ E N T R Y ( 0 x20 , d o _ r e g _ a c c e s s ) B A D _ T R A P ( 0 x21 ) B A D _ T R A P ( 0 x22 )
BAD_ T R A P ( 0 x23 ) T R A P _ E N T R Y ( 0 x24 , d o _ c p _ d i s a b l e d ) S K I P _ T R A P ( 0 x25 , u n i m p _ f l u s h )
BAD_ T R A P ( 0 x26 ) B A D _ T R A P ( 0 x27 ) T R A P _ E N T R Y ( 0 x28 , d o _ c p _ e x c e p t i o n )
SRMMU_ D F A U L T T R A P _ E N T R Y ( 0 x2 a , d o _ h w _ d i v z e r o ) B A D _ T R A P ( 0 x2 b ) B A D _ T R A P ( 0 x2 c )
BAD_ T R A P ( 0 x2 d ) B A D _ T R A P ( 0 x2 e ) B A D _ T R A P ( 0 x2 f ) B A D _ T R A P ( 0 x30 ) B A D _ T R A P ( 0 x31 )
BAD_ T R A P ( 0 x32 ) B A D _ T R A P ( 0 x33 ) B A D _ T R A P ( 0 x34 ) B A D _ T R A P ( 0 x35 ) B A D _ T R A P ( 0 x36 )
BAD_ T R A P ( 0 x37 ) B A D _ T R A P ( 0 x38 ) B A D _ T R A P ( 0 x39 ) B A D _ T R A P ( 0 x3 a ) B A D _ T R A P ( 0 x3 b )
BAD_ T R A P ( 0 x3 c ) B A D _ T R A P ( 0 x3 d ) B A D _ T R A P ( 0 x3 e ) B A D _ T R A P ( 0 x3 f ) B A D _ T R A P ( 0 x40 )
BAD_ T R A P ( 0 x41 ) B A D _ T R A P ( 0 x42 ) B A D _ T R A P ( 0 x43 ) B A D _ T R A P ( 0 x44 ) B A D _ T R A P ( 0 x45 )
BAD_ T R A P ( 0 x46 ) B A D _ T R A P ( 0 x47 ) B A D _ T R A P ( 0 x48 ) B A D _ T R A P ( 0 x49 ) B A D _ T R A P ( 0 x4 a )
BAD_ T R A P ( 0 x4 b ) B A D _ T R A P ( 0 x4 c ) B A D _ T R A P ( 0 x4 d ) B A D _ T R A P ( 0 x4 e ) B A D _ T R A P ( 0 x4 f )
BAD_ T R A P ( 0 x50 )
BAD_ T R A P ( 0 x51 ) B A D _ T R A P ( 0 x52 ) B A D _ T R A P ( 0 x53 ) B A D _ T R A P ( 0 x54 ) B A D _ T R A P ( 0 x55 )
BAD_ T R A P ( 0 x56 ) B A D _ T R A P ( 0 x57 ) B A D _ T R A P ( 0 x58 ) B A D _ T R A P ( 0 x59 ) B A D _ T R A P ( 0 x5 a )
BAD_ T R A P ( 0 x5 b ) B A D _ T R A P ( 0 x5 c ) B A D _ T R A P ( 0 x5 d ) B A D _ T R A P ( 0 x5 e ) B A D _ T R A P ( 0 x5 f )
BAD_ T R A P ( 0 x60 ) B A D _ T R A P ( 0 x61 ) B A D _ T R A P ( 0 x62 ) B A D _ T R A P ( 0 x63 ) B A D _ T R A P ( 0 x64 )
BAD_ T R A P ( 0 x65 ) B A D _ T R A P ( 0 x66 ) B A D _ T R A P ( 0 x67 ) B A D _ T R A P ( 0 x68 ) B A D _ T R A P ( 0 x69 )
BAD_ T R A P ( 0 x6 a ) B A D _ T R A P ( 0 x6 b ) B A D _ T R A P ( 0 x6 c ) B A D _ T R A P ( 0 x6 d ) B A D _ T R A P ( 0 x6 e )
BAD_ T R A P ( 0 x6 f ) B A D _ T R A P ( 0 x70 ) B A D _ T R A P ( 0 x71 ) B A D _ T R A P ( 0 x72 ) B A D _ T R A P ( 0 x73 )
BAD_ T R A P ( 0 x74 ) B A D _ T R A P ( 0 x75 ) B A D _ T R A P ( 0 x76 ) B A D _ T R A P ( 0 x77 ) B A D _ T R A P ( 0 x78 )
BAD_ T R A P ( 0 x79 ) B A D _ T R A P ( 0 x7 a ) B A D _ T R A P ( 0 x7 b ) B A D _ T R A P ( 0 x7 c ) B A D _ T R A P ( 0 x7 d )
BAD_ T R A P ( 0 x7 e ) B A D _ T R A P ( 0 x7 f )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x80 )
2005-04-16 15:20:36 -07:00
BREAKPOINT_ T R A P
TRAP_ E N T R Y ( 0 x82 , d o _ h w _ d i v z e r o )
TRAP_ E N T R Y ( 0 x83 , d o _ f l u s h _ w i n d o w s ) B A D _ T R A P ( 0 x84 ) B A D _ T R A P ( 0 x85 )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x86 ) B A D _ T R A P ( 0 x87 ) B A D _ T R A P ( 0 x88 )
BAD_ T R A P ( 0 x89 ) B A D _ T R A P ( 0 x8 a ) B A D _ T R A P ( 0 x8 b ) B A D _ T R A P ( 0 x8 c )
2005-04-16 15:20:36 -07:00
BAD_ T R A P ( 0 x8 d ) B A D _ T R A P ( 0 x8 e ) B A D _ T R A P ( 0 x8 f )
LINUX_ S Y S C A L L _ T R A P B A D _ T R A P ( 0 x91 ) B A D _ T R A P ( 0 x92 ) B A D _ T R A P ( 0 x93 ) B A D _ T R A P ( 0 x94 )
BAD_ T R A P ( 0 x95 ) B A D _ T R A P ( 0 x96 ) B A D _ T R A P ( 0 x97 ) B A D _ T R A P ( 0 x98 ) B A D _ T R A P ( 0 x99 )
BAD_ T R A P ( 0 x9 a ) B A D _ T R A P ( 0 x9 b ) B A D _ T R A P ( 0 x9 c ) B A D _ T R A P ( 0 x9 d ) B A D _ T R A P ( 0 x9 e )
BAD_ T R A P ( 0 x9 f ) G E T C C _ T R A P S E T C C _ T R A P G E T P S R _ T R A P
BAD_ T R A P ( 0 x a3 ) B A D _ T R A P ( 0 x a4 ) B A D _ T R A P ( 0 x a5 ) B A D _ T R A P ( 0 x a6 )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x a7 ) B A D _ T R A P ( 0 x a8 ) B A D _ T R A P ( 0 x a9 ) B A D _ T R A P ( 0 x a a ) B A D _ T R A P ( 0 x a b )
2005-04-16 15:20:36 -07:00
BAD_ T R A P ( 0 x a c ) B A D _ T R A P ( 0 x a d ) B A D _ T R A P ( 0 x a e ) B A D _ T R A P ( 0 x a f ) B A D _ T R A P ( 0 x b0 )
BAD_ T R A P ( 0 x b1 ) B A D _ T R A P ( 0 x b2 ) B A D _ T R A P ( 0 x b3 ) B A D _ T R A P ( 0 x b4 ) B A D _ T R A P ( 0 x b5 )
BAD_ T R A P ( 0 x b6 ) B A D _ T R A P ( 0 x b7 ) B A D _ T R A P ( 0 x b8 ) B A D _ T R A P ( 0 x b9 ) B A D _ T R A P ( 0 x b a )
BAD_ T R A P ( 0 x b b ) B A D _ T R A P ( 0 x b c ) B A D _ T R A P ( 0 x b d ) B A D _ T R A P ( 0 x b e ) B A D _ T R A P ( 0 x b f )
BAD_ T R A P ( 0 x c0 ) B A D _ T R A P ( 0 x c1 ) B A D _ T R A P ( 0 x c2 ) B A D _ T R A P ( 0 x c3 ) B A D _ T R A P ( 0 x c4 )
BAD_ T R A P ( 0 x c5 ) B A D _ T R A P ( 0 x c6 ) B A D _ T R A P ( 0 x c7 ) B A D _ T R A P ( 0 x c8 ) B A D _ T R A P ( 0 x c9 )
BAD_ T R A P ( 0 x c a ) B A D _ T R A P ( 0 x c b ) B A D _ T R A P ( 0 x c c ) B A D _ T R A P ( 0 x c d ) B A D _ T R A P ( 0 x c e )
BAD_ T R A P ( 0 x c f ) B A D _ T R A P ( 0 x d0 ) B A D _ T R A P ( 0 x d1 ) B A D _ T R A P ( 0 x d2 ) B A D _ T R A P ( 0 x d3 )
BAD_ T R A P ( 0 x d4 ) B A D _ T R A P ( 0 x d5 ) B A D _ T R A P ( 0 x d6 ) B A D _ T R A P ( 0 x d7 ) B A D _ T R A P ( 0 x d8 )
BAD_ T R A P ( 0 x d9 ) B A D _ T R A P ( 0 x d a ) B A D _ T R A P ( 0 x d b ) B A D _ T R A P ( 0 x d c ) B A D _ T R A P ( 0 x d d )
BAD_ T R A P ( 0 x d e ) B A D _ T R A P ( 0 x d f ) B A D _ T R A P ( 0 x e 0 ) B A D _ T R A P ( 0 x e 1 ) B A D _ T R A P ( 0 x e 2 )
BAD_ T R A P ( 0 x e 3 ) B A D _ T R A P ( 0 x e 4 ) B A D _ T R A P ( 0 x e 5 ) B A D _ T R A P ( 0 x e 6 ) B A D _ T R A P ( 0 x e 7 )
BAD_ T R A P ( 0 x e 8 ) B A D _ T R A P ( 0 x e 9 ) B A D _ T R A P ( 0 x e a ) B A D _ T R A P ( 0 x e b ) B A D _ T R A P ( 0 x e c )
BAD_ T R A P ( 0 x e d ) B A D _ T R A P ( 0 x e e ) B A D _ T R A P ( 0 x e f ) B A D _ T R A P ( 0 x f0 ) B A D _ T R A P ( 0 x f1 )
BAD_ T R A P ( 0 x f2 ) B A D _ T R A P ( 0 x f3 ) B A D _ T R A P ( 0 x f4 ) B A D _ T R A P ( 0 x f5 ) B A D _ T R A P ( 0 x f6 )
BAD_ T R A P ( 0 x f7 ) B A D _ T R A P ( 0 x f8 ) B A D _ T R A P ( 0 x f9 ) B A D _ T R A P ( 0 x f a ) B A D _ T R A P ( 0 x f b )
2008-04-29 02:38:50 -07:00
BAD_ T R A P ( 0 x f c ) K G D B _ T R A P ( 0 x f d ) B A D _ T R A P ( 0 x f e ) B A D _ T R A P ( 0 x f f )
2005-04-16 15:20:36 -07:00
trapbase_cpu2 :
BAD_ T R A P ( 0 x0 ) S R M M U _ T F A U L T T R A P _ E N T R Y ( 0 x2 , b a d _ i n s t r u c t i o n )
TRAP_ E N T R Y ( 0 x3 , p r i v _ i n s t r u c t i o n ) T R A P _ E N T R Y ( 0 x4 , f p d _ t r a p _ h a n d l e r )
WINDOW_ S P I L L W I N D O W _ F I L L T R A P _ E N T R Y ( 0 x7 , m n a _ h a n d l e r )
TRAP_ E N T R Y ( 0 x8 , f p e _ t r a p _ h a n d l e r ) S R M M U _ D F A U L T
TRAP_ E N T R Y ( 0 x a , d o _ t a g _ o v e r f l o w ) T R A P _ E N T R Y ( 0 x b , d o _ w a t c h p o i n t )
BAD_ T R A P ( 0 x c ) B A D _ T R A P ( 0 x d ) B A D _ T R A P ( 0 x e ) B A D _ T R A P ( 0 x f ) B A D _ T R A P ( 0 x10 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 ) T R A P _ E N T R Y _ I N T E R R U P T ( 2 )
TRAP_ E N T R Y _ I N T E R R U P T ( 3 ) T R A P _ E N T R Y _ I N T E R R U P T ( 4 )
TRAP_ E N T R Y _ I N T E R R U P T ( 5 ) T R A P _ E N T R Y _ I N T E R R U P T ( 6 )
TRAP_ E N T R Y _ I N T E R R U P T ( 7 ) T R A P _ E N T R Y _ I N T E R R U P T ( 8 )
TRAP_ E N T R Y _ I N T E R R U P T ( 9 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 0 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 1 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 2 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 3 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 4 )
TRAP_ E N T R Y ( 0 x1 f , l i n u x _ t r a p _ i p i 1 5 _ s u n 4 m )
TRAP_ E N T R Y ( 0 x20 , d o _ r e g _ a c c e s s ) B A D _ T R A P ( 0 x21 ) B A D _ T R A P ( 0 x22 )
BAD_ T R A P ( 0 x23 ) T R A P _ E N T R Y ( 0 x24 , d o _ c p _ d i s a b l e d ) S K I P _ T R A P ( 0 x25 , u n i m p _ f l u s h )
BAD_ T R A P ( 0 x26 ) B A D _ T R A P ( 0 x27 ) T R A P _ E N T R Y ( 0 x28 , d o _ c p _ e x c e p t i o n )
SRMMU_ D F A U L T T R A P _ E N T R Y ( 0 x2 a , d o _ h w _ d i v z e r o ) B A D _ T R A P ( 0 x2 b ) B A D _ T R A P ( 0 x2 c )
BAD_ T R A P ( 0 x2 d ) B A D _ T R A P ( 0 x2 e ) B A D _ T R A P ( 0 x2 f ) B A D _ T R A P ( 0 x30 ) B A D _ T R A P ( 0 x31 )
BAD_ T R A P ( 0 x32 ) B A D _ T R A P ( 0 x33 ) B A D _ T R A P ( 0 x34 ) B A D _ T R A P ( 0 x35 ) B A D _ T R A P ( 0 x36 )
BAD_ T R A P ( 0 x37 ) B A D _ T R A P ( 0 x38 ) B A D _ T R A P ( 0 x39 ) B A D _ T R A P ( 0 x3 a ) B A D _ T R A P ( 0 x3 b )
BAD_ T R A P ( 0 x3 c ) B A D _ T R A P ( 0 x3 d ) B A D _ T R A P ( 0 x3 e ) B A D _ T R A P ( 0 x3 f ) B A D _ T R A P ( 0 x40 )
BAD_ T R A P ( 0 x41 ) B A D _ T R A P ( 0 x42 ) B A D _ T R A P ( 0 x43 ) B A D _ T R A P ( 0 x44 ) B A D _ T R A P ( 0 x45 )
BAD_ T R A P ( 0 x46 ) B A D _ T R A P ( 0 x47 ) B A D _ T R A P ( 0 x48 ) B A D _ T R A P ( 0 x49 ) B A D _ T R A P ( 0 x4 a )
BAD_ T R A P ( 0 x4 b ) B A D _ T R A P ( 0 x4 c ) B A D _ T R A P ( 0 x4 d ) B A D _ T R A P ( 0 x4 e ) B A D _ T R A P ( 0 x4 f )
BAD_ T R A P ( 0 x50 )
BAD_ T R A P ( 0 x51 ) B A D _ T R A P ( 0 x52 ) B A D _ T R A P ( 0 x53 ) B A D _ T R A P ( 0 x54 ) B A D _ T R A P ( 0 x55 )
BAD_ T R A P ( 0 x56 ) B A D _ T R A P ( 0 x57 ) B A D _ T R A P ( 0 x58 ) B A D _ T R A P ( 0 x59 ) B A D _ T R A P ( 0 x5 a )
BAD_ T R A P ( 0 x5 b ) B A D _ T R A P ( 0 x5 c ) B A D _ T R A P ( 0 x5 d ) B A D _ T R A P ( 0 x5 e ) B A D _ T R A P ( 0 x5 f )
BAD_ T R A P ( 0 x60 ) B A D _ T R A P ( 0 x61 ) B A D _ T R A P ( 0 x62 ) B A D _ T R A P ( 0 x63 ) B A D _ T R A P ( 0 x64 )
BAD_ T R A P ( 0 x65 ) B A D _ T R A P ( 0 x66 ) B A D _ T R A P ( 0 x67 ) B A D _ T R A P ( 0 x68 ) B A D _ T R A P ( 0 x69 )
BAD_ T R A P ( 0 x6 a ) B A D _ T R A P ( 0 x6 b ) B A D _ T R A P ( 0 x6 c ) B A D _ T R A P ( 0 x6 d ) B A D _ T R A P ( 0 x6 e )
BAD_ T R A P ( 0 x6 f ) B A D _ T R A P ( 0 x70 ) B A D _ T R A P ( 0 x71 ) B A D _ T R A P ( 0 x72 ) B A D _ T R A P ( 0 x73 )
BAD_ T R A P ( 0 x74 ) B A D _ T R A P ( 0 x75 ) B A D _ T R A P ( 0 x76 ) B A D _ T R A P ( 0 x77 ) B A D _ T R A P ( 0 x78 )
BAD_ T R A P ( 0 x79 ) B A D _ T R A P ( 0 x7 a ) B A D _ T R A P ( 0 x7 b ) B A D _ T R A P ( 0 x7 c ) B A D _ T R A P ( 0 x7 d )
BAD_ T R A P ( 0 x7 e ) B A D _ T R A P ( 0 x7 f )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x80 )
2005-04-16 15:20:36 -07:00
BREAKPOINT_ T R A P
TRAP_ E N T R Y ( 0 x82 , d o _ h w _ d i v z e r o )
TRAP_ E N T R Y ( 0 x83 , d o _ f l u s h _ w i n d o w s ) B A D _ T R A P ( 0 x84 ) B A D _ T R A P ( 0 x85 )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x86 ) B A D _ T R A P ( 0 x87 ) B A D _ T R A P ( 0 x88 )
BAD_ T R A P ( 0 x89 ) B A D _ T R A P ( 0 x8 a ) B A D _ T R A P ( 0 x8 b ) B A D _ T R A P ( 0 x8 c )
2005-04-16 15:20:36 -07:00
BAD_ T R A P ( 0 x8 d ) B A D _ T R A P ( 0 x8 e ) B A D _ T R A P ( 0 x8 f )
LINUX_ S Y S C A L L _ T R A P B A D _ T R A P ( 0 x91 ) B A D _ T R A P ( 0 x92 ) B A D _ T R A P ( 0 x93 ) B A D _ T R A P ( 0 x94 )
BAD_ T R A P ( 0 x95 ) B A D _ T R A P ( 0 x96 ) B A D _ T R A P ( 0 x97 ) B A D _ T R A P ( 0 x98 ) B A D _ T R A P ( 0 x99 )
BAD_ T R A P ( 0 x9 a ) B A D _ T R A P ( 0 x9 b ) B A D _ T R A P ( 0 x9 c ) B A D _ T R A P ( 0 x9 d ) B A D _ T R A P ( 0 x9 e )
BAD_ T R A P ( 0 x9 f ) G E T C C _ T R A P S E T C C _ T R A P G E T P S R _ T R A P
BAD_ T R A P ( 0 x a3 ) B A D _ T R A P ( 0 x a4 ) B A D _ T R A P ( 0 x a5 ) B A D _ T R A P ( 0 x a6 )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x a7 ) B A D _ T R A P ( 0 x a8 ) B A D _ T R A P ( 0 x a9 ) B A D _ T R A P ( 0 x a a ) B A D _ T R A P ( 0 x a b )
2005-04-16 15:20:36 -07:00
BAD_ T R A P ( 0 x a c ) B A D _ T R A P ( 0 x a d ) B A D _ T R A P ( 0 x a e ) B A D _ T R A P ( 0 x a f ) B A D _ T R A P ( 0 x b0 )
BAD_ T R A P ( 0 x b1 ) B A D _ T R A P ( 0 x b2 ) B A D _ T R A P ( 0 x b3 ) B A D _ T R A P ( 0 x b4 ) B A D _ T R A P ( 0 x b5 )
BAD_ T R A P ( 0 x b6 ) B A D _ T R A P ( 0 x b7 ) B A D _ T R A P ( 0 x b8 ) B A D _ T R A P ( 0 x b9 ) B A D _ T R A P ( 0 x b a )
BAD_ T R A P ( 0 x b b ) B A D _ T R A P ( 0 x b c ) B A D _ T R A P ( 0 x b d ) B A D _ T R A P ( 0 x b e ) B A D _ T R A P ( 0 x b f )
BAD_ T R A P ( 0 x c0 ) B A D _ T R A P ( 0 x c1 ) B A D _ T R A P ( 0 x c2 ) B A D _ T R A P ( 0 x c3 ) B A D _ T R A P ( 0 x c4 )
BAD_ T R A P ( 0 x c5 ) B A D _ T R A P ( 0 x c6 ) B A D _ T R A P ( 0 x c7 ) B A D _ T R A P ( 0 x c8 ) B A D _ T R A P ( 0 x c9 )
BAD_ T R A P ( 0 x c a ) B A D _ T R A P ( 0 x c b ) B A D _ T R A P ( 0 x c c ) B A D _ T R A P ( 0 x c d ) B A D _ T R A P ( 0 x c e )
BAD_ T R A P ( 0 x c f ) B A D _ T R A P ( 0 x d0 ) B A D _ T R A P ( 0 x d1 ) B A D _ T R A P ( 0 x d2 ) B A D _ T R A P ( 0 x d3 )
BAD_ T R A P ( 0 x d4 ) B A D _ T R A P ( 0 x d5 ) B A D _ T R A P ( 0 x d6 ) B A D _ T R A P ( 0 x d7 ) B A D _ T R A P ( 0 x d8 )
BAD_ T R A P ( 0 x d9 ) B A D _ T R A P ( 0 x d a ) B A D _ T R A P ( 0 x d b ) B A D _ T R A P ( 0 x d c ) B A D _ T R A P ( 0 x d d )
BAD_ T R A P ( 0 x d e ) B A D _ T R A P ( 0 x d f ) B A D _ T R A P ( 0 x e 0 ) B A D _ T R A P ( 0 x e 1 ) B A D _ T R A P ( 0 x e 2 )
BAD_ T R A P ( 0 x e 3 ) B A D _ T R A P ( 0 x e 4 ) B A D _ T R A P ( 0 x e 5 ) B A D _ T R A P ( 0 x e 6 ) B A D _ T R A P ( 0 x e 7 )
BAD_ T R A P ( 0 x e 8 ) B A D _ T R A P ( 0 x e 9 ) B A D _ T R A P ( 0 x e a ) B A D _ T R A P ( 0 x e b ) B A D _ T R A P ( 0 x e c )
BAD_ T R A P ( 0 x e d ) B A D _ T R A P ( 0 x e e ) B A D _ T R A P ( 0 x e f ) B A D _ T R A P ( 0 x f0 ) B A D _ T R A P ( 0 x f1 )
BAD_ T R A P ( 0 x f2 ) B A D _ T R A P ( 0 x f3 ) B A D _ T R A P ( 0 x f4 ) B A D _ T R A P ( 0 x f5 ) B A D _ T R A P ( 0 x f6 )
BAD_ T R A P ( 0 x f7 ) B A D _ T R A P ( 0 x f8 ) B A D _ T R A P ( 0 x f9 ) B A D _ T R A P ( 0 x f a ) B A D _ T R A P ( 0 x f b )
2008-04-29 02:38:50 -07:00
BAD_ T R A P ( 0 x f c ) K G D B _ T R A P ( 0 x f d ) B A D _ T R A P ( 0 x f e ) B A D _ T R A P ( 0 x f f )
2005-04-16 15:20:36 -07:00
trapbase_cpu3 :
BAD_ T R A P ( 0 x0 ) S R M M U _ T F A U L T T R A P _ E N T R Y ( 0 x2 , b a d _ i n s t r u c t i o n )
TRAP_ E N T R Y ( 0 x3 , p r i v _ i n s t r u c t i o n ) T R A P _ E N T R Y ( 0 x4 , f p d _ t r a p _ h a n d l e r )
WINDOW_ S P I L L W I N D O W _ F I L L T R A P _ E N T R Y ( 0 x7 , m n a _ h a n d l e r )
TRAP_ E N T R Y ( 0 x8 , f p e _ t r a p _ h a n d l e r ) S R M M U _ D F A U L T
TRAP_ E N T R Y ( 0 x a , d o _ t a g _ o v e r f l o w ) T R A P _ E N T R Y ( 0 x b , d o _ w a t c h p o i n t )
BAD_ T R A P ( 0 x c ) B A D _ T R A P ( 0 x d ) B A D _ T R A P ( 0 x e ) B A D _ T R A P ( 0 x f ) B A D _ T R A P ( 0 x10 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 ) T R A P _ E N T R Y _ I N T E R R U P T ( 2 )
TRAP_ E N T R Y _ I N T E R R U P T ( 3 ) T R A P _ E N T R Y _ I N T E R R U P T ( 4 )
TRAP_ E N T R Y _ I N T E R R U P T ( 5 ) T R A P _ E N T R Y _ I N T E R R U P T ( 6 )
TRAP_ E N T R Y _ I N T E R R U P T ( 7 ) T R A P _ E N T R Y _ I N T E R R U P T ( 8 )
TRAP_ E N T R Y _ I N T E R R U P T ( 9 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 0 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 1 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 2 )
TRAP_ E N T R Y _ I N T E R R U P T ( 1 3 ) T R A P _ E N T R Y _ I N T E R R U P T ( 1 4 )
TRAP_ E N T R Y ( 0 x1 f , l i n u x _ t r a p _ i p i 1 5 _ s u n 4 m )
TRAP_ E N T R Y ( 0 x20 , d o _ r e g _ a c c e s s ) B A D _ T R A P ( 0 x21 ) B A D _ T R A P ( 0 x22 )
BAD_ T R A P ( 0 x23 ) T R A P _ E N T R Y ( 0 x24 , d o _ c p _ d i s a b l e d ) S K I P _ T R A P ( 0 x25 , u n i m p _ f l u s h )
BAD_ T R A P ( 0 x26 ) B A D _ T R A P ( 0 x27 ) T R A P _ E N T R Y ( 0 x28 , d o _ c p _ e x c e p t i o n )
SRMMU_ D F A U L T T R A P _ E N T R Y ( 0 x2 a , d o _ h w _ d i v z e r o ) B A D _ T R A P ( 0 x2 b ) B A D _ T R A P ( 0 x2 c )
BAD_ T R A P ( 0 x2 d ) B A D _ T R A P ( 0 x2 e ) B A D _ T R A P ( 0 x2 f ) B A D _ T R A P ( 0 x30 ) B A D _ T R A P ( 0 x31 )
BAD_ T R A P ( 0 x32 ) B A D _ T R A P ( 0 x33 ) B A D _ T R A P ( 0 x34 ) B A D _ T R A P ( 0 x35 ) B A D _ T R A P ( 0 x36 )
BAD_ T R A P ( 0 x37 ) B A D _ T R A P ( 0 x38 ) B A D _ T R A P ( 0 x39 ) B A D _ T R A P ( 0 x3 a ) B A D _ T R A P ( 0 x3 b )
BAD_ T R A P ( 0 x3 c ) B A D _ T R A P ( 0 x3 d ) B A D _ T R A P ( 0 x3 e ) B A D _ T R A P ( 0 x3 f ) B A D _ T R A P ( 0 x40 )
BAD_ T R A P ( 0 x41 ) B A D _ T R A P ( 0 x42 ) B A D _ T R A P ( 0 x43 ) B A D _ T R A P ( 0 x44 ) B A D _ T R A P ( 0 x45 )
BAD_ T R A P ( 0 x46 ) B A D _ T R A P ( 0 x47 ) B A D _ T R A P ( 0 x48 ) B A D _ T R A P ( 0 x49 ) B A D _ T R A P ( 0 x4 a )
BAD_ T R A P ( 0 x4 b ) B A D _ T R A P ( 0 x4 c ) B A D _ T R A P ( 0 x4 d ) B A D _ T R A P ( 0 x4 e ) B A D _ T R A P ( 0 x4 f )
BAD_ T R A P ( 0 x50 )
BAD_ T R A P ( 0 x51 ) B A D _ T R A P ( 0 x52 ) B A D _ T R A P ( 0 x53 ) B A D _ T R A P ( 0 x54 ) B A D _ T R A P ( 0 x55 )
BAD_ T R A P ( 0 x56 ) B A D _ T R A P ( 0 x57 ) B A D _ T R A P ( 0 x58 ) B A D _ T R A P ( 0 x59 ) B A D _ T R A P ( 0 x5 a )
BAD_ T R A P ( 0 x5 b ) B A D _ T R A P ( 0 x5 c ) B A D _ T R A P ( 0 x5 d ) B A D _ T R A P ( 0 x5 e ) B A D _ T R A P ( 0 x5 f )
BAD_ T R A P ( 0 x60 ) B A D _ T R A P ( 0 x61 ) B A D _ T R A P ( 0 x62 ) B A D _ T R A P ( 0 x63 ) B A D _ T R A P ( 0 x64 )
BAD_ T R A P ( 0 x65 ) B A D _ T R A P ( 0 x66 ) B A D _ T R A P ( 0 x67 ) B A D _ T R A P ( 0 x68 ) B A D _ T R A P ( 0 x69 )
BAD_ T R A P ( 0 x6 a ) B A D _ T R A P ( 0 x6 b ) B A D _ T R A P ( 0 x6 c ) B A D _ T R A P ( 0 x6 d ) B A D _ T R A P ( 0 x6 e )
BAD_ T R A P ( 0 x6 f ) B A D _ T R A P ( 0 x70 ) B A D _ T R A P ( 0 x71 ) B A D _ T R A P ( 0 x72 ) B A D _ T R A P ( 0 x73 )
BAD_ T R A P ( 0 x74 ) B A D _ T R A P ( 0 x75 ) B A D _ T R A P ( 0 x76 ) B A D _ T R A P ( 0 x77 ) B A D _ T R A P ( 0 x78 )
BAD_ T R A P ( 0 x79 ) B A D _ T R A P ( 0 x7 a ) B A D _ T R A P ( 0 x7 b ) B A D _ T R A P ( 0 x7 c ) B A D _ T R A P ( 0 x7 d )
BAD_ T R A P ( 0 x7 e ) B A D _ T R A P ( 0 x7 f )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x80 )
2005-04-16 15:20:36 -07:00
BREAKPOINT_ T R A P
TRAP_ E N T R Y ( 0 x82 , d o _ h w _ d i v z e r o )
TRAP_ E N T R Y ( 0 x83 , d o _ f l u s h _ w i n d o w s ) B A D _ T R A P ( 0 x84 ) B A D _ T R A P ( 0 x85 )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x86 ) B A D _ T R A P ( 0 x87 ) B A D _ T R A P ( 0 x88 )
BAD_ T R A P ( 0 x89 ) B A D _ T R A P ( 0 x8 a ) B A D _ T R A P ( 0 x8 b ) B A D _ T R A P ( 0 x8 c )
2005-04-16 15:20:36 -07:00
BAD_ T R A P ( 0 x8 d ) B A D _ T R A P ( 0 x8 e ) B A D _ T R A P ( 0 x8 f )
LINUX_ S Y S C A L L _ T R A P B A D _ T R A P ( 0 x91 ) B A D _ T R A P ( 0 x92 ) B A D _ T R A P ( 0 x93 ) B A D _ T R A P ( 0 x94 )
BAD_ T R A P ( 0 x95 ) B A D _ T R A P ( 0 x96 ) B A D _ T R A P ( 0 x97 ) B A D _ T R A P ( 0 x98 ) B A D _ T R A P ( 0 x99 )
BAD_ T R A P ( 0 x9 a ) B A D _ T R A P ( 0 x9 b ) B A D _ T R A P ( 0 x9 c ) B A D _ T R A P ( 0 x9 d ) B A D _ T R A P ( 0 x9 e )
BAD_ T R A P ( 0 x9 f ) G E T C C _ T R A P S E T C C _ T R A P G E T P S R _ T R A P
BAD_ T R A P ( 0 x a3 ) B A D _ T R A P ( 0 x a4 ) B A D _ T R A P ( 0 x a5 ) B A D _ T R A P ( 0 x a6 )
2008-04-20 02:14:23 -07:00
BAD_ T R A P ( 0 x a7 ) B A D _ T R A P ( 0 x a8 ) B A D _ T R A P ( 0 x a9 ) B A D _ T R A P ( 0 x a a ) B A D _ T R A P ( 0 x a b )
2005-04-16 15:20:36 -07:00
BAD_ T R A P ( 0 x a c ) B A D _ T R A P ( 0 x a d ) B A D _ T R A P ( 0 x a e ) B A D _ T R A P ( 0 x a f ) B A D _ T R A P ( 0 x b0 )
BAD_ T R A P ( 0 x b1 ) B A D _ T R A P ( 0 x b2 ) B A D _ T R A P ( 0 x b3 ) B A D _ T R A P ( 0 x b4 ) B A D _ T R A P ( 0 x b5 )
BAD_ T R A P ( 0 x b6 ) B A D _ T R A P ( 0 x b7 ) B A D _ T R A P ( 0 x b8 ) B A D _ T R A P ( 0 x b9 ) B A D _ T R A P ( 0 x b a )
BAD_ T R A P ( 0 x b b ) B A D _ T R A P ( 0 x b c ) B A D _ T R A P ( 0 x b d ) B A D _ T R A P ( 0 x b e ) B A D _ T R A P ( 0 x b f )
BAD_ T R A P ( 0 x c0 ) B A D _ T R A P ( 0 x c1 ) B A D _ T R A P ( 0 x c2 ) B A D _ T R A P ( 0 x c3 ) B A D _ T R A P ( 0 x c4 )
BAD_ T R A P ( 0 x c5 ) B A D _ T R A P ( 0 x c6 ) B A D _ T R A P ( 0 x c7 ) B A D _ T R A P ( 0 x c8 ) B A D _ T R A P ( 0 x c9 )
BAD_ T R A P ( 0 x c a ) B A D _ T R A P ( 0 x c b ) B A D _ T R A P ( 0 x c c ) B A D _ T R A P ( 0 x c d ) B A D _ T R A P ( 0 x c e )
BAD_ T R A P ( 0 x c f ) B A D _ T R A P ( 0 x d0 ) B A D _ T R A P ( 0 x d1 ) B A D _ T R A P ( 0 x d2 ) B A D _ T R A P ( 0 x d3 )
BAD_ T R A P ( 0 x d4 ) B A D _ T R A P ( 0 x d5 ) B A D _ T R A P ( 0 x d6 ) B A D _ T R A P ( 0 x d7 ) B A D _ T R A P ( 0 x d8 )
BAD_ T R A P ( 0 x d9 ) B A D _ T R A P ( 0 x d a ) B A D _ T R A P ( 0 x d b ) B A D _ T R A P ( 0 x d c ) B A D _ T R A P ( 0 x d d )
BAD_ T R A P ( 0 x d e ) B A D _ T R A P ( 0 x d f ) B A D _ T R A P ( 0 x e 0 ) B A D _ T R A P ( 0 x e 1 ) B A D _ T R A P ( 0 x e 2 )
BAD_ T R A P ( 0 x e 3 ) B A D _ T R A P ( 0 x e 4 ) B A D _ T R A P ( 0 x e 5 ) B A D _ T R A P ( 0 x e 6 ) B A D _ T R A P ( 0 x e 7 )
BAD_ T R A P ( 0 x e 8 ) B A D _ T R A P ( 0 x e 9 ) B A D _ T R A P ( 0 x e a ) B A D _ T R A P ( 0 x e b ) B A D _ T R A P ( 0 x e c )
BAD_ T R A P ( 0 x e d ) B A D _ T R A P ( 0 x e e ) B A D _ T R A P ( 0 x e f ) B A D _ T R A P ( 0 x f0 ) B A D _ T R A P ( 0 x f1 )
BAD_ T R A P ( 0 x f2 ) B A D _ T R A P ( 0 x f3 ) B A D _ T R A P ( 0 x f4 ) B A D _ T R A P ( 0 x f5 ) B A D _ T R A P ( 0 x f6 )
BAD_ T R A P ( 0 x f7 ) B A D _ T R A P ( 0 x f8 ) B A D _ T R A P ( 0 x f9 ) B A D _ T R A P ( 0 x f a ) B A D _ T R A P ( 0 x f b )
2008-04-29 02:38:50 -07:00
BAD_ T R A P ( 0 x f c ) K G D B _ T R A P ( 0 x f d ) B A D _ T R A P ( 0 x f e ) B A D _ T R A P ( 0 x f f )
2005-04-16 15:20:36 -07:00
# endif
.align PAGE_SIZE
/ * This w a s t h e o n l y r e a s o n a b l e w a y I c o u l d t h i n k o f t o p r o p e r l y a l i g n
* these p a g e - t a b l e d a t a s t r u c t u r e s .
* /
.globl pg0 , p g 1 , p g 2 , p g 3
.globl empty_bad_page
.globl empty_bad_page_table
.globl empty_zero_page
.globl swapper_pg_dir
swapper_pg_dir : .skip P A G E _ S I Z E
pg0 : .skip P A G E _ S I Z E
pg1 : .skip P A G E _ S I Z E
pg2 : .skip P A G E _ S I Z E
pg3 : .skip P A G E _ S I Z E
empty_bad_page : .skip P A G E _ S I Z E
empty_bad_page_table : .skip P A G E _ S I Z E
empty_zero_page : .skip P A G E _ S I Z E
.global root_flags
.global ram_flags
.global root_dev
.global sparc_ramdisk_image
.global sparc_ramdisk_size
/ * This s t u f f h a s t o b e i n s y n c w i t h S I L O a n d o t h e r p o t e n t i a l b o o t l o a d e r s
* Fields s h o u l d b e k e p t u p w a r d c o m p a t i b l e a n d w h e n e v e r a n y c h a n g e i s m a d e ,
* HdrS v e r s i o n s h o u l d b e i n c r e m e n t e d .
* /
.ascii " HdrS"
.word LINUX_VERSION_CODE
.half 0x0203 /* HdrS version */
root_flags :
.half 1
root_dev :
.half 0
ram_flags :
.half 0
sparc_ramdisk_image :
.word 0
sparc_ramdisk_size :
.word 0
.word reboot_command
.word 0 , 0 , 0
.word _end
/ * Cool, h e r e w e g o . P i c k u p t h e r o m v e c p o i n t e r i n % o 0 a n d s t a s h i t i n
* % g7 a n d a t p r o m _ v e c t o r _ p . A n d a l s o q u i c k l y c h e c k w h e t h e r w e a r e o n
* a v0 , v2 , o r v3 p r o m .
* /
gokernel :
/ * Ok, i t ' s n i c e t o k n o w , a s e a r l y a s p o s s i b l e , i f w e
* are a l r e a d y m a p p e d w h e r e w e e x p e c t t o b e i n v i r t u a l
* memory. T h e S o l a r i s / b o o t e l f f o r m a t b o o t l o a d e r
* will p e e k i n t o o u r e l f h e a d e r a n d l o a d u s w h e r e
* we w a n t t o b e , o t h e r w i s e w e h a v e t o r e - m a p .
*
* Some b o o t l o a d e r s d o n ' t p l a c e t h e j m p ' r s a d d r e s s
* in % o 7 , s o w e d o a p c - r e l a t i v e c a l l t o a l o c a l
* label, t h e n s e e w h a t % o 7 h a s .
* /
mov % o 7 , % g 4 ! S a v e % o 7
/* Jump to it, and pray... */
current_pc :
call 1 f
nop
1 :
mov % o 7 , % g 3
tst % o 0
be n o _ s u n 4 u _ h e r e
mov % g 4 , % o 7 / * P r e v i o u s % o 7 . * /
mov % o 0 , % l 0 ! s t a s h a w a y r o m v e c
mov % o 0 , % g 7 ! p u t i t h e r e t o o
mov % o 1 , % l 1 ! s t a s h a w a y d e b u g _ v e c t o o
/* Ok, let's check out our run time program counter. */
set c u r r e n t _ p c , % g 5
cmp % g 3 , % g 5
be a l r e a d y _ m a p p e d
nop
/ * % l6 w i l l h o l d t h e o f f s e t w e h a v e t o s u b t r a c t
* from a b s o l u t e s y m b o l s i n o r d e r t o a c c e s s a r e a s
* in o u r o w n i m a g e . I f a l r e a d y m a p p e d t h i s i s
* just p l a i n z e r o , e l s e i t i s K E R N B A S E .
* /
set K E R N B A S E , % l 6
b c o p y _ p r o m _ l v l 1 4
nop
already_mapped :
mov 0 , % l 6
/* Copy over the Prom's level 14 clock handler. */
copy_prom_lvl14 :
# if 1
/ * DJHR
* preserve o u r l i n k e d / c a l c u l a t e d i n s t r u c t i o n s
* /
set l v l 1 4 _ s a v e , % g 1
set t _ i r q14 , % g 3
sub % g 1 , % l 6 , % g 1 ! t r a n s l a t e t o p h y s i c a l
sub % g 3 , % l 6 , % g 3 ! t r a n s l a t e t o p h y s i c a l
ldd [ % g 3 ] , % g 4
std % g 4 , [ % g 1 ]
ldd [ % g 3 + 8 ] , % g 4
std % g 4 , [ % g 1 + 8 ]
# endif
rd % t b r , % g 1
andn % g 1 , 0 x f f f , % g 1 ! p r o m s t r a p t a b l e b a s e
or % g 0 , ( 0 x1 e < < 4 ) , % g 2 ! o f f s e t t o l v l 1 4 i n t r
or % g 1 , % g 2 , % g 2
set t _ i r q14 , % g 3
sub % g 3 , % l 6 , % g 3
ldd [ % g 2 ] , % g 4
std % g 4 , [ % g 3 ]
ldd [ % g 2 + 0 x8 ] , % g 4
std % g 4 , [ % g 3 + 0 x8 ] ! C o p y p r o m s h a n d l e r
/ * Must d e t e r m i n e w h e t h e r w e a r e o n a s u n 4 c M M U , S R M M U , o r S U N 4 / 4 0 0 M U T A N T
* MMU s o w e c a n r e m a p o u r s e l v e s p r o p e r l y . D O N ' T T O U C H % l 0 t h r u % l 5 i n t h e s e
* remapping r o u t i n e s , w e n e e d t h e i r v a l u e s a f t e r w a r d s !
* /
/ * Now c h e c k w h e t h e r w e a r e a l r e a d y m a p p e d , i f w e
* are w e c a n s k i p a l l t h i s g a r b a g e c o m i n g u p .
* /
copy_prom_done :
cmp % l 6 , 0
be g o _ t o _ h i g h m e m ! t h i s w i l l b e a n o p t h e n
nop
set L O A D _ A D D R , % g 6
cmp % g 7 , % g 6
bne r e m a p _ n o t _ a _ s u n 4 ! T h i s i s n o t a S u n 4
nop
or % g 0 , 0 x1 , % g 1
lduba [ % g 1 ] A S I _ C O N T R O L , % g 1 ! O n l y s a f e t o t r y o n S u n 4 .
subcc % g 1 , 0 x24 , % g 0 ! I s t h i s a m u t a n t S u n 4 / 4 0 0 ? ? ?
be s u n 4 _ m u t a n t _ r e m a p ! U g h , i t i s . . .
nop
b s u n 4 _ n o r m a l _ r e m a p ! r e g u l a r s u n 4 , 2 l e v e l m m u
nop
remap_not_a_sun4 :
lda [ % g 0 ] A S I _ M _ M M U R E G S , % g 1 ! s a m e a s A S I _ P T E o n s u n 4 c
and % g 1 , 0 x1 , % g 1 ! T e s t S R M M U E n a b l e b i t ;-)
cmp % g 1 , 0 x0
be s u n 4 c _ r e m a p ! A s u n 4 c M M U o r n o r m a l S u n 4
nop
srmmu_remap :
/* First, check for a viking (TI) module. */
set 0 x40 0 0 0 0 0 0 , % g 2
rd % p s r , % g 3
and % g 2 , % g 3 , % g 3
subcc % g 3 , 0 x0 , % g 0
bz s r m m u _ n v i k i n g
nop
/ * Figure o u t w h a t k i n d o f v i k i n g w e a r e o n .
* We n e e d t o k n o w i f w e h a v e t o p l a y w i t h t h e
* AC b i t a n d d i s a b l e t r a p s o r n o t .
* /
/ * I' v e o n l y s e e n M i c r o S p a r c ' s o n S p a r c C l a s s i c s w i t h t h i s
* bit s e t .
* /
set 0 x80 0 , % g 2
lda [ % g 0 ] A S I _ M _ M M U R E G S , % g 3 ! p e e k i n t h e c o n t r o l r e g
and % g 2 , % g 3 , % g 3
subcc % g 3 , 0 x0 , % g 0
bnz s r m m u _ n v i k i n g ! i s i n m b u s m o d e
nop
rd % p s r , % g 3 ! D O N O T T O U C H % g 3
andn % g 3 , P S R _ E T , % g 2
wr % g 2 , 0 x0 , % p s r
WRITE_ P A U S E
/ * Get c o n t e x t t a b l e p o i n t e r , t h e n c o n v e r t t o
* a p h y s i c a l a d d r e s s , w h i c h i s 3 6 b i t s .
* /
set A C _ M _ C T P R , % g 4
lda [ % g 4 ] A S I _ M _ M M U R E G S , % g 4
sll % g 4 , 0 x4 , % g 4 ! W e u s e t h i s b e l o w
! DO N O T T O U C H % g 4
/* Set the AC bit in the Viking's MMU control reg. */
lda [ % g 0 ] A S I _ M _ M M U R E G S , % g 5 ! D O N O T T O U C H % g 5
set 0 x80 0 0 , % g 6 ! A C b i t m a s k
or % g 5 , % g 6 , % g 6 ! O r i t i n . . .
sta % g 6 , [ % g 0 ] A S I _ M _ M M U R E G S ! C l o s e y o u r e y e s . . .
/ * Grrr, w h y d o e s i t s e e m l i k e e v e r y o t h e r l o a d / s t o r e
* on t h e s u n 4 m i s i n s o m e A S I s p a c e . . .
* Fine w i t h m e , l e t ' s g e t t h e p o i n t e r t o t h e l e v e l 1
* page t a b l e d i r e c t o r y a n d f e t c h i t s e n t r y .
* /
lda [ % g 4 ] A S I _ M _ B Y P A S S , % o 1 ! T h i s i s a l e v e l 1 p t r
srl % o 1 , 0 x4 , % o 1 ! C l e a r l o w 4 b i t s
sll % o 1 , 0 x8 , % o 1 ! M a k e p h y s i c a l
/* Ok, pull in the PTD. */
lda [ % o 1 ] A S I _ M _ B Y P A S S , % o 2 ! T h i s i s t h e 0 x0 1 6 M B p g d
/* Calculate to KERNBASE entry. */
add % o 1 , K E R N B A S E > > ( S R M M U _ P G D I R _ S H I F T - 2 ) , % o 3
/* Poke the entry into the calculated address. */
sta % o 2 , [ % o 3 ] A S I _ M _ B Y P A S S
/ * I d o n ' t g e t i t S u n , i f y o u e n g i n e e r e d a l l t h e s e
* boot l o a d e r s a n d t h e P R O M ( t h a n k y o u f o r t h e d e b u g g i n g
* features b t w ) w h y d i d y o u n o t h a v e t h e m l o a d k e r n e l
* images u p i n h i g h a d d r e s s s p a c e , s i n c e t h i s i s n e c e s s a r y
* for A B I c o m p l i a n c e a n y w a y s ? D o e s t h i s l o w - m a p p i n g p r o v i d e
* enhanced i n t e r o p e r a b i l i t y ?
*
* " The P R O M i s t h e c o m p u t e r . "
* /
/* Ok, restore the MMU control register we saved in %g5 */
sta % g 5 , [ % g 0 ] A S I _ M _ M M U R E G S ! P O W . . . o u c h
/* Turn traps back on. We saved it in %g3 earlier. */
wr % g 3 , 0 x0 , % p s r ! t i c k t o c k , t i c k t o c k
/* Now we burn precious CPU cycles due to bad engineering. */
WRITE_ P A U S E
/ * Wow, a l l t h a t j u s t t o m o v e a 3 2 - b i t v a l u e f r o m o n e
* place t o a n o t h e r . . . J u m p t o h i g h m e m o r y .
* /
b g o _ t o _ h i g h m e m
nop
/ * This w o r k s o n v i k i n g ' s i n M b u s m o d e a n d a l l
* other M B U S m o d u l e s . I t i s v i r t u a l l y t h e s a m e a s
* the a b o v e m a d n e s s s a n s t u r n i n g t r a p s o f f a n d f l i p p i n g
* the A C b i t .
* /
srmmu_nviking :
set A C _ M _ C T P R , % g 1
lda [ % g 1 ] A S I _ M _ M M U R E G S , % g 1 ! g e t c t x t a b l e p t r
sll % g 1 , 0 x4 , % g 1 ! m a k e p h y s i c a l a d d r
lda [ % g 1 ] A S I _ M _ B Y P A S S , % g 1 ! p t r t o l e v e l 1 p g _ t a b l e
srl % g 1 , 0 x4 , % g 1
sll % g 1 , 0 x8 , % g 1 ! m a k e p h y s a d d r f o r l 1 t b l
lda [ % g 1 ] A S I _ M _ B Y P A S S , % g 2 ! g e t l e v e l 1 e n t r y f o r 0 x0
add % g 1 , K E R N B A S E > > ( S R M M U _ P G D I R _ S H I F T - 2 ) , % g 3
sta % g 2 , [ % g 3 ] A S I _ M _ B Y P A S S ! p l a c e a t K E R N B A S E e n t r y
b g o _ t o _ h i g h m e m
nop ! w h e e e . . . .
/ * This r e m a p s t h e k e r n e l o n S u n 4 / 4 x x m a c h i n e s
* that h a v e t h e S u n M u t a n t T h r e e L e v e l M M U .
* It' s l i k e a p l a t y p u s , S u n d i d n ' t h a v e t h e
* SRMMU i n c o n c e p t i o n s o t h e y k l u d g e d t h e t h r e e
* level l o g i c i n t h e r e g u l a r S u n 4 M M U p r o b a b l y .
*
* Basically, y o u t a k e e a c h e n t r y i n t h e t o p l e v e l
* directory t h a t m a p s t h e l o w 3 M B s t a r t i n g a t
* address z e r o a n d p u t t h e m a p p i n g i n t h e K E R N B A S E
* slots. T h e s e t o p l e v e l p g d ' s a r e c a l l e d r e g m a p s .
* /
sun4_mutant_remap :
or % g 0 , % g 0 , % g 3 ! s o u r c e b a s e
sethi % h i ( K E R N B A S E ) , % g 4 ! d e s t i n a t i o n b a s e
or % g 4 , % l o ( K E R N B A S E ) , % g 4
sethi % h i ( 0 x30 0 0 0 0 ) , % g 5
or % g 5 , % l o ( 0 x30 0 0 0 0 ) , % g 5 ! u p p e r b o u n d 3 M B
or % g 0 , 0 x1 , % l 6
sll % l 6 , 2 4 , % l 6 ! R e g m a p m a p p i n g s i z e
add % g 3 , 0 x2 , % g 3 ! B a s e m a g i c
add % g 4 , 0 x2 , % g 4 ! B a s e m a g i c
/ * Main r e m a p p i n g l o o p o n S u n 4 - M u t a n t - M M U .
* " I a m n o t a n a n i m a l . . . " - F a m o u s M u t a n t P e r s o n
* /
sun4_mutant_loop :
lduha [ % g 3 ] A S I _ R E G M A P , % g 2 ! G e t l o w e r e n t r y
stha % g 2 , [ % g 4 ] A S I _ R E G M A P ! S t o r e i n h i g h e n t r y
add % g 4 , % l 6 , % g 4 ! M o v e u p h i g h m e m o r y p t r
subcc % g 3 , % g 5 , % g 0 ! R e a c h e d o u r l i m i t ?
blu s u n 4 _ m u t a n t _ l o o p ! N o p e , l o o p a g a i n
add % g 3 , % l 6 , % g 3 ! d e l a y , M o v e u p l o w p t r
b g o _ t o _ h i g h m e m ! J u m p t o h i g h m e m o r y .
nop
/* The following is for non-4/4xx sun4 MMU's. */
sun4_normal_remap :
mov 0 , % g 3 ! s o u r c e b a s e
set K E R N B A S E , % g 4 ! d e s t i n a t i o n b a s e
set 0 x30 0 0 0 0 , % g 5 ! u p p e r b o u n d 3 M B
mov 1 , % l 6
sll % l 6 , 1 8 , % l 6 ! s u n 4 m m u s e g m a p s i z e
sun4_normal_loop :
lduha [ % g 3 ] A S I _ S E G M A P , % g 6 ! l o a d p h y s _ s e g
stha % g 6 , [ % g 4 ] A S I _ S E G M A P ! s t o r t n e w v i r t m a p p i n g
add % g 3 , % l 6 , % g 3 ! i n c r e m e n t s o u r c e p o i n t e r
subcc % g 3 , % g 5 , % g 0 ! r e a c h e d l i m i t ?
blu s u n 4 _ n o r m a l _ l o o p ! n o p e , l o o p a g a i n
add % g 4 , % l 6 , % g 4 ! d e l a y , i n c r e m e n t d e s t p t r
b g o _ t o _ h i g h m e m
nop
/* The following works for Sun4c MMU's */
sun4c_remap :
mov 0 , % g 3 ! s o u r c e b a s e
set K E R N B A S E , % g 4 ! d e s t i n a t i o n b a s e
set 0 x30 0 0 0 0 , % g 5 ! u p p e r b o u n d 3 M B
mov 1 , % l 6
sll % l 6 , 1 8 , % l 6 ! s u n 4 c m m u s e g m a p s i z e
sun4c_remap_loop :
lda [ % g 3 ] A S I _ S E G M A P , % g 6 ! l o a d p h y s _ s e g
sta % g 6 , [ % g 4 ] A S I _ S E G M A P ! s t o r e n e w v i r t m a p p i n g
add % g 3 , % l 6 , % g 3 ! I n c r e m e n t s o u r c e p t r
subcc % g 3 , % g 5 , % g 0 ! R e a c h e d l i m i t ?
bl s u n 4 c _ r e m a p _ l o o p ! N o p e , l o o p a g a i n
add % g 4 , % l 6 , % g 4 ! d e l a y , I n c r e m e n t d e s t p t r
/* Now do a non-relative jump so that PC is in high-memory */
go_to_highmem :
set e x e c u t e _ i n _ h i g h _ m e m , % g 1
jmpl % g 1 , % g 0
nop
/ * The c o d e a b o v e s h o u l d b e a t b e g i n n i n g a n d w e h a v e t o t a k e c a r e a b o u t
2009-04-27 14:02:26 -04:00
* short j u m p s , a s b r a n c h i n g t o . i n i t . t e x t s e c t i o n f r o m . t e x t i s u s u a l l y
2005-04-16 15:20:36 -07:00
* impossible * /
_ _ INIT
/ * Acquire b o o t t i m e p r i v i l e g e d r e g i s t e r v a l u e s , t h i s w i l l h e l p d e b u g g i n g .
* I f i g u r e o u t a n d s t o r e n w i n d o w s a n d n w i n d o w s m 1 l a t e r o n .
* /
execute_in_high_mem :
mov % l 0 , % o 0 ! p u t b a c k r o m v e c
mov % l 1 , % o 1 ! a n d d e b u g _ v e c
sethi % h i ( p r o m _ v e c t o r _ p ) , % g 1
st % o 0 , [ % g 1 + % l o ( p r o m _ v e c t o r _ p ) ]
sethi % h i ( l i n u x _ d b v e c ) , % g 1
st % o 1 , [ % g 1 + % l o ( l i n u x _ d b v e c ) ]
ld [ % o 0 + 0 x4 ] , % o 3
and % o 3 , 0 x3 , % o 5 ! g e t t h e v e r s i o n
cmp % o 3 , 0 x2 ! a v2 p r o m ?
be f o u n d _ v e r s i o n
nop
/* paul@sfe.com.au */
cmp % o 3 , 0 x3 ! a v3 p r o m ?
be f o u n d _ v e r s i o n
nop
/ * Old s u n 4 ' s p a s s o u r l o a d a d d r e s s i n t o % o 0 i n s t e a d o f t h e p r o m
* pointer. O n s u n 4 ' s y o u h a v e t o h a r d c o d e t h e r o m v e c p o i n t e r i n t o
* your c o d e . S u n p r o b a b l y s t i l l d o e s t h a t b e c a u s e t h e y d o n ' t e v e n
* trust t h e i r o w n " O p e n B o o t " s p e c i f i c a t i o n s .
* /
set L O A D _ A D D R , % g 6
cmp % o 0 , % g 6 ! a n o l d s u n 4 ?
be s u n 4 _ i n i t
nop
found_version :
/* Get the machine type via the mysterious romvec node operations. */
add % g 7 , 0 x1 c , % l 1
ld [ % l 1 ] , % l 0
ld [ % l 0 ] , % l 0
call % l 0
or % g 0 , % g 0 , % o 0 ! n e x t _ n o d e ( 0 ) = f i r s t _ n o d e
or % o 0 , % g 0 , % g 6
sethi % h i ( c p u t y p v a r ) , % o 1 ! F i r s t n o d e h a s c p u - a r c h
or % o 1 , % l o ( c p u t y p v a r ) , % o 1
sethi % h i ( c p u t y p v a l ) , % o 2 ! i n f o r m a t i o n , t h e s t r i n g
or % o 2 , % l o ( c p u t y p v a l ) , % o 2
ld [ % l 1 ] , % l 0 ! ' c o m p a t i b i l i t y ' t e l l s
ld [ % l 0 + 0 x c ] , % l 0 ! t h a t w e w a n t ' s u n 4 x ' w h e r e
call % l 0 ! x i s o n e o f ' ' , ' c ' , ' m ' ,
nop ! ' d ' o r ' e ' . % o 2 h o l d s p o i n t e r
! to a b u f w h e r e a b o v e s t r i n g
! will g e t s t o r e d b y t h e p r o m .
subcc % o 0 , % g 0 , % g 0
bpos g o t _ p r o p ! G o t t h e p r o p e r t y
nop
or % g 6 , % g 0 , % o 0
sethi % h i ( c p u t y p v a r _ s u n 4 m ) , % o 1
or % o 1 , % l o ( c p u t y p v a r _ s u n 4 m ) , % o 1
sethi % h i ( c p u t y p v a l ) , % o 2
or % o 2 , % l o ( c p u t y p v a l ) , % o 2
ld [ % l 1 ] , % l 0
ld [ % l 0 + 0 x c ] , % l 0
call % l 0
nop
got_prop :
set c p u t y p v a l , % o 2
ldub [ % o 2 + 0 x4 ] , % l 1
cmp % l 1 , ' '
be 1 f
cmp % l 1 , ' c '
be 1 f
cmp % l 1 , ' m '
be 1 f
cmp % l 1 , ' s '
be 1 f
cmp % l 1 , ' d '
be 1 f
cmp % l 1 , ' e '
be n o _ s u n 4 e _ h e r e ! C o u l d b e a s u n 4 e .
nop
b n o _ s u n 4 u _ h e r e ! A I E E E , a V 9 s u n 4 u . . . G e t o u r B I G B R O T H E R k e r n e l : ) )
nop
1 : set c p u t y p v a l , % l 1
ldub [ % l 1 + 0 x4 ] , % l 1
cmp % l 1 , ' m ' ! T e s t f o r s u n 4 d , s u n 4 e ?
be s u n 4 m _ i n i t
cmp % l 1 , ' s ' ! T r e a t s u n 4 s a s s u n 4 m
be s u n 4 m _ i n i t
cmp % l 1 , ' d ' ! L e t u s s e e h o w t h e b e a s t w i l l d i e
be s u n 4 d _ i n i t
nop
/* Jump into mmu context zero. */
set A C _ C O N T E X T , % g 1
stba % g 0 , [ % g 1 ] A S I _ C O N T R O L
b s u n 4 c _ c o n t i n u e _ b o o t
nop
/* CPUID in bootbus can be found at PA 0xff0140000 */
# define S U N 4 D _ B O O T B U S _ C P U I D 0 x f01 4 0 0 0 0
sun4d_init :
/* Need to patch call to handler_irq */
set p a t c h _ h a n d l e r _ i r q , % g 4
set s u n 4 d _ h a n d l e r _ i r q , % g 5
sethi % h i ( 0 x40 0 0 0 0 0 0 ) , % g 3 ! c a l l
sub % g 5 , % g 4 , % g 5
srl % g 5 , 2 , % g 5
or % g 5 , % g 3 , % g 5
st % g 5 , [ % g 4 ]
# ifdef C O N F I G _ S M P
/* Get our CPU id out of bootbus */
set S U N 4 D _ B O O T B U S _ C P U I D , % g 3
lduba [ % g 3 ] A S I _ M _ C T L , % g 3
and % g 3 , 0 x f8 , % g 3
srl % g 3 , 3 , % g 4
sta % g 4 , [ % g 0 ] A S I _ M _ V I K I N G _ T M P 1
sethi % h i ( b o o t _ c p u _ i d ) , % g 5
stb % g 4 , [ % g 5 + % l o ( b o o t _ c p u _ i d ) ]
sll % g 4 , 2 , % g 4
sethi % h i ( b o o t _ c p u _ i d4 ) , % g 5
stb % g 4 , [ % g 5 + % l o ( b o o t _ c p u _ i d4 ) ]
# endif
/* Fall through to sun4m_init */
sun4m_init :
/* XXX Fucking Cypress... */
lda [ % g 0 ] A S I _ M _ M M U R E G S , % g 5
srl % g 5 , 2 8 , % g 4
cmp % g 4 , 1
bne 1 f
srl % g 5 , 2 4 , % g 4
and % g 4 , 0 x f , % g 4
cmp % g 4 , 7 / * T h i s w o u l d b e a H y p e r S p a r c . * /
bne 2 f
nop
1 :
# define P A T C H _ I T ( d s t , s r c ) \
set ( d s t ) , % g 5 ; \
set ( s r c ) , % g 4 ; \
ld [ % g 4 ] , % g 3 ; \
st % g 3 , [ % g 5 ] ; \
ld [ % g 4 + 0 x4 ] , % g 3 ; \
st % g 3 , [ % g 5 + 0 x4 ] ;
/* Signed multiply. */
PATCH_ I T ( . m u l , . m u l _ p a t c h )
PATCH_ I T ( . m u l + 0 x08 , . m u l _ p a t c h + 0 x08 )
/* Signed remainder. */
PATCH_ I T ( . r e m , . r e m _ p a t c h )
PATCH_ I T ( . r e m + 0 x08 , . r e m _ p a t c h + 0 x08 )
PATCH_ I T ( . r e m + 0 x10 , . r e m _ p a t c h + 0 x10 )
PATCH_ I T ( . r e m + 0 x18 , . r e m _ p a t c h + 0 x18 )
PATCH_ I T ( . r e m + 0 x20 , . r e m _ p a t c h + 0 x20 )
PATCH_ I T ( . r e m + 0 x28 , . r e m _ p a t c h + 0 x28 )
/* Signed division. */
PATCH_ I T ( . d i v , . d i v _ p a t c h )
PATCH_ I T ( . d i v + 0 x08 , . d i v _ p a t c h + 0 x08 )
PATCH_ I T ( . d i v + 0 x10 , . d i v _ p a t c h + 0 x10 )
PATCH_ I T ( . d i v + 0 x18 , . d i v _ p a t c h + 0 x18 )
PATCH_ I T ( . d i v + 0 x20 , . d i v _ p a t c h + 0 x20 )
/* Unsigned multiply. */
PATCH_ I T ( . u m u l , . u m u l _ p a t c h )
PATCH_ I T ( . u m u l + 0 x08 , . u m u l _ p a t c h + 0 x08 )
/* Unsigned remainder. */
PATCH_ I T ( . u r e m , . u r e m _ p a t c h )
PATCH_ I T ( . u r e m + 0 x08 , . u r e m _ p a t c h + 0 x08 )
PATCH_ I T ( . u r e m + 0 x10 , . u r e m _ p a t c h + 0 x10 )
PATCH_ I T ( . u r e m + 0 x18 , . u r e m _ p a t c h + 0 x18 )
/* Unsigned division. */
PATCH_ I T ( . u d i v , . u d i v _ p a t c h )
PATCH_ I T ( . u d i v + 0 x08 , . u d i v _ p a t c h + 0 x08 )
PATCH_ I T ( . u d i v + 0 x10 , . u d i v _ p a t c h + 0 x10 )
# undef P A T C H _ I T
/ * Ok, t h e P R O M c o u l d h a v e d o n e f u n n y t h i n g s a n d a p p l e c i d e r c o u l d s t i l l
* be s i t t i n g i n t h e f a u l t s t a t u s / a d d r e s s r e g i s t e r s . R e a d t h e m a l l t o
* clear t h e m s o w e d o n ' t g e t m a g i c f a u l t s l a t e r o n .
* /
/* This sucks, apparently this makes Vikings call prom panic, will fix later */
2 :
rd % p s r , % o 1
srl % o 1 , 2 8 , % o 1 ! G e t a t y p e o f t h e C P U
subcc % o 1 , 4 , % g 0 ! T I : V i k i n g o r M i c r o S P A R C
be s u n 4 c _ c o n t i n u e _ b o o t
nop
set A C _ M _ S F S R , % o 0
lda [ % o 0 ] A S I _ M _ M M U R E G S , % g 0
set A C _ M _ S F A R , % o 0
lda [ % o 0 ] A S I _ M _ M M U R E G S , % g 0
/* Fujitsu MicroSPARC-II has no asynchronous flavors of FARs */
subcc % o 1 , 0 , % g 0
be s u n 4 c _ c o n t i n u e _ b o o t
nop
set A C _ M _ A F S R , % o 0
lda [ % o 0 ] A S I _ M _ M M U R E G S , % g 0
set A C _ M _ A F A R , % o 0
lda [ % o 0 ] A S I _ M _ M M U R E G S , % g 0
nop
sun4c_continue_boot :
/ * Aieee, n o w s e t P C a n d n P C , e n a b l e t r a p s , g i v e o u r s e l v e s a s t a c k a n d i t ' s
* show- t i m e !
* /
sethi % h i ( c p u t y p ) , % o 0
st % g 4 , [ % o 0 + % l o ( c p u t y p ) ]
/ * Turn o n S u p e r v i s o r , E n a b l e F l o a t i n g , a n d a l l t h e P I L b i t s .
* Also p u t s u s i n r e g i s t e r w i n d o w z e r o w i t h t r a p s o f f .
* /
set ( P S R _ P S | P S R _ S | P S R _ P I L | P S R _ E F ) , % g 2
wr % g 2 , 0 x0 , % p s r
WRITE_ P A U S E
/* I want a kernel stack NOW! */
set i n i t _ t h r e a d _ u n i o n , % g 1
set ( T H R E A D _ S I Z E - S T A C K F R A M E _ S Z ) , % g 2
add % g 1 , % g 2 , % s p
mov 0 , % f p / * A n d f o r g o o d l u c k * /
/* Zero out our BSS section. */
set _ _ b s s _ s t a r t , % o 0 ! F i r s t a d d r e s s o f B S S
2008-12-27 00:35:12 -08:00
set _ e n d , % o 1 ! L a s t a d d r e s s o f B S S
2005-04-16 15:20:36 -07:00
add % o 0 , 0 x1 , % o 0
1 :
stb % g 0 , [ % o 0 ]
subcc % o 0 , % o 1 , % g 0
bl 1 b
add % o 0 , 0 x1 , % o 0
/ * Initialize t h e u w i n m a s k v a l u e f o r i n i t t a s k j u s t i n c a s e .
* But f i r s t m a k e c u r r e n t _ s e t [ b o o t _ c p u _ i d ] p o i n t t o s o m e t h i n g u s e f u l .
* /
set i n i t _ t h r e a d _ u n i o n , % g 6
set c u r r e n t _ s e t , % g 2
# ifdef C O N F I G _ S M P
sethi % h i ( b o o t _ c p u _ i d4 ) , % g 3
ldub [ % g 3 + % l o ( b o o t _ c p u _ i d4 ) ] , % g 3
st % g 6 , [ % g 2 ]
add % g 2 , % g 3 , % g 2
# endif
st % g 6 , [ % g 2 ]
st % g 0 , [ % g 6 + T I _ U W I N M A S K ]
/ * Compute N W I N D O W S a n d s t a s h i t a w a y . N o w u s e s % w i m t r i c k e x p l a i n e d
* in t h e V 8 m a n u a l . O k , t h i s m e t h o d s e e m s t o w o r k , S p a r c i s c o o l . . .
* No, i t d o e s n ' t w o r k , h a v e t o p l a y t h e s a v e / r e a d C W P / r e s t o r e t r i c k .
* /
wr % g 0 , 0 x0 , % w i m ! s o w e d o n o t g e t a t r a p
WRITE_ P A U S E
save
rd % p s r , % g 3
restore
and % g 3 , 0 x1 f , % g 3
add % g 3 , 0 x1 , % g 3
mov 2 , % g 1
wr % g 1 , 0 x0 , % w i m ! m a k e w i n d o w 1 i n v a l i d
WRITE_ P A U S E
cmp % g 3 , 0 x7
bne 2 f
nop
/ * Adjust o u r w i n d o w h a n d l i n g r o u t i n e s t o
* do t h i n g s c o r r e c t l y o n 7 w i n d o w S p a r c s .
* /
# define P A T C H _ I N S N ( s r c , d e s t ) \
set s r c , % g 5 ; \
set d e s t , % g 2 ; \
ld [ % g 5 ] , % g 4 ; \
st % g 4 , [ % g 2 ] ;
/* Patch for window spills... */
PATCH_ I N S N ( s p n w i n _ p a t c h1 _ 7 w i n , s p n w i n _ p a t c h1 )
PATCH_ I N S N ( s p n w i n _ p a t c h2 _ 7 w i n , s p n w i n _ p a t c h2 )
PATCH_ I N S N ( s p n w i n _ p a t c h3 _ 7 w i n , s p n w i n _ p a t c h3 )
/* Patch for window fills... */
PATCH_ I N S N ( f n w i n _ p a t c h1 _ 7 w i n , f n w i n _ p a t c h1 )
PATCH_ I N S N ( f n w i n _ p a t c h2 _ 7 w i n , f n w i n _ p a t c h2 )
/* Patch for trap entry setup... */
PATCH_ I N S N ( t s e t u p _ 7 w i n _ p a t c h1 , t s e t u p _ p a t c h1 )
PATCH_ I N S N ( t s e t u p _ 7 w i n _ p a t c h2 , t s e t u p _ p a t c h2 )
PATCH_ I N S N ( t s e t u p _ 7 w i n _ p a t c h3 , t s e t u p _ p a t c h3 )
PATCH_ I N S N ( t s e t u p _ 7 w i n _ p a t c h4 , t s e t u p _ p a t c h4 )
PATCH_ I N S N ( t s e t u p _ 7 w i n _ p a t c h5 , t s e t u p _ p a t c h5 )
PATCH_ I N S N ( t s e t u p _ 7 w i n _ p a t c h6 , t s e t u p _ p a t c h6 )
/* Patch for returning from traps... */
PATCH_ I N S N ( r t r a p _ 7 w i n _ p a t c h1 , r t r a p _ p a t c h1 )
PATCH_ I N S N ( r t r a p _ 7 w i n _ p a t c h2 , r t r a p _ p a t c h2 )
PATCH_ I N S N ( r t r a p _ 7 w i n _ p a t c h3 , r t r a p _ p a t c h3 )
PATCH_ I N S N ( r t r a p _ 7 w i n _ p a t c h4 , r t r a p _ p a t c h4 )
PATCH_ I N S N ( r t r a p _ 7 w i n _ p a t c h5 , r t r a p _ p a t c h5 )
/* Patch for killing user windows from the register file. */
PATCH_ I N S N ( k u w _ p a t c h1 _ 7 w i n , k u w _ p a t c h1 )
/ * Now p a t c h t h e k e r n e l w i n d o w f l u s h s e q u e n c e s .
* This s a v e s 2 t r a p s o n e v e r y s w i t c h a n d f o r k .
* /
set 0 x01 0 0 0 0 0 0 , % g 4
set f l u s h _ p a t c h _ o n e , % g 5
st % g 4 , [ % g 5 + 0 x18 ]
st % g 4 , [ % g 5 + 0 x1 c ]
set f l u s h _ p a t c h _ t w o , % g 5
st % g 4 , [ % g 5 + 0 x18 ]
st % g 4 , [ % g 5 + 0 x1 c ]
set f l u s h _ p a t c h _ t h r e e , % g 5
st % g 4 , [ % g 5 + 0 x18 ]
st % g 4 , [ % g 5 + 0 x1 c ]
set f l u s h _ p a t c h _ f o u r , % g 5
st % g 4 , [ % g 5 + 0 x18 ]
st % g 4 , [ % g 5 + 0 x1 c ]
set f l u s h _ p a t c h _ e x c e p t i o n , % g 5
st % g 4 , [ % g 5 + 0 x18 ]
st % g 4 , [ % g 5 + 0 x1 c ]
set f l u s h _ p a t c h _ s w i t c h , % g 5
st % g 4 , [ % g 5 + 0 x18 ]
st % g 4 , [ % g 5 + 0 x1 c ]
2 :
sethi % h i ( n w i n d o w s ) , % g 4
st % g 3 , [ % g 4 + % l o ( n w i n d o w s ) ] ! s t o r e f i n a l v a l u e
sub % g 3 , 0 x1 , % g 3
sethi % h i ( n w i n d o w s m 1 ) , % g 4
st % g 3 , [ % g 4 + % l o ( n w i n d o w s m 1 ) ]
/* Here we go, start using Linux's trap table... */
set t r a p b a s e , % g 3
wr % g 3 , 0 x0 , % t b r
WRITE_ P A U S E
/* Finally, turn on traps so that we can call c-code. */
rd % p s r , % g 3
wr % g 3 , 0 x0 , % p s r
WRITE_ P A U S E
wr % g 3 , P S R _ E T , % p s r
WRITE_ P A U S E
/ * First w e c a l l p r o m _ i n i t ( ) t o s e t u p P R O M L I B , t h e n
* off t o s t a r t _ k e r n e l ( ) .
* /
sethi % h i ( p r o m _ v e c t o r _ p ) , % g 5
ld [ % g 5 + % l o ( p r o m _ v e c t o r _ p ) ] , % o 0
call p r o m _ i n i t
nop
call s t a r t _ k e r n e l
nop
/* We should not get here. */
call h a l t _ m e
nop
sun4_init :
sethi % h i ( S U N 4 _ P R O M _ V E C T O R + 0 x84 ) , % o 1
ld [ % o 1 + % l o ( S U N 4 _ P R O M _ V E C T O R + 0 x84 ) ] , % o 1
set s u n 4 _ n o t s u p , % o 0
call % o 1 / * p r i n t f * /
nop
sethi % h i ( S U N 4 _ P R O M _ V E C T O R + 0 x c4 ) , % o 1
ld [ % o 1 + % l o ( S U N 4 _ P R O M _ V E C T O R + 0 x c4 ) ] , % o 1
call % o 1 / * e x i t t o m o n * /
nop
1 : ba 1 b ! C a n n o t e x i t i n t o K M O N
nop
2008-08-31 20:59:37 -07:00
2005-04-16 15:20:36 -07:00
no_sun4e_here :
ld [ % g 7 + 0 x68 ] , % o 1
set s u n 4 e _ n o t s u p , % o 0
call % o 1
nop
b h a l t _ m e
nop
_ _ INITDATA
sun4u_1 :
.asciz " finddevice"
.align 4
sun4u_2 :
.asciz " / chosen"
.align 4
sun4u_3 :
.asciz " getprop"
.align 4
sun4u_4 :
.asciz " stdout"
.align 4
sun4u_5 :
.asciz " write"
.align 4
sun4u_6 :
.asciz " \ n\ r O n s u n 4 u y o u h a v e t o u s e U l t r a L i n u x ( 6 4 b i t ) k e r n e l \ n \ r a n d n o t a 3 2 b i t s u n 4 [ c d e m ] v e r s i o n \ n \ r \ n \ r "
sun4u_6e :
.align 4
sun4u_7 :
.asciz " exit"
.align 8
sun4u_a1 :
.word 0 , sun4 u _ 1 , 0 , 1 , 0 , 1 , 0 , s u n 4 u _ 2 , 0
sun4u_r1 :
.word 0
sun4u_a2 :
.word 0 , sun4 u _ 3 , 0 , 4 , 0 , 1 , 0
sun4u_i2 :
.word 0 , 0 , sun4 u _ 4 , 0 , s u n 4 u _ 1 , 0 , 8 , 0
sun4u_r2 :
.word 0
sun4u_a3 :
.word 0 , sun4 u _ 5 , 0 , 3 , 0 , 1 , 0
sun4u_i3 :
.word 0 , 0 , sun4 u _ 6 , 0 , s u n 4 u _ 6 e - s u n 4 u _ 6 - 1 , 0
sun4u_r3 :
.word 0
sun4u_a4 :
.word 0 , sun4 u _ 7 , 0 , 0 , 0 , 0
sun4u_r4 :
_ _ INIT
no_sun4u_here :
set s u n 4 u _ a1 , % o 0
set c u r r e n t _ p c , % l 2
cmp % l 2 , % g 3
be 1 f
mov % o 4 , % l 0
sub % g 3 , % l 2 , % l 6
add % o 0 , % l 6 , % o 0
mov % o 0 , % l 4
mov s u n 4 u _ r4 - s u n 4 u _ a1 , % l 3
ld [ % l 4 ] , % l 5
2 :
add % l 4 , 4 , % l 4
cmp % l 5 , % l 2
add % l 5 , % l 6 , % l 5
bgeu,a 3 f
st % l 5 , [ % l 4 - 4 ]
3 :
subcc % l 3 , 4 , % l 3
bne 2 b
ld [ % l 4 ] , % l 5
1 :
call % l 0
mov % o 0 , % l 1
ld [ % l 1 + ( s u n 4 u _ r1 - s u n 4 u _ a1 ) ] , % o 1
add % l 1 , ( s u n 4 u _ a2 - s u n 4 u _ a1 ) , % o 0
call % l 0
st % o 1 , [ % o 0 + ( s u n 4 u _ i 2 - s u n 4 u _ a2 ) ]
ld [ % l 1 + ( s u n 4 u _ 1 - s u n 4 u _ a1 ) ] , % o 1
add % l 1 , ( s u n 4 u _ a3 - s u n 4 u _ a1 ) , % o 0
call % l 0
st % o 1 , [ % o 0 + ( s u n 4 u _ i 3 - s u n 4 u _ a3 ) ]
call % l 0
add % l 1 , ( s u n 4 u _ a4 - s u n 4 u _ a1 ) , % o 0
/* Not reached */
halt_me :
ld [ % g 7 + 0 x74 ] , % o 0
call % o 0 ! G e t u s o u t o f h e r e . . .
nop ! A p p a r e n t l y S o l a r i s i s b e t t e r .
/* Ok, now we continue in the .data/.text sections */
.data
.align 4
/ *
* Fill u p t h e p r o m v e c t o r , n o t e i n p a r t i c u l a r t h e k i n d f i r s t e l e m e n t ,
* no j o k e . I d o n ' t n e e d a l l o f t h e m i n h e r e a s t h e e n t i r e p r o m v e c t o r
* gets i n i t i a l i z e d i n c - c o d e s o a l l r o u t i n e s c a n u s e i t .
* /
prom_vector_p :
.word 0
/ * We c a l c u l a t e t h e f o l l o w i n g a t b o o t t i m e , w i n d o w f i l l s / s p i l l s a n d t r a p e n t r y
* code u s e s t h e s e t o k e e p t r a c k o f t h e r e g i s t e r w i n d o w s .
* /
.align 4
.globl nwindows
.globl nwindowsm1
nwindows :
.word 8
nwindowsm1 :
.word 7
/* Boot time debugger vector value. We need this later on. */
.align 4
.globl linux_dbvec
linux_dbvec :
.word 0
.word 0
.align 8
.globl lvl14_save
lvl14_save :
.word 0
.word 0
.word 0
.word 0
.word t_irq14
.section " .fixup " , # alloc,#e x e c i n s t r
.globl __ret_efault
__ret_efault :
ret
restore % g 0 , - E F A U L T , % o 0