gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/sentry/devices/tpuproxy/BUILD (about) 1 load("//tools:defs.bzl", "go_library") 2 load("//tools/go_generics:defs.bzl", "go_template_instance") 3 4 package(default_applicable_licenses = ["//:license"]) 5 6 licenses(["notice"]) 7 8 go_library( 9 name = "tpuproxy", 10 srcs = [ 11 "devaddr_range.go", 12 "devaddr_set.go", 13 "device.go", 14 "ioctl_unsafe.go", 15 "seccomp_filter.go", 16 "tpu.go", 17 "tpu_mmap.go", 18 "vfio.go", 19 "vfio_mmap.go", 20 ], 21 visibility = [ 22 "//pkg/sentry:internal", 23 ], 24 deps = [ 25 "//pkg/abi/linux", 26 "//pkg/cleanup", 27 "//pkg/context", 28 "//pkg/devutil", 29 "//pkg/errors/linuxerr", 30 "//pkg/fdnotifier", 31 "//pkg/hostarch", 32 "//pkg/log", 33 "//pkg/marshal/primitive", 34 "//pkg/safemem", 35 "//pkg/seccomp", 36 "//pkg/sentry/arch", 37 "//pkg/sentry/fsimpl/eventfd", 38 "//pkg/sentry/fsimpl/kernfs", 39 "//pkg/sentry/kernel", 40 "//pkg/sentry/memmap", 41 "//pkg/sentry/mm", 42 "//pkg/sentry/vfs", 43 "//pkg/sync", 44 "//pkg/usermem", 45 "//pkg/waiter", 46 "@org_golang_x_exp//constraints:go_default_library", 47 "@org_golang_x_sys//unix:go_default_library", 48 ], 49 ) 50 51 go_template_instance( 52 name = "devaddr_range", 53 out = "devaddr_range.go", 54 package = "tpuproxy", 55 prefix = "DevAddr", 56 template = "//pkg/segment:generic_range", 57 types = { 58 "T": "uint64", 59 }, 60 ) 61 62 go_template_instance( 63 name = "devaddr_set", 64 out = "devaddr_set.go", 65 imports = { 66 "mm": "gvisor.dev/gvisor/pkg/sentry/mm", 67 }, 68 package = "tpuproxy", 69 prefix = "DevAddr", 70 template = "//pkg/segment:generic_set", 71 types = { 72 "Key": "uint64", 73 "Range": "DevAddrRange", 74 "Value": "mm.PinnedRange", 75 "Functions": "devAddrSetFuncs", 76 }, 77 )