/* * Copyright (C) 2022 Apple Inc. All rights reserved. * * This document is the property of Apple Inc. * It is considered confidential and proprietary. * * This document may not be reproduced or transmitted in any form, * in whole or in part, without the express written permission of * Apple Inc. */ #pragma once #if defined(KERNEL) || defined(XRT_HOSTED_INCLUDE) #include #include #include #include /** @section Primitive datatypes */ /** @brief Physical addresses */ typedef uint64_t XrtHosted_Phys_t; /** @brief Single virtually-mapped page */ typedef struct { unsigned char page[XrtHosted_Page_size]; } XrtHosted_AttrStruct XrtHosted_Mapped_t; /** @brief Identifier for the counter of a paricular queue */ typedef size_t XrtHosted_Counter_t; /** @section Shared constants */ /** @brief Failure return codes */ typedef enum : XrtHosted_Word_t { /** @brief Invalid error code */ XrtHosted_ErrorCode_Invalid, /** @brief Requested thread doesn't exist */ XrtHosted_ErrorCode_InvalidThread, /** @brief Requested thread isn't in the runqueue */ XrtHosted_ErrorCode_ThreadNotRunnable, } XrtHosted_AttrEnum XrtHosted_ErrorCode_t; /** @brief Time bases */ typedef enum : XrtHosted_Word_t { /** @brief Invalid timebase */ XrtHosted_Timer_Invalid, /** @brief Absolute time */ XrtHosted_Timer_Absolute, /** @brief Continuous time */ XrtHosted_Timer_Continuous, } XrtHosted_AttrEnum XrtHosted_Timer_t; /** @brief SMP status */ typedef enum : XrtHosted_Word_t { /** @brief Invalid status */ XrtHosted_SmpStatus_Invalid, /** @brief SMP is not supported with the given cL4 bundle */ XrtHosted_SmpStatus_Unsupported, /** @brief Exclaves can currently only run on the boot core */ XrtHosted_SmpStatus_Boot, /** @brief Exclaves can run on every cpu concurrently */ XrtHosted_SmpStatus_Multicore, /** @brief Exclaves can run on every cpu concurrently, using MPIDR to identify cores */ XrtHosted_SmpStatus_MulticoreMpidr, } XrtHosted_AttrEnum XrtHosted_SmpStatus_t; /** @brief Interruptibility of waits */ typedef enum : XrtHosted_Word_t { /** @brief Wait cannot be interrupted */ XrtHosted_Interruptibility_None, /** @brief Waiter volunteered for interrupt but the underlying queue * has a static lifetime */ XrtHosted_Interruptibility_Voluntary, /** @brief Wait is interruptible due to being on a queue with a dynamic * lifetime */ XrtHosted_Interruptibility_DynamicQueue, } XrtHosted_AttrEnum XrtHosted_Interruptibility_t; #endif /* defined(KERNEL) || defined(XRT_HOSTED_INCLUDE) */