[rights][syscalls] Remove use of zx_log_read/write from third_party/go
Use zx_debuglog_ instead, zx_log_ being removed.
ZX-2184 #comment [rights][syscalls] Remove use of zx_log_read/write from third_party/go
Test: CQ
Change-Id: Ic3e4a5babbf581bab1586e6df33c89353a7ccf4a
diff --git a/src/runtime/os_fuchsia.go b/src/runtime/os_fuchsia.go
index c05954f..01368b0 100644
--- a/src/runtime/os_fuchsia.go
+++ b/src/runtime/os_fuchsia.go
@@ -292,7 +292,7 @@
c := *(*byte)(unsafe.Pointer(uintptr(buf) + uintptr(i)))
if c == '\n' {
- zx.Sys_log_write(logger, uint32(logBufferN), unsafe.Pointer(&logBufferArray[0]), 0)
+ zx.Sys_debuglog_write(logger, 0, unsafe.Pointer(&logBufferArray[0]), uint(logBufferN))
logBufferN = 0
continue
}
@@ -305,7 +305,7 @@
logBufferN++
if logBufferN == len(logBufferArray) {
- zx.Sys_log_write(logger, uint32(logBufferN), unsafe.Pointer(&logBufferArray[0]), 0)
+ zx.Sys_debuglog_write(logger, 0, unsafe.Pointer(&logBufferArray[0]), uint(logBufferN))
logBufferN = 0
}
}
diff --git a/src/runtime/vdso_keys_fuchsia.go b/src/runtime/vdso_keys_fuchsia.go
index e8dce55..9d08cda 100644
--- a/src/runtime/vdso_keys_fuchsia.go
+++ b/src/runtime/vdso_keys_fuchsia.go
@@ -115,8 +115,6 @@
{"_zx_profile_create", 0x28e1bf39, &vdso_zx_profile_create},
{"_zx_vmar_unmap_handle_close_thread_exit", 0x5a372afb, &vdso_zx_vmar_unmap_handle_close_thread_exit},
{"_zx_futex_wake_handle_close_thread_exit", 0x49731cb8, &vdso_zx_futex_wake_handle_close_thread_exit},
- {"_zx_log_write", 0xac986281, &vdso_zx_log_write},
- {"_zx_log_read", 0x33c39852, &vdso_zx_log_read},
{"_zx_debuglog_create", 0x2504f1, &vdso_zx_debuglog_create},
{"_zx_debuglog_write", 0x3f7aa088, &vdso_zx_debuglog_write},
{"_zx_debuglog_read", 0x66c2b179, &vdso_zx_debuglog_read},
@@ -253,8 +251,6 @@
//go:cgo_import_dynamic vdso_zx_profile_create _zx_profile_create
//go:cgo_import_dynamic vdso_zx_vmar_unmap_handle_close_thread_exit _zx_vmar_unmap_handle_close_thread_exit
//go:cgo_import_dynamic vdso_zx_futex_wake_handle_close_thread_exit _zx_futex_wake_handle_close_thread_exit
-//go:cgo_import_dynamic vdso_zx_log_write _zx_log_write
-//go:cgo_import_dynamic vdso_zx_log_read _zx_log_read
//go:cgo_import_dynamic vdso_zx_debuglog_create _zx_debuglog_create
//go:cgo_import_dynamic vdso_zx_debuglog_write _zx_debuglog_write
//go:cgo_import_dynamic vdso_zx_debuglog_read _zx_debuglog_read
@@ -390,8 +386,6 @@
//go:linkname vdso_zx_profile_create vdso_zx_profile_create
//go:linkname vdso_zx_vmar_unmap_handle_close_thread_exit vdso_zx_vmar_unmap_handle_close_thread_exit
//go:linkname vdso_zx_futex_wake_handle_close_thread_exit vdso_zx_futex_wake_handle_close_thread_exit
-//go:linkname vdso_zx_log_write vdso_zx_log_write
-//go:linkname vdso_zx_log_read vdso_zx_log_read
//go:linkname vdso_zx_debuglog_create vdso_zx_debuglog_create
//go:linkname vdso_zx_debuglog_write vdso_zx_debuglog_write
//go:linkname vdso_zx_debuglog_read vdso_zx_debuglog_read
@@ -826,14 +820,6 @@
//go:noescape
//go:nosplit
-func vdsoCall_zx_log_write(handle uint32, len uint32, buffer unsafe.Pointer, options uint32) int32
-
-//go:noescape
-//go:nosplit
-func vdsoCall_zx_log_read(handle uint32, len uint32, buffer unsafe.Pointer, options uint32) int32
-
-//go:noescape
-//go:nosplit
func vdsoCall_zx_debuglog_create(resource uint32, options uint32, out unsafe.Pointer) int32
//go:noescape
@@ -1072,8 +1058,6 @@
vdso_zx_profile_create uintptr
vdso_zx_vmar_unmap_handle_close_thread_exit uintptr
vdso_zx_futex_wake_handle_close_thread_exit uintptr
- vdso_zx_log_write uintptr
- vdso_zx_log_read uintptr
vdso_zx_debuglog_create uintptr
vdso_zx_debuglog_write uintptr
vdso_zx_debuglog_read uintptr
diff --git a/src/runtime/vdsocalls_fuchsia_amd64.s b/src/runtime/vdsocalls_fuchsia_amd64.s
index 8355daf..70460d7 100644
--- a/src/runtime/vdsocalls_fuchsia_amd64.s
+++ b/src/runtime/vdsocalls_fuchsia_amd64.s
@@ -2229,52 +2229,6 @@
MOVQ $0, m_vdsoSP(R14)
RET
-// func vdsoCall_zx_log_write(handle uint32, len uint32, buffer unsafe.Pointer, options uint32) int32
-TEXT runtime·vdsoCall_zx_log_write(SB),NOSPLIT,$8-28
- GO_ARGS
- NO_LOCAL_POINTERS
- get_tls(CX)
- MOVQ g(CX), AX
- MOVQ g_m(AX), R14
- PUSHQ R14
- MOVQ 24(SP), DX
- MOVQ DX, m_vdsoPC(R14)
- LEAQ 24(SP), DX
- MOVQ DX, m_vdsoSP(R14)
- MOVL handle+0(FP), DI
- MOVL len+4(FP), SI
- MOVQ buffer+8(FP), DX
- MOVL options+16(FP), CX
- MOVQ vdso_zx_log_write(SB), AX
- CALL AX
- MOVL AX, ret+24(FP)
- POPQ R14
- MOVQ $0, m_vdsoSP(R14)
- RET
-
-// func vdsoCall_zx_log_read(handle uint32, len uint32, buffer unsafe.Pointer, options uint32) int32
-TEXT runtime·vdsoCall_zx_log_read(SB),NOSPLIT,$8-28
- GO_ARGS
- NO_LOCAL_POINTERS
- get_tls(CX)
- MOVQ g(CX), AX
- MOVQ g_m(AX), R14
- PUSHQ R14
- MOVQ 24(SP), DX
- MOVQ DX, m_vdsoPC(R14)
- LEAQ 24(SP), DX
- MOVQ DX, m_vdsoSP(R14)
- MOVL handle+0(FP), DI
- MOVL len+4(FP), SI
- MOVQ buffer+8(FP), DX
- MOVL options+16(FP), CX
- MOVQ vdso_zx_log_read(SB), AX
- CALL AX
- MOVL AX, ret+24(FP)
- POPQ R14
- MOVQ $0, m_vdsoSP(R14)
- RET
-
// func vdsoCall_zx_debuglog_create(resource uint32, options uint32, out unsafe.Pointer) int32
TEXT runtime·vdsoCall_zx_debuglog_create(SB),NOSPLIT,$8-20
GO_ARGS
diff --git a/src/runtime/vdsocalls_fuchsia_arm64.s b/src/runtime/vdsocalls_fuchsia_arm64.s
index 88b0e6e..c251503 100644
--- a/src/runtime/vdsocalls_fuchsia_arm64.s
+++ b/src/runtime/vdsocalls_fuchsia_arm64.s
@@ -1616,40 +1616,6 @@
MOVD $0, m_vdsoSP(R21)
RET
-// func vdsoCall_zx_log_write(handle uint32, len uint32, buffer unsafe.Pointer, options uint32) int32
-TEXT runtime·vdsoCall_zx_log_write(SB),NOSPLIT,$0-28
- GO_ARGS
- NO_LOCAL_POINTERS
- MOVD g_m(g), R21
- MOVD LR, m_vdsoPC(R21)
- MOVD RSP, R20
- MOVD R20, m_vdsoSP(R21)
- MOVW handle+0(FP), R0
- MOVW len+4(FP), R1
- MOVD buffer+8(FP), R2
- MOVW options+16(FP), R3
- BL vdso_zx_log_write(SB)
- MOVW R0, ret+24(FP)
- MOVD $0, m_vdsoSP(R21)
- RET
-
-// func vdsoCall_zx_log_read(handle uint32, len uint32, buffer unsafe.Pointer, options uint32) int32
-TEXT runtime·vdsoCall_zx_log_read(SB),NOSPLIT,$0-28
- GO_ARGS
- NO_LOCAL_POINTERS
- MOVD g_m(g), R21
- MOVD LR, m_vdsoPC(R21)
- MOVD RSP, R20
- MOVD R20, m_vdsoSP(R21)
- MOVW handle+0(FP), R0
- MOVW len+4(FP), R1
- MOVD buffer+8(FP), R2
- MOVW options+16(FP), R3
- BL vdso_zx_log_read(SB)
- MOVW R0, ret+24(FP)
- MOVD $0, m_vdsoSP(R21)
- RET
-
// func vdsoCall_zx_debuglog_create(resource uint32, options uint32, out unsafe.Pointer) int32
TEXT runtime·vdsoCall_zx_debuglog_create(SB),NOSPLIT,$0-20
GO_ARGS
diff --git a/src/syscall/zx/handle.go b/src/syscall/zx/handle.go
index 9fc11fb..a0aec84 100644
--- a/src/syscall/zx/handle.go
+++ b/src/syscall/zx/handle.go
@@ -549,7 +549,7 @@
p = unsafe.Pointer(&b[0])
}
- status := Sys_log_write(Handle(l), uint32(len(b)), p, 0)
+ status := Sys_debuglog_write(Handle(l), 0, p, uint(len(b)))
if status != ErrOk {
return 0, Error{Status: status, Text: "zx.Log.Write"}
}
@@ -557,7 +557,7 @@
}
func (l Log) Read(b []byte) (n int, err error) {
- status := Sys_log_read(Handle(l), uint32(len(b)), unsafe.Pointer(&b[0]), 0)
+ status := Sys_debuglog_read(Handle(l), 0, unsafe.Pointer(&b[0]), uint(len(b)))
if status != ErrOk {
return 0, Error{Status: status, Text: "zx.Log.Read"}
}
diff --git a/src/syscall/zx/syscalls_fuchsia.go b/src/syscall/zx/syscalls_fuchsia.go
index adbf223..b3d60a5 100644
--- a/src/syscall/zx/syscalls_fuchsia.go
+++ b/src/syscall/zx/syscalls_fuchsia.go
@@ -407,14 +407,6 @@
//go:noescape
//go:nosplit
-func Sys_log_write(handle Handle, len uint32, buffer unsafe.Pointer, options uint32) Status
-
-//go:noescape
-//go:nosplit
-func Sys_log_read(handle Handle, len uint32, buffer unsafe.Pointer, options uint32) Status
-
-//go:noescape
-//go:nosplit
func Sys_debuglog_create(resource Handle, options uint32, out *Handle) Status
//go:noescape
diff --git a/src/syscall/zx/syscalls_fuchsia_amd64.s b/src/syscall/zx/syscalls_fuchsia_amd64.s
index 3c82020..7d8a6a5 100644
--- a/src/syscall/zx/syscalls_fuchsia_amd64.s
+++ b/src/syscall/zx/syscalls_fuchsia_amd64.s
@@ -402,14 +402,6 @@
TEXT ·Sys_futex_wake_handle_close_thread_exit(SB),NOSPLIT,$0
JMP runtime·vdsoCall_zx_futex_wake_handle_close_thread_exit(SB)
-// func Sys_log_write(handle Handle, len uint32, buffer unsafe.Pointer, options uint32) Status
-TEXT ·Sys_log_write(SB),NOSPLIT,$0
- JMP runtime·vdsoCall_zx_log_write(SB)
-
-// func Sys_log_read(handle Handle, len uint32, buffer unsafe.Pointer, options uint32) Status
-TEXT ·Sys_log_read(SB),NOSPLIT,$0
- JMP runtime·vdsoCall_zx_log_read(SB)
-
// func Sys_debuglog_create(resource Handle, options uint32, out *Handle) Status
TEXT ·Sys_debuglog_create(SB),NOSPLIT,$0
JMP runtime·vdsoCall_zx_debuglog_create(SB)
diff --git a/src/syscall/zx/syscalls_fuchsia_arm64.s b/src/syscall/zx/syscalls_fuchsia_arm64.s
index 3c82020..7d8a6a5 100644
--- a/src/syscall/zx/syscalls_fuchsia_arm64.s
+++ b/src/syscall/zx/syscalls_fuchsia_arm64.s
@@ -402,14 +402,6 @@
TEXT ·Sys_futex_wake_handle_close_thread_exit(SB),NOSPLIT,$0
JMP runtime·vdsoCall_zx_futex_wake_handle_close_thread_exit(SB)
-// func Sys_log_write(handle Handle, len uint32, buffer unsafe.Pointer, options uint32) Status
-TEXT ·Sys_log_write(SB),NOSPLIT,$0
- JMP runtime·vdsoCall_zx_log_write(SB)
-
-// func Sys_log_read(handle Handle, len uint32, buffer unsafe.Pointer, options uint32) Status
-TEXT ·Sys_log_read(SB),NOSPLIT,$0
- JMP runtime·vdsoCall_zx_log_read(SB)
-
// func Sys_debuglog_create(resource Handle, options uint32, out *Handle) Status
TEXT ·Sys_debuglog_create(SB),NOSPLIT,$0
JMP runtime·vdsoCall_zx_debuglog_create(SB)