Skip to content

Commit

Permalink
fix vet error (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
icexin authored Jul 21, 2021
1 parent d01b45b commit b74627c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
23 changes: 4 additions & 19 deletions kernel/asm.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sys/sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions sys/sys.s
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b74627c

Please sign in to comment.