MI_InitCache

Syntax

#include <nitro/mi.h>

void MI_InitCache(MICache *cache, u32 page, void *buffer, u32 length);

Arguments

cache Pointer to the MICache structure to be initialized.
page Size of each cache page.
This size must be 4 bytes or greater, and must be a power of 2.
buffer Buffer used for cache page management information.
length Byte size of buffer. The library creates as many cache pages as possible of the specified size.
For more details, see the Description section below.

Return Values

None.

Description

Specifies the buffer and page size for the management information, and initializes the MICache structure.
This structure uses the buffer internally to prepare a cache page list.
This structure can be used to call MI_ReadCache() and MI_LoadCache().

The size of the buffer for management information can be specified to whatever size meets the application.
The library uses the values specified for page and length to automatically calculate the number of pages using the expression:

length / ( sizeof(MICachePage) + page )

It also internally manages the computation as a list structure. Conversely, if you want to compute the requisite byte size from the page size and the total number of pages, you can use the macro:

MI_CACHE_BUFFER_WORKSIZE(page, total)

This feature is a utility that enables efficient read access to devices. For more information, see the reference for the MICache structure.

See Also

MI_ReadCache MI_LoadCache MI_IsCacheLoading
MICache

Revision History

2007/05/16 Initial version.


CONFIDENTIAL