[syserror] Split usermem package

Split usermem package to help remove syserror dependency in go_marshal.
New hostarch package contains code not dependent on syserror.

PiperOrigin-RevId: 365651233
This commit is contained in:
Zach Koopmans
2021-03-29 13:30:21 -07:00
committed by gVisor bot
parent b125afba41
commit 8a2f7e716d
313 changed files with 2135 additions and 1955 deletions
+1
View File
@@ -15,6 +15,7 @@ go_library(
"//pkg/context",
"//pkg/cpuid",
"//pkg/fspath",
"//pkg/hostarch",
"//pkg/memutil",
"//pkg/sentry/fsbridge",
"//pkg/sentry/fsimpl/tmpfs",
+3 -1
View File
@@ -30,6 +30,8 @@ import (
"gvisor.dev/gvisor/pkg/sentry/vfs"
"gvisor.dev/gvisor/pkg/sync"
"gvisor.dev/gvisor/pkg/usermem"
"gvisor.dev/gvisor/pkg/hostarch"
)
// System represents the context for a single test.
@@ -105,7 +107,7 @@ func (s *System) Destroy() {
// ReadToEnd reads the contents of fd until EOF to a string.
func (s *System) ReadToEnd(fd *vfs.FileDescription) (string, error) {
buf := make([]byte, usermem.PageSize)
buf := make([]byte, hostarch.PageSize)
bufIOSeq := usermem.BytesIOSequence(buf)
opts := vfs.ReadOptions{}