blob: 851e190cfe31ecc85b13b5d20ddf3e41b4911008 [file] [log] [blame]
// Copyright 2017 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.
#include "msd_arm_semaphore.h"
#include "magma_util/macros.h"
#include "msd.h"
magma_status_t msd_semaphore_import(uint32_t handle, msd_semaphore_t** semaphore_out)
{
auto semaphore = magma::PlatformSemaphore::Import(handle);
if (!semaphore)
return DRET_MSG(MAGMA_STATUS_INVALID_ARGS, "couldn't import semaphore handle");
*semaphore_out =
new MsdArmAbiSemaphore(std::shared_ptr<magma::PlatformSemaphore>(std::move(semaphore)));
return MAGMA_STATUS_OK;
}
void msd_semaphore_release(msd_semaphore_t* semaphore)
{
delete MsdArmAbiSemaphore::cast(semaphore);
}