2004-02-15 20:46:45 +00:00
|
|
|
/*
|
|
|
|
*
|
2007-01-01 18:51:03 +00:00
|
|
|
* (c) 2004-2007 Laurent Vivier <Laurent@lvivier.info>
|
2004-02-15 20:46:45 +00:00
|
|
|
*
|
|
|
|
*/
|
2005-05-25 06:41:03 +00:00
|
|
|
|
2004-06-09 12:24:24 +00:00
|
|
|
.chip 68040
|
2004-02-15 20:46:45 +00:00
|
|
|
|
2004-06-07 22:13:00 +00:00
|
|
|
.include "copymem.i"
|
|
|
|
|
2004-06-07 18:51:24 +00:00
|
|
|
.align 4
|
|
|
|
|
2004-03-04 22:50:11 +00:00
|
|
|
.global enter_kernel040
|
|
|
|
enter_kernel040:
|
|
|
|
link.w %fp,#0
|
2004-02-15 20:46:45 +00:00
|
|
|
|
|
|
|
/* get physical start address of kernel */
|
|
|
|
|
|
|
|
move.l 8(%fp), %a0
|
|
|
|
|
|
|
|
/* size of image to relocate */
|
|
|
|
|
|
|
|
move.l 12(%fp), %d0
|
|
|
|
|
2007-01-01 18:51:03 +00:00
|
|
|
/* destination address */
|
2004-02-23 23:32:54 +00:00
|
|
|
|
|
|
|
move.l 16(%fp), %a2
|
|
|
|
|
2005-09-19 22:15:34 +00:00
|
|
|
/* bootenv address (EXPERIMENTAL) */
|
|
|
|
|
|
|
|
move.l %a2, %a1
|
|
|
|
add.l %d0, %a1
|
|
|
|
sub.l #4096, %a1
|
2005-09-21 23:23:18 +00:00
|
|
|
move.l #0x80000000, %d4
|
2005-09-19 22:15:34 +00:00
|
|
|
|
2005-09-19 19:03:39 +00:00
|
|
|
/* entry point */
|
|
|
|
|
2005-09-19 22:15:34 +00:00
|
|
|
move.l 20(%fp), %a3
|
2005-09-19 19:03:39 +00:00
|
|
|
|
2004-02-15 20:46:45 +00:00
|
|
|
/* disable MMU */
|
|
|
|
|
2004-03-04 22:50:11 +00:00
|
|
|
moveq.l #0, %d1
|
2004-03-06 01:00:18 +00:00
|
|
|
movec %d1, %tc
|
2004-03-04 22:50:11 +00:00
|
|
|
movec %d1, %itt0
|
|
|
|
movec %d1, %dtt0
|
|
|
|
movec %d1, %itt1
|
|
|
|
movec %d1, %dtt1
|
2004-02-15 20:46:45 +00:00
|
|
|
|
2004-02-23 23:32:54 +00:00
|
|
|
/* copy kernel to destination address */
|
2004-02-15 20:46:45 +00:00
|
|
|
|
2004-06-07 22:13:00 +00:00
|
|
|
copymem %a0, %a2, %d0
|
2004-02-15 20:46:45 +00:00
|
|
|
|
|
|
|
/* jump into kernel */
|
|
|
|
|
2005-09-19 22:15:34 +00:00
|
|
|
jmp %a3@
|
2004-02-15 20:46:45 +00:00
|
|
|
|
|
|
|
/* never comes here... I hope */
|
|
|
|
|
|
|
|
unlk %fp
|
|
|
|
rts
|
2004-03-04 22:50:11 +00:00
|
|
|
.global end_enter_kernel040
|
|
|
|
end_enter_kernel040:
|