X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Ftpl_drv_disk.h;h=47efb0499cabccc3800c0317a62bc4ce4fa46aa1;hb=425494c449d668bf4728eef3a45f890432fd9999;hp=2af6f5510444c6bf796637737ed8772430d72a51;hpb=a9f9a331e2ee25ff68be6987fd645671038cbbde;p=tpg%2Facess2.git diff --git a/Kernel/include/tpl_drv_disk.h b/Kernel/include/tpl_drv_disk.h index 2af6f551..47efb049 100644 --- a/Kernel/include/tpl_drv_disk.h +++ b/Kernel/include/tpl_drv_disk.h @@ -40,10 +40,10 @@ enum eTplDisk_IOCtl { DISK_IOCTL_GETBLOCKSIZE = 4, /** - * ioctl(..., tTplDisk_CacheRegion *Region) + * ioctl(..., tTplDisk_CacheRegion *RegionInfo) * \brief Sets the cache importantce and protocol for a section of * memory. - * \param Region Pointer to a region information structure + * \param RegionInfo Pointer to a region information structure * \return Boolean failure */ DISK_IOCTL_SETCACHEREGION, @@ -51,12 +51,24 @@ enum eTplDisk_IOCtl { /** * ioctl(..., Uint64 *Info[2]) * \brief Asks the driver to precache a region of disk. - * \param Info 64-bit Address and Size pair describing the area to cache + * \param Region 64-bit Address and Size pair describing the area to cache * \return Number of blocks cached */ - DISK_IOCTL_PRECACHE + DISK_IOCTL_PRECACHE, + + /** + * ioclt(..., Uint64 *Region[2]) + * \brief Asks to driver to flush the region back to disk + * \param Region 64-bit Address and Size pair describing the area to flush + * \note If Region[0] == -1 then the entire disk's cache is flushed + * \return Number of blocks flushed (or 0 for entire disk) + */ + DISK_IOCTL_FLUSH }; +/** + * \brief Describes the cache parameters of a region on the disk + */ typedef struct sTplDisk_CacheRegion { Uint64 Base; //!< Base of cache region @@ -71,7 +83,11 @@ typedef struct sTplDisk_CacheRegion */ Uint8 Flags; Uint8 Priority; //!< Lower is a higher proritory - Uint16 CacheSize; //!< Maximum size of cache, in blocks + /** + * \brief Maximum size of cache, in blocks + * \note If CacheSize is zero, the implemenation defined limit is used + */ + Uint16 CacheSize; } tTplDisk_CacheRegion; /** @@ -80,8 +96,9 @@ typedef struct sTplDisk_CacheRegion enum eTplDisk_CacheProtocols { /** - * \brief Region is not cached + * \brief Don't cache the region */ + DISK_CACHEPROTO_DONTCACHE, /** * \brief Most recently used blocks cached @@ -98,22 +115,30 @@ enum eTplDisk_CacheProtocols /** * \brief Cache only on demand * - * Only cache when the ::DISK_IOCTL_PRECACHE ioctl is used + * Only cache when the ::DISK_IOCTL_PRECACHE IOCtl is used */ DISK_CACHEPROTO_EXPLICIT }; + +/** + * \brief Flags for the cache + */ enum eTplDisk_CacheFlags { - DISK_CACHEFLAG_WRITETHROUGH + /** + * \brief Write all changes to the region straight back to media + */ + DISK_CACHEFLAG_WRITETHROUGH = 0x10 }; /** * \brief IOCtl name strings */ -#define DRV_DISK_IOCTLNAMES "get_block_size", "set_cache_region" +#define DRV_DISK_IOCTLNAMES "get_block_size","set_cache_region","set_precache" /** - * \section Disk Driver Utilities + * \name Disk Driver Utilities + * \{ */ /** @@ -152,4 +177,8 @@ extern Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64 Length, void *Buffer, tDrvUtil_Callback ReadBlocks, tDrvUtil_Callback WriteBlocks, Uint64 BlockSize, Uint Argument); +/** + * \} + */ + #endif