// Copyright (c) 2018 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.

/**
 * @file IMemManager.idl
 *
 * Describes the interface for a service that tracks and provides
 * information for memory backed objects, this service returns access
 * information and cachability information for the tracked memory objects.
 */

/** @cond */
interface IMemManager {
/** @endcond */
  error ERROR_INVALID_MEMREGION;

  /**
   * @addtogroup IMemManager
   * @{
   */

    /** @cond */
    /**
     * Constants
     */
    /** Mask applied to the 'flags' field to extract permissions data
      * See IMemRegion for values.
      */
    const uint32 PERM_MASK = 0x0000000F;

    /** Mask applied to the 'flags' field to extract cacheability data */
    const uint32 CACHE_MASK = 0xF0000000;

    /** Cacheability values: */
    const uint32 CACHE_DEFAULT = 0x00000000;
    const uint32 CACHE_NS_CACHED = 0x10000000;
    const uint32 CACHE_UNCACHED = 0x20000000;

    /**
       Retrieve the memory region information associated with a memory object
       The flags field uses the bitmask values as specified in the
       IMemRegion interface description.

       @note The memory manager service ensures the correctness of this
       data for as long as the map object exists.

       @param[in]  region      HLOS memory region object.
       @param[out] addr        Physical address of the memory area.
       @param[out] len         Size of the memory block.
       @param[out] memProperty Access permissions and cachabiity information
                               for the area (see IMemRegion). Upper bits will
                               contain cacheability information.
       @param[out] map         Map object.

       @return
       Object_OK on success.
    */
  method getRegionInfo(in interface region, out uint64 addr, out uint64 len, out uint32 memProperty, out interface map);

  /** @} */ /* end_addtogroup IMemManager */
};
