X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Fiocache.h;h=b6d9ffeee60a56b4100198884ea4e4f9b62a4669;hb=9fb3c9f3a8eaaacefc5e01718b2c88512a153e75;hp=f008a2d0ef64611b5690a285d302a18dcc0ce941;hpb=48743e39650eb1ef988380e9d95f27fd40d3a9ce;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/iocache.h b/KernelLand/Kernel/include/iocache.h index f008a2d0..b6d9ffee 100644 --- a/KernelLand/Kernel/include/iocache.h +++ b/KernelLand/Kernel/include/iocache.h @@ -26,7 +26,7 @@ typedef struct sIOCache tIOCache; * * Called to write a sector back to the device */ -typedef int (*tIOCache_WriteCallback)(Uint32 ID, Uint64 Sector, void *Buffer); +typedef int (*tIOCache_WriteCallback)(void *ID, Uint64 Sector, const void *Buffer); // === CONSTANTS === /** @@ -65,7 +65,7 @@ enum eIOCache_Modess { * \param SectorSize Size of a cached sector * \param CacheSize Maximum number of objects that can be in the cache at one time */ -tIOCache *IOCache_Create( tIOCache_WriteCallback Write, Uint32 ID, int SectorSize, int CacheSize ); +extern tIOCache *IOCache_Create( tIOCache_WriteCallback Write, void *ID, int SectorSize, int CacheSize ); /** * \brief Reads from a cached sector @@ -74,7 +74,7 @@ tIOCache *IOCache_Create( tIOCache_WriteCallback Write, Uint32 ID, int SectorSiz * \param Buffer Destination for the data read * \return 1 if the data was read, 0 if the sector is not cached, -1 on error */ - int IOCache_Read( tIOCache *Cache, Uint64 Sector, void *Buffer ); +extern int IOCache_Read( tIOCache *Cache, Uint64 Sector, void *Buffer ); /** * \brief Adds a sector to the cache @@ -83,7 +83,7 @@ tIOCache *IOCache_Create( tIOCache_WriteCallback Write, Uint32 ID, int SectorSiz * \param Buffer Data to cache * \return 1 on success, 0 if the sector is already cached, -1 on error */ - int IOCache_Add( tIOCache *Cache, Uint64 Sector, void *Buffer ); +extern int IOCache_Add( tIOCache *Cache, Uint64 Sector, const void *Buffer ); /** * \brief Writes to a cached sector @@ -96,7 +96,7 @@ tIOCache *IOCache_Create( tIOCache_WriteCallback Write, Uint32 ID, int SectorSiz * Wether the Write callback is called depends on the selected caching * behaviour. */ - int IOCache_Write( tIOCache *Cache, Uint64 Sector, void *Buffer ); +extern int IOCache_Write( tIOCache *Cache, Uint64 Sector, const void *Buffer ); /** * \brief Flush altered sectors out to the device @@ -105,7 +105,7 @@ tIOCache *IOCache_Create( tIOCache_WriteCallback Write, Uint32 ID, int SectorSiz * This will call the cache's write callback on each altered sector * to flush the write cache. */ -void IOCache_Flush( tIOCache *Cache ); +extern void IOCache_Flush( tIOCache *Cache ); /** * \brief Flushes the cache and then removes it @@ -115,6 +115,6 @@ void IOCache_Flush( tIOCache *Cache ); * IOCache_Destroy writes all changed sectors to the device and then * deallocates the cache for other systems to use. */ -void IOCache_Destroy( tIOCache *Cache ); +extern void IOCache_Destroy( tIOCache *Cache ); #endif