2005-04-17 02:20:36 +04:00
# include < l i n u x / l i n k a g e . h >
2009-04-28 23:20:11 +04:00
# include < l i n u x / i n i t . h >
2005-04-17 02:20:36 +04:00
# include < a s m / e n t r y . h >
# include < a s m / p a g e . h >
# include < a s m / c o n t r e g s . h >
# include < a s m / s u n 3 - h e a d . h >
PSL_ H I G H I P L = 0 x27 0 0
NBSG = 0 x20 0 0 0
ICACHE_ O N L Y = 0 x00 0 0 0 0 0 9
CACHES_ O F F = 0 x00 0 0 0 0 0 8 | a c t u a l l y a c l e a r a n d d i s a b l e - - m
# define M A S _ S T A C K I N T _ S T A C K
ROOT_ T A B L E _ S I Z E = 1 2 8
PAGESIZE = 8 1 9 2
SUN3 _ I N V A L I D _ P M E G = 2 5 5
.globl bootup_user_stack
.globl bootup_kernel_stack
.globl pg0
.globl swapper_pg_dir
.globl kernel_pmd_table
.globl availmem
.global m68k_pgtable_cachemode
.global kpt
| todo : all t h e s e s h o u l d b e i n b s s !
swapper_pg_dir : .skip 0x2000
pg0 : .skip 0x2000
kernel_pmd_table : .skip 0x2000
.globl kernel_pg_dir
.equ kernel_ p g _ d i r ,k e r n e l _ p m d _ t a b l e
2009-04-26 06:11:03 +04:00
_ _ HEAD
2005-04-17 02:20:36 +04:00
ENTRY( _ s t e x t )
ENTRY( _ s t a r t )
/* Firstly, disable interrupts and set up function codes. */
movew #P S L _ H I G H I P L , % s r
moveq #F C _ C O N T R O L , % d 0
movec % d0 , % s f c
movec % d0 , % d f c
/* Make sure we're in context zero. */
moveq #0 , % d0
movsb % d0 , A C _ C O N T E X T
/ * map e v e r y t h i n g t h e b o o t l o a d e r l e f t u s i n t o h i g h m e m o r y , c l e a n u p t h e
excess l a t e r * /
lea ( A C _ S E G M A P + 0 ) ,% a0
lea ( A C _ S E G M A P + K E R N B A S E ) ,% a1
1 :
movsb % a0 @, %d1
movsb % d1 , % a1 @
cmpib #S U N 3 _ I N V A L I D _ P M E G , % d1
beq 2 f
addl #N B S G , % a 0
addl #N B S G , % a 1
jmp 1 b
2 :
/* Disable caches and jump to high code. */
moveq #I C A C H E _ O N L Y , % d 0 | C a c h e d i s a b l e d u n t i l w e ' r e r e a d y t o e n a b l e i t
movc % d0 , % c a c r | i s t h i s t h e r i g h t v a l u e ? ( y e s - - m )
jmp 1 f : l
/* Following code executes at high addresses (0xE000xxx). */
1 : lea i n i t _ t a s k ,% c u r p t r | g e t i n i t i a l t h r e a d . . .
lea i n i t _ t h r e a d _ u n i o n + T H R E A D _ S I Z E ,% s p | . . . a n d i t s s t a c k .
/* Point MSP at an invalid page to trap if it's used. --m */
movl #( P A G E S I Z E ) , % d 0
movc % d0 ,% m s p
moveq #- 1 ,% d0
movsb % d0 ,( A C _ S E G M A P + 0 x0 )
jbsr s u n 3 _ i n i t
jbsr b a s e _ t r a p _ i n i t
jbsr s t a r t _ k e r n e l
trap #15
.data
.even
kpt :
.long 0
availmem :
.long 0
| todo : remove n e x t t w o . - - m
is_medusa :
.long 0
m68k_pgtable_cachemode :
.long 0