| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #include <linux/linkage.h> | 
|  | 2 |  | 
|  | 3 | #include <asm/entry.h> | 
|  | 4 | #include <asm/page.h> | 
|  | 5 | #include <asm/contregs.h> | 
|  | 6 | #include <asm/sun3-head.h> | 
|  | 7 |  | 
|  | 8 | PSL_HIGHIPL     = 0x2700 | 
|  | 9 | NBSG            = 0x20000 | 
|  | 10 | ICACHE_ONLY	= 0x00000009 | 
|  | 11 | CACHES_OFF	= 0x00000008	| actually a clear and disable --m | 
|  | 12 | #define MAS_STACK INT_STACK | 
|  | 13 | ROOT_TABLE_SIZE = 128 | 
|  | 14 | PAGESIZE	= 8192 | 
|  | 15 | SUN3_INVALID_PMEG = 255 | 
|  | 16 | .globl bootup_user_stack | 
|  | 17 | .globl bootup_kernel_stack | 
|  | 18 | .globl pg0 | 
|  | 19 | .globl swapper_pg_dir | 
|  | 20 | .globl kernel_pmd_table | 
|  | 21 | .globl availmem | 
|  | 22 | .global m68k_pgtable_cachemode | 
|  | 23 | .global kpt | 
|  | 24 | | todo: all these should be in bss! | 
|  | 25 | swapper_pg_dir:                .skip 0x2000 | 
|  | 26 | pg0:                           .skip 0x2000 | 
|  | 27 | kernel_pmd_table:              .skip 0x2000 | 
|  | 28 |  | 
|  | 29 | .globl kernel_pg_dir | 
|  | 30 | .equ    kernel_pg_dir,kernel_pmd_table | 
|  | 31 |  | 
| Al Viro | 7e5de05 | 2007-07-20 04:33:08 +0100 | [diff] [blame] | 32 | .section .text.head | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | ENTRY(_stext) | 
|  | 34 | ENTRY(_start) | 
|  | 35 |  | 
|  | 36 | /* Firstly, disable interrupts and set up function codes. */ | 
|  | 37 | movew	#PSL_HIGHIPL, %sr | 
|  | 38 | moveq	#FC_CONTROL, %d0 | 
|  | 39 | movec	%d0, %sfc | 
|  | 40 | movec	%d0, %dfc | 
|  | 41 |  | 
|  | 42 | /* Make sure we're in context zero. */ | 
|  | 43 | moveq	#0, %d0 | 
|  | 44 | movsb	%d0, AC_CONTEXT | 
|  | 45 |  | 
|  | 46 | /* map everything the bootloader left us into high memory, clean up the | 
|  | 47 | excess later */ | 
|  | 48 | lea	(AC_SEGMAP+0),%a0 | 
|  | 49 | lea	(AC_SEGMAP+KERNBASE),%a1 | 
|  | 50 | 1: | 
|  | 51 | movsb	%a0@, %d1 | 
|  | 52 | movsb	%d1, %a1@ | 
|  | 53 | cmpib	#SUN3_INVALID_PMEG, %d1 | 
|  | 54 | beq	2f | 
|  | 55 | addl	#NBSG,%a0 | 
|  | 56 | addl	#NBSG,%a1 | 
|  | 57 | jmp	1b | 
|  | 58 |  | 
|  | 59 | 2: | 
|  | 60 |  | 
|  | 61 | /* Disable caches and jump to high code. */ | 
|  | 62 | moveq	#ICACHE_ONLY,%d0	| Cache disabled until we're ready to enable it | 
|  | 63 | movc	%d0, %cacr	|   is this the right value? (yes --m) | 
|  | 64 | jmp	1f:l | 
|  | 65 |  | 
|  | 66 | /* Following code executes at high addresses (0xE000xxx). */ | 
|  | 67 | 1:	lea	init_task,%curptr			| get initial thread... | 
|  | 68 | lea	init_thread_union+THREAD_SIZE,%sp	| ...and its stack. | 
|  | 69 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | /* Point MSP at an invalid page to trap if it's used. --m */ | 
|  | 71 | movl	#(PAGESIZE),%d0 | 
|  | 72 | movc	%d0,%msp | 
|  | 73 | moveq	#-1,%d0 | 
|  | 74 | movsb	%d0,(AC_SEGMAP+0x0) | 
|  | 75 |  | 
|  | 76 | jbsr	sun3_init | 
|  | 77 |  | 
|  | 78 | jbsr	base_trap_init | 
|  | 79 |  | 
|  | 80 | jbsr    start_kernel | 
|  | 81 | trap	#15 | 
|  | 82 |  | 
|  | 83 | .data | 
|  | 84 | .even | 
|  | 85 | kpt: | 
|  | 86 | .long 0 | 
|  | 87 | availmem: | 
|  | 88 | .long 0 | 
|  | 89 | | todo: remove next two. --m | 
|  | 90 | is_medusa: | 
|  | 91 | .long 0 | 
|  | 92 | m68k_pgtable_cachemode: | 
|  | 93 | .long 0 | 
|  | 94 |  |