# MICache

## Definition

      #include <nitro/mi.h>

      typedef struct MICachePage
      {
          struct MICachePage *next;
          u32                 offset;
          u8                 *buffer;
      }
      MICachePage;

      typedef struct MICache
      {
      /* private: */
          u32             pagewidth;
          MICachePage    *valid;
          MICachePage    *invalid;
          MICachePage    *loading;
          int             valid_total;
          int             invalid_total;
          int             loading_total;
      }
      MICache;

## Description

This structure is for implementing a memory cache for the `MIDevice` structure.

This feature is a utility that enables efficient read access to devices. The structure has the following features:

- This improves the processing efficiency of the device control codes that perform semi-local random access.
  Previously loaded data is stored in units of pages, so when repeatedly referencing a limited range of data, the device is only accessed once.
- It allows you to write flexible asynchronous code that is both environment- and device-independent.
  Access to the cache and the actual load process are provided in fairly simple formats so you can implement an unfettered wait-for-completion routine tailored to the operations of your application.

## See Also

`MI_InitCache, MI_ReadCache, MI_LoadCache, MI_IsCacheLoading
MIDevice`

## Revision History

2007/05/16 Initial version.

CONFIDENTIAL