blob: f916d390182a3fee3297be9d0d6e8e9af9cc8a9d [file] [log] [blame] [edit]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.hardware.sysmem;
using fuchsia.sysmem;
using fuchsia.sysmem2;
using zx;
/// This interface is for driver-to-driver connection to sysmem. This includes both connection to
/// both sysmem/sysmem2 `Allocator`, and special-purpose connection for custom heaps and secure
/// memory.
@discoverable
closed protocol Sysmem {
/// Takes the server end of a FIDL connection that'll serve
/// fuchsia.sysmem.Allocator. If the connection fails, the channel will
/// close.
//
// TODO(fxb/104188): Maybe remove this method (see discussion in bug).
strict ConnectServer(resource struct {
allocator_request server_end:fuchsia.sysmem.Allocator;
});
// TODO(fxb/104188): Maybe remove this method (see discussion in bug).
//@transitional("Switch to requesting Allocator instead of serving this method.")
strict ConnectServerV2(resource table {
1: allocator_request server_end:fuchsia.sysmem2.Allocator;
});
/// Takes the client end of a FIDL connection that'll serve
/// fuchsia.sysmem2.Heap.
strict RegisterHeap(resource struct {
heap uint64;
heap_connection client_end:fuchsia.sysmem2.Heap;
});
/// Takes the client end of a FIDL connection that'll serve
/// fuchsia.sysmem.SecureMem, which is a protocol that's specific to
/// sysmem<->securemem concerns.
strict RegisterSecureMem(resource struct {
secure_mem_connection client_end:fuchsia.sysmem.SecureMem;
});
/// Informs sysmem that the channel previously passed to RegisterSecureMem()
/// will be closing soon, and that this channel closure should not be
/// considered an error.
strict UnregisterSecureMem() -> () error zx.Status;
};
service Service {
sysmem client_end:Sysmem;
allocator_v1 client_end:fuchsia.sysmem.Allocator;
allocator client_end:fuchsia.sysmem2.Allocator;
};