From 541ef422e24c8010f95151f241224fa16cdce210 Mon Sep 17 00:00:00 2001 From: Guoqi Chen Date: Fri, 26 Aug 2022 14:19:06 +0800 Subject: [PATCH] runtime: add comment for sys_linux_loong64 Change-Id: I617d6d788cb213c1405f81d9f689fd6846ee105a Reviewed-on: https://go-review.googlesource.com/c/go/+/425300 Reviewed-by: Cherry Mui Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Meidan Li Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: WANG Xuerui --- src/runtime/sys_linux_loong64.s | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/runtime/sys_linux_loong64.s b/src/runtime/sys_linux_loong64.s index f1dcef42338..006c4bf2d51 100644 --- a/src/runtime/sys_linux_loong64.s +++ b/src/runtime/sys_linux_loong64.s @@ -44,6 +44,7 @@ #define SYS_timer_settime 110 #define SYS_timer_delete 111 +// func exit(code int32) TEXT runtime·exit(SB),NOSPLIT|NOFRAME,$0-4 MOVW code+0(FP), R4 MOVV $SYS_exit_group, R11 @@ -63,6 +64,7 @@ TEXT runtime·exitThread(SB),NOSPLIT|NOFRAME,$0-8 SYSCALL JMP 0(PC) +// func open(name *byte, mode, perm int32) int32 TEXT runtime·open(SB),NOSPLIT|NOFRAME,$0-20 MOVW $AT_FDCWD, R4 // AT_FDCWD, so this acts like open MOVV name+0(FP), R5 @@ -76,6 +78,7 @@ TEXT runtime·open(SB),NOSPLIT|NOFRAME,$0-20 MOVW R4, ret+16(FP) RET +// func closefd(fd int32) int32 TEXT runtime·closefd(SB),NOSPLIT|NOFRAME,$0-12 MOVW fd+0(FP), R4 MOVV $SYS_close, R11 @@ -86,6 +89,7 @@ TEXT runtime·closefd(SB),NOSPLIT|NOFRAME,$0-12 MOVW R4, ret+8(FP) RET +// func write1(fd uintptr, p unsafe.Pointer, n int32) int32 TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0-28 MOVV fd+0(FP), R4 MOVV p+8(FP), R5 @@ -95,6 +99,7 @@ TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0-28 MOVW R4, ret+24(FP) RET +// func read(fd int32, p unsafe.Pointer, n int32) int32 TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28 MOVW fd+0(FP), R4 MOVV p+8(FP), R5 @@ -113,6 +118,7 @@ TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20 MOVW R4, errno+16(FP) RET +// func usleep(usec uint32) TEXT runtime·usleep(SB),NOSPLIT,$16-4 MOVWU usec+0(FP), R6 MOVV R6, R5 @@ -131,12 +137,14 @@ TEXT runtime·usleep(SB),NOSPLIT,$16-4 SYSCALL RET +// func gettid() uint32 TEXT runtime·gettid(SB),NOSPLIT,$0-4 MOVV $SYS_gettid, R11 SYSCALL MOVW R4, ret+0(FP) RET +// func raise(sig uint32) TEXT runtime·raise(SB),NOSPLIT|NOFRAME,$0 MOVV $SYS_getpid, R11 SYSCALL @@ -150,6 +158,7 @@ TEXT runtime·raise(SB),NOSPLIT|NOFRAME,$0 SYSCALL RET +// func raiseproc(sig uint32) TEXT runtime·raiseproc(SB),NOSPLIT|NOFRAME,$0 MOVV $SYS_getpid, R11 SYSCALL @@ -159,12 +168,14 @@ TEXT runtime·raiseproc(SB),NOSPLIT|NOFRAME,$0 SYSCALL RET +// func getpid() int TEXT ·getpid(SB),NOSPLIT|NOFRAME,$0-8 MOVV $SYS_getpid, R11 SYSCALL MOVV R4, ret+0(FP) RET +// func tgkill(tgid, tid, sig int) TEXT ·tgkill(SB),NOSPLIT|NOFRAME,$0-24 MOVV tgid+0(FP), R4 MOVV tid+8(FP), R5 @@ -173,6 +184,7 @@ TEXT ·tgkill(SB),NOSPLIT|NOFRAME,$0-24 SYSCALL RET +// func setitimer(mode int32, new, old *itimerval) TEXT runtime·setitimer(SB),NOSPLIT|NOFRAME,$0-24 MOVW mode+0(FP), R4 MOVV new+8(FP), R5 @@ -181,6 +193,7 @@ TEXT runtime·setitimer(SB),NOSPLIT|NOFRAME,$0-24 SYSCALL RET +// func timer_create(clockid int32, sevp *sigevent, timerid *int32) int32 TEXT runtime·timer_create(SB),NOSPLIT,$0-28 MOVW clockid+0(FP), R4 MOVV sevp+8(FP), R5 @@ -190,6 +203,7 @@ TEXT runtime·timer_create(SB),NOSPLIT,$0-28 MOVW R4, ret+24(FP) RET +// func timer_settime(timerid int32, flags int32, new, old *itimerspec) int32 TEXT runtime·timer_settime(SB),NOSPLIT,$0-28 MOVW timerid+0(FP), R4 MOVW flags+4(FP), R5 @@ -200,6 +214,7 @@ TEXT runtime·timer_settime(SB),NOSPLIT,$0-28 MOVW R4, ret+24(FP) RET +// func timer_delete(timerid int32) int32 TEXT runtime·timer_delete(SB),NOSPLIT,$0-12 MOVW timerid+0(FP), R4 MOVV $SYS_timer_delete, R11 @@ -207,6 +222,7 @@ TEXT runtime·timer_delete(SB),NOSPLIT,$0-12 MOVW R4, ret+8(FP) RET +// func mincore(addr unsafe.Pointer, n uintptr, dst *byte) int32 TEXT runtime·mincore(SB),NOSPLIT|NOFRAME,$0-28 MOVV addr+0(FP), R4 MOVV n+8(FP), R5 @@ -279,6 +295,7 @@ fallback: SYSCALL JMP finish +// func nanotime1() int64 TEXT runtime·nanotime1(SB),NOSPLIT,$16-8 MOVV R3, R23 // R23 is unchanged by C code MOVV R3, R25 @@ -345,6 +362,7 @@ fallback: SYSCALL JMP finish +// func rtsigprocmask(how int32, new, old *sigset, size int32) TEXT runtime·rtsigprocmask(SB),NOSPLIT|NOFRAME,$0-28 MOVW how+0(FP), R4 MOVV new+8(FP), R5 @@ -357,6 +375,7 @@ TEXT runtime·rtsigprocmask(SB),NOSPLIT|NOFRAME,$0-28 MOVV R0, 0xf1(R0) // crash RET +// func rt_sigaction(sig uintptr, new, old *sigactiont, size uintptr) int32 TEXT runtime·rt_sigaction(SB),NOSPLIT|NOFRAME,$0-36 MOVV sig+0(FP), R4 MOVV new+8(FP), R5 @@ -367,6 +386,7 @@ TEXT runtime·rt_sigaction(SB),NOSPLIT|NOFRAME,$0-36 MOVW R4, ret+32(FP) RET +// func sigfwd(fn uintptr, sig uint32, info *siginfo, ctx unsafe.Pointer) TEXT runtime·sigfwd(SB),NOSPLIT,$0-32 MOVW sig+8(FP), R4 MOVV info+16(FP), R5 @@ -375,6 +395,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32 JAL (R20) RET +// func sigtramp(signo, ureg, ctxt unsafe.Pointer) TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$168 MOVW R4, (1*8)(R3) MOVV R5, (2*8)(R3) @@ -400,9 +421,11 @@ TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$168 RET +// func cgoSigtramp() TEXT runtime·cgoSigtramp(SB),NOSPLIT,$0 JMP runtime·sigtramp(SB) +// func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (p unsafe.Pointer, err int) TEXT runtime·mmap(SB),NOSPLIT|NOFRAME,$0 MOVV addr+0(FP), R4 MOVV n+8(FP), R5 @@ -424,6 +447,7 @@ ok: MOVV $0, err+40(FP) RET +// func munmap(addr unsafe.Pointer, n uintptr) TEXT runtime·munmap(SB),NOSPLIT|NOFRAME,$0 MOVV addr+0(FP), R4 MOVV n+8(FP), R5 @@ -434,6 +458,7 @@ TEXT runtime·munmap(SB),NOSPLIT|NOFRAME,$0 MOVV R0, 0xf3(R0) // crash RET +// func madvise(addr unsafe.Pointer, n uintptr, flags int32) TEXT runtime·madvise(SB),NOSPLIT|NOFRAME,$0 MOVV addr+0(FP), R4 MOVV n+8(FP), R5 @@ -443,8 +468,7 @@ TEXT runtime·madvise(SB),NOSPLIT|NOFRAME,$0 MOVW R4, ret+24(FP) RET -// int64 futex(int32 *uaddr, int32 op, int32 val, -// struct timespec *timeout, int32 *uaddr2, int32 val2); +// func futex(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32 TEXT runtime·futex(SB),NOSPLIT|NOFRAME,$0 MOVV addr+0(FP), R4 MOVW op+8(FP), R5 @@ -518,6 +542,7 @@ nog: SYSCALL JMP -3(PC) // keep exiting +// func sigaltstack(new, old *stackt) TEXT runtime·sigaltstack(SB),NOSPLIT|NOFRAME,$0 MOVV new+0(FP), R4 MOVV old+8(FP), R5 @@ -528,11 +553,13 @@ TEXT runtime·sigaltstack(SB),NOSPLIT|NOFRAME,$0 MOVV R0, 0xf1(R0) // crash RET +// func osyield() TEXT runtime·osyield(SB),NOSPLIT|NOFRAME,$0 MOVV $SYS_sched_yield, R11 SYSCALL RET +// func sched_getaffinity(pid, len uintptr, buf *uintptr) int32 TEXT runtime·sched_getaffinity(SB),NOSPLIT|NOFRAME,$0 MOVV pid+0(FP), R4 MOVV len+8(FP), R5