mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Move //pkg/sentry/memutil to //pkg/memutil.
PiperOrigin-RevId: 252124156
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
load("//tools/go_stateify:defs.bzl", "go_library")
|
||||
|
||||
package(licenses = ["notice"])
|
||||
|
||||
go_library(
|
||||
name = "memutil",
|
||||
srcs = ["memutil_unsafe.go"],
|
||||
importpath = "gvisor.googlesource.com/gvisor/pkg/memutil",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@org_golang_x_sys//unix:go_default_library"],
|
||||
)
|
||||
@@ -12,6 +12,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build linux
|
||||
|
||||
// Package memutil provides a wrapper for the memfd_create() system call.
|
||||
package memutil
|
||||
|
||||
import (
|
||||
@@ -9,11 +9,11 @@ go_library(
|
||||
importpath = "gvisor.googlesource.com/gvisor/pkg/sentry/context/contexttest",
|
||||
visibility = ["//pkg/sentry:internal"],
|
||||
deps = [
|
||||
"//pkg/memutil",
|
||||
"//pkg/sentry/context",
|
||||
"//pkg/sentry/kernel/auth",
|
||||
"//pkg/sentry/kernel/time",
|
||||
"//pkg/sentry/limits",
|
||||
"//pkg/sentry/memutil",
|
||||
"//pkg/sentry/pgalloc",
|
||||
"//pkg/sentry/platform",
|
||||
"//pkg/sentry/platform/ptrace",
|
||||
|
||||
@@ -21,11 +21,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gvisor.googlesource.com/gvisor/pkg/memutil"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/context"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/kernel/auth"
|
||||
ktime "gvisor.googlesource.com/gvisor/pkg/sentry/kernel/time"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/limits"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/memutil"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/pgalloc"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/platform"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/platform/ptrace"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
load("//tools/go_stateify:defs.bzl", "go_library")
|
||||
|
||||
package(licenses = ["notice"])
|
||||
|
||||
go_library(
|
||||
name = "memutil",
|
||||
srcs = [
|
||||
"memutil.go",
|
||||
"memutil_unsafe.go",
|
||||
],
|
||||
importpath = "gvisor.googlesource.com/gvisor/pkg/sentry/memutil",
|
||||
visibility = ["//pkg/sentry:internal"],
|
||||
deps = ["@org_golang_x_sys//unix:go_default_library"],
|
||||
)
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2018 The gVisor Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package memutil contains the utility functions for memory operations.
|
||||
package memutil
|
||||
@@ -63,10 +63,10 @@ go_library(
|
||||
visibility = ["//pkg/sentry:internal"],
|
||||
deps = [
|
||||
"//pkg/log",
|
||||
"//pkg/memutil",
|
||||
"//pkg/sentry/arch",
|
||||
"//pkg/sentry/context",
|
||||
"//pkg/sentry/hostmm",
|
||||
"//pkg/sentry/memutil",
|
||||
"//pkg/sentry/platform",
|
||||
"//pkg/sentry/safemem",
|
||||
"//pkg/sentry/usage",
|
||||
|
||||
@@ -17,6 +17,6 @@ go_library(
|
||||
],
|
||||
deps = [
|
||||
"//pkg/bits",
|
||||
"//pkg/sentry/memutil",
|
||||
"//pkg/memutil",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"syscall"
|
||||
|
||||
"gvisor.googlesource.com/gvisor/pkg/bits"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/memutil"
|
||||
"gvisor.googlesource.com/gvisor/pkg/memutil"
|
||||
)
|
||||
|
||||
// MemoryKind represents a type of memory used by the application.
|
||||
|
||||
+1
-1
@@ -30,6 +30,7 @@ go_library(
|
||||
"//pkg/cpuid",
|
||||
"//pkg/eventchannel",
|
||||
"//pkg/log",
|
||||
"//pkg/memutil",
|
||||
"//pkg/rand",
|
||||
"//pkg/sentry/arch",
|
||||
"//pkg/sentry/arch:registers_go_proto",
|
||||
@@ -51,7 +52,6 @@ go_library(
|
||||
"//pkg/sentry/kernel/kdefs",
|
||||
"//pkg/sentry/limits",
|
||||
"//pkg/sentry/loader",
|
||||
"//pkg/sentry/memutil",
|
||||
"//pkg/sentry/pgalloc",
|
||||
"//pkg/sentry/platform",
|
||||
"//pkg/sentry/platform/kvm",
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
"gvisor.googlesource.com/gvisor/pkg/abi/linux"
|
||||
"gvisor.googlesource.com/gvisor/pkg/cpuid"
|
||||
"gvisor.googlesource.com/gvisor/pkg/log"
|
||||
"gvisor.googlesource.com/gvisor/pkg/memutil"
|
||||
"gvisor.googlesource.com/gvisor/pkg/rand"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/arch"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/control"
|
||||
@@ -37,7 +38,6 @@ import (
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/kernel"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/kernel/auth"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/loader"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/memutil"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/pgalloc"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/platform"
|
||||
"gvisor.googlesource.com/gvisor/pkg/sentry/platform/kvm"
|
||||
|
||||
Reference in New Issue
Block a user