home *** CD-ROM | disk | FTP | other *** search
- #ifndef cache_H
- #define cache_H
-
- /* C header file for Cache
- * written by DefMod (Sep 7 1994) on Wed Sep 7 21:25:39 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef Cache_Control
- #define Cache_Control 0x280
- #undef XCache_Control
- #define XCache_Control 0x20280
- #undef Cache_Cacheable
- #define Cache_Cacheable 0x281
- #undef XCache_Cacheable
- #define XCache_Cacheable 0x20281
- #undef Cache_Updateable
- #define Cache_Updateable 0x282
- #undef XCache_Updateable
- #define XCache_Updateable 0x20282
- #undef Cache_Disruptive
- #define Cache_Disruptive 0x283
- #undef XCache_Disruptive
- #define XCache_Disruptive 0x20283
- #undef Cache_Flush
- #define Cache_Flush 0x284
- #undef XCache_Flush
- #define XCache_Flush 0x20284
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: cache_control()
- *
- * Description: Turns the cache on or off
- *
- * Input: eor_mask - value of R0 on entry
- * and_mask - value of R1 on entry
- *
- * Output: old_state - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x280.
- */
-
- extern os_error *xcache_control (bits eor_mask,
- bits and_mask,
- bits *old_state);
- extern bits cache_control (bits eor_mask,
- bits and_mask);
-
- /* ------------------------------------------------------------------------
- * Function: cache_cacheable()
- *
- * Description: Controls which area of memory may be cached
- *
- * Input: eor_mask - value of R0 on entry
- * and_mask - value of R1 on entry
- *
- * Output: old_state - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x281.
- */
-
- extern os_error *xcache_cacheable (bits eor_mask,
- bits and_mask,
- bits *old_state);
- extern bits cache_cacheable (bits eor_mask,
- bits and_mask);
-
- /* ------------------------------------------------------------------------
- * Function: cache_updateable()
- *
- * Description: Controls which area of memory will be automatically
- * updated in the cache
- *
- * Input: eor_mask - value of R0 on entry
- * and_mask - value of R1 on entry
- *
- * Output: old_state - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x282.
- */
-
- extern os_error *xcache_updateable (bits eor_mask,
- bits and_mask,
- bits *old_state);
- extern bits cache_updateable (bits eor_mask,
- bits and_mask);
-
- /* ------------------------------------------------------------------------
- * Function: cache_disruptive()
- *
- * Description: Controls which areas of memory cause automatic flushing
- * of the cache on a write
- *
- * Input: eor_mask - value of R0 on entry
- * and_mask - value of R1 on entry
- *
- * Output: old_state - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x283.
- */
-
- extern os_error *xcache_disruptive (bits eor_mask,
- bits and_mask,
- bits *old_state);
- extern bits cache_disruptive (bits eor_mask,
- bits and_mask);
-
- /* ------------------------------------------------------------------------
- * Function: cache_flush()
- *
- * Description: Flushes the cache
- *
- * Other notes: Calls SWI 0x284.
- */
-
- extern os_error *xcache_flush (void);
- extern void cache_flush (void);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-