gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/sentry/memmap/BUILD (about) 1 load("//tools:defs.bzl", "go_library", "go_test") 2 load("//tools/go_generics:defs.bzl", "go_template_instance") 3 4 package( 5 default_applicable_licenses = ["//:license"], 6 licenses = ["notice"], 7 ) 8 9 go_template_instance( 10 name = "mappable_range", 11 out = "mappable_range.go", 12 package = "memmap", 13 prefix = "Mappable", 14 template = "//pkg/segment:generic_range", 15 types = { 16 "T": "uint64", 17 }, 18 ) 19 20 go_template_instance( 21 name = "mapping_set_impl", 22 out = "mapping_set_impl.go", 23 package = "memmap", 24 prefix = "Mapping", 25 template = "//pkg/segment:generic_set", 26 types = { 27 "Key": "uint64", 28 "Range": "MappableRange", 29 "Value": "MappingsOfRange", 30 "Functions": "mappingSetFunctions", 31 }, 32 ) 33 34 go_template_instance( 35 name = "file_range", 36 out = "file_range.go", 37 package = "memmap", 38 prefix = "File", 39 template = "//pkg/segment:generic_range", 40 types = { 41 "T": "uint64", 42 }, 43 ) 44 45 go_library( 46 name = "memmap", 47 srcs = [ 48 "file_range.go", 49 "mappable_range.go", 50 "mapping_set.go", 51 "mapping_set_impl.go", 52 "memmap.go", 53 ], 54 visibility = ["//pkg/sentry:internal"], 55 deps = [ 56 "//pkg/context", 57 "//pkg/hostarch", 58 "//pkg/log", 59 "//pkg/safemem", 60 "//pkg/usermem", 61 ], 62 ) 63 64 go_test( 65 name = "memmap_test", 66 size = "small", 67 srcs = ["mapping_set_test.go"], 68 library = ":memmap", 69 deps = ["//pkg/hostarch"], 70 )