starnix_core/mm/vmex_resource.rs
1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use fidl_fuchsia_kernel as fkernel;
6use fuchsia_component::client::connect_to_protocol_sync;
7use std::sync::LazyLock;
8
9pub static VMEX_RESOURCE: LazyLock<zx::Resource> = LazyLock::new(|| {
10 connect_to_protocol_sync::<fkernel::VmexResourceMarker>()
11 .expect("couldn't connect to fuchsia.kernel.VmexResource")
12 .get(zx::MonotonicInstant::INFINITE)
13 .expect("couldn't talk to fuchsia.kernel.VmexResource")
14});