diff --git a/kernel/asm.s b/kernel/asm.s index a94845d..6ee21a2 100644 --- a/kernel/asm.s +++ b/kernel/asm.s @@ -79,14 +79,14 @@ TEXT ·gdt_init(SB), NOSPLIT, $0 RET TEXT ·set_fs(SB), NOSPLIT, $0-4 - MOVW idx+0(FP), AX + MOVL idx+0(FP), AX SHLL $3, AX ADDL $3, AX MOVW AX, FS RET TEXT ·set_gs(SB), NOSPLIT, $0-4 - MOVW idx+0(FP), AX + MOVL idx+0(FP), AX SHLL $3, AX ADDL $3, AX MOVW AX, GS @@ -138,23 +138,8 @@ TEXT ·callSigHandler(SB), NOSPLIT, $0-20 POPL BP RET -// func call(pc,a0,a1,a2 uintptr) -TEXT ·call(SB), NOSPLIT, $12-16 - MOVL pc+0(FP), CX - - MOVL a0+4(FP), AX - MOVL AX, 0(SP) - - MOVL a1+8(FP), AX - MOVL AX, 4(SP) - - MOVL a2+12(FP), AX - MOVL AX, 8(SP) - CALL CX - RET - TEXT ·set_mythread(SB), NOSPLIT, $4-4 - MOVL tid+0(FP), AX + MOVL t+0(FP), AX MOVL AX, 0(FS) MOVL AX, 0(SP) CALL ·switchThreadContext(SB) @@ -169,7 +154,7 @@ TEXT ·sys_clone(SB), NOSPLIT, $0-12 // In parent, return. CMPL AX, $0 JEQ 3(PC) - MOVL AX, tid+8(FP) + MOVL AX, ret+8(FP) RET NOP SP // tell vet SP changed - stop checking offsets diff --git a/sys/sys.go b/sys/sys.go index df602da..c6ba473 100644 --- a/sys/sys.go +++ b/sys/sys.go @@ -10,7 +10,7 @@ const PageSize = 4 << 10 func Outb(port uint16, data byte) //go:nosplit -func Inb(reg uint16) byte +func Inb(port uint16) byte //go:nosplit func Outl(port uint16, data uint32) diff --git a/sys/sys.s b/sys/sys.s index 9f440b1..596ab3e 100644 --- a/sys/sys.s +++ b/sys/sys.s @@ -8,17 +8,17 @@ TEXT ·Outb(SB), NOSPLIT, $0-3 RET // byte Inb(reg uint16) -TEXT ·Inb(SB), NOSPLIT, $0-3 +TEXT ·Inb(SB), NOSPLIT, $0-5 MOVW port+0(FP), DX XORW AX, AX INB - MOVW AX, ret+4(FP) + MOVB AX, ret+4(FP) RET // Outl(port uint16, data uint32) TEXT ·Outl(SB), NOSPLIT, $0-8 MOVW port+0(FP), DX - MOVL b+4(FP), AX + MOVL data+4(FP), AX OUTL RET