version 1.120, 2016/05/14 08:39:41 |
version 1.121, 2016/05/14 08:49:16 |
|
|
*/ |
*/ |
leal (PROC0_PTP1_OFF)(%esi),%ebx |
leal (PROC0_PTP1_OFF)(%esi),%ebx |
|
|
/* Compute &__rodata_start - KERNBASE. */ |
|
movl $RELOC(__rodata_start),%edx |
|
andl $~PGOFSET,%edx |
|
|
|
/* Skip the first MB. */ |
/* Skip the first MB. */ |
movl $(KERNTEXTOFF - KERNBASE),%eax |
movl $(KERNTEXTOFF - KERNBASE),%eax |
movl %eax,%ecx |
movl %eax,%ecx |
|
|
#endif |
#endif |
addl %ecx,%ebx |
addl %ecx,%ebx |
|
|
/* Map the kernel text read-only. */ |
/* Map the kernel text RX. */ |
movl %edx,%ecx |
movl $RELOC(__rodata_start),%ecx |
subl %eax,%ecx |
subl %eax,%ecx |
shrl $PGSHIFT,%ecx |
shrl $PGSHIFT,%ecx |
orl $(PG_V|PG_KR),%eax |
orl $(PG_V|PG_KR),%eax |
fillkpt |
fillkpt |
|
|
/* Map the data, BSS, and bootstrap tables read-write. */ |
/* Map the kernel rodata R. */ |
leal (PG_V|PG_KW)(%edx),%eax |
movl $RELOC(__rodata_start),%eax |
movl RELOC(tablesize),%ecx |
movl $RELOC(__data_start),%ecx |
addl %esi,%ecx /* end of tables */ |
subl %eax,%ecx |
subl %edx,%ecx /* subtract end of text */ |
shrl $PGSHIFT,%ecx |
|
orl $(PG_V|PG_KR),%eax |
|
fillkpt_nox |
|
|
|
/* Map the kernel data+bss RW. */ |
|
movl $RELOC(__data_start),%eax |
|
movl $RELOC(__kernel_end),%ecx |
|
subl %eax,%ecx |
shrl $PGSHIFT,%ecx |
shrl $PGSHIFT,%ecx |
|
orl $(PG_V|PG_KW),%eax |
|
fillkpt_nox |
|
|
|
/* |
|
* We actually have to be careful here. The memory layout is as |
|
* follows: |
|
* +----------+---------------------+------------------+ |
|
* | DATA+BSS < [PRELOADED MODULES] | BOOTSTRAP TABLES > |
|
* +----------+---------------------+------------------+ |
|
* We just map everything from < to > with RWX rights. |
|
*/ |
|
movl $RELOC(__kernel_end),%eax |
|
movl %esi,%ecx /* start of BOOTSTRAP TABLES */ |
|
addl RELOC(tablesize),%ecx /* end of BOOTSTRAP TABLES */ |
|
subl %eax,%ecx /* subtract end of kernel image */ |
|
shrl $PGSHIFT,%ecx |
|
orl $(PG_V|PG_KW),%eax |
fillkpt |
fillkpt |
|
|
/* Map ISA I/O mem (later atdevbase) */ |
/* Map ISA I/O mem (later atdevbase) */ |