*
* %sccs.include.386.c%
*
- * @(#)locore.s 5.6 (Berkeley) %G%
+ * @(#)locore.s 5.7 (Berkeley) %G%
*/
/*
* Written by William F. Jolitz, 386BSD Project
*/
-#include "psl.h"
-#include "pte.h"
+#include "machine/psl.h"
+#include "machine/pte.h"
#include "errno.h"
#include "cmap.h"
-#include "../i386/trap.h"
+#include "machine/trap.h"
/*
* Note: This version greatly munged to avoid various assembler errors
rep
stosb
+#ifdef notdef
/* pass parameters on stack (howto, bootdev, unit, cyloffset) */
movl 4(%esp),%eax
movl 12(%esp),%eax
movl %eax, _cyloffset-SYSTEM
-#ifdef notdef
movl $0x36000,%edi
movl $0x68000,%ecx
movl %ecx,PCB_P1BR(%eax) # p1br: P1PAGES from end of PT
movl $ P1PAGES-UPAGES,PCB_P1LR(%eax) # p1lr: vax style
movl $ CLSIZE,PCB_SZPT(%eax) # page table size
- # fninit
- # pushl $0x262
- # fldcw 0(%esp)
- # popl %ecx
- # fnsave PCB_SAVEFPU(%eax)
movl %edi,PCB_CR3(%eax)
pushl %edi # cr3
movl %esi,%eax
pushl %eax # dummy out rta
LCALL(0x7,0x0)
-init: .asciz "/etc/init"
+init: .asciz "/sbin/init"
.align 2
_initflags:
.long 0
* Swtch()
*/
ENTRY(swtch)
- movl _cpl,%eax
- movl %eax,_u+PCB_IML
+ movw _cpl, %ax
+ movw %ax, _u+PCB_IML
movl $1,%eax
movl %eax,_noproc
incl _cnt+V_SWTCH
movl P_ADDR(%ecx),%edx
movl (%edx),%eax
movl %eax,_Swtchmap
- movl 4(%edx),%eax
- movl %eax,_Swtchmap+4
+ # movl 4(%edx),%eax
+ # movl %eax,_Swtchmap+4
# movl %cr3,%eax
- # orl $ I386_CR3PAT,%eax
# movl %eax,%cr3
movl _Swtchbase+PCB_CR3,%edx
- # pushal; pushl %edx ; pushl P_CR3(%ecx); pushl $l2; call _pg; popl %eax ; popl %eax; popl %eax ; popal ; .data ; l2: .asciz "s %x %x " ; .text
-
/* switch to new process. first, save context as needed */
+
movl $_u,%ecx
movl (%esp),%eax # Hardware registers
movl %edx,%cr3 # context switch
movl $_u,%ecx
- # .globl __gsel_tss
- # movw __gsel_tss,%ax
- # ltr %ax
/* restore context */
movl PCB_EBX(%ecx), %ebx
cmpl $0,PCB_SSWAP(%ecx) # do an alternate return?
jne res3 # yes, go reload regs
- pushl PCB_IML(%ecx)
- call _splx
- popl %eax
+ # pushl PCB_IML(%ecx)
+ # call _splx
+ # popl %eax
+ call _spl0
movl $0,%eax
ret
xorl %eax,%eax # inline restore context
xchgl PCB_SSWAP(%ecx),%eax # addr of saved context, clear it
- #pushal; pushl 20(%eax); pushl $l2; call _printf; popl %eax ; popl %eax; popal ; .data ; l2: .asciz "s %x\n" ; .text
-
movl 0(%eax),%ebx # restore ebx
movl 4(%eax),%esp # restore esp
movl 8(%eax),%ebp # restore ebp
movl 16(%eax),%edi # restore edi
movl 20(%eax),%edx # get rta
movl %edx,(%esp) # put in return frame
- call _spl0
+
+ # call _spl0
+ pushl _u+PCB_IML
+ call _splx
+ popl %eax
+
xorl %eax,%eax # return (1);
incl %eax
ret
ENTRY(resume)
# movl 4(%esp),%ecx
movl $_u,%ecx
+ movw _cpl, %ax
+ movw %ax, PCB_IML(%ecx)
movl (%esp),%eax
movl %eax, PCB_EIP(%ecx)
movl %ebx, PCB_EBX(%ecx)
#ifdef FPUNOTYET
#endif
fsave PCB_SAVEFPU(%ecx)
- movl _cpl,%eax
- movl %eax,PCB_IML(%ecx)
movl $0,%eax
ret
+
.data
.globl _cyloffset
_cyloffset: .long 0