Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

CACHE_$INTRO                      Domain/OS                       CACHE_$INTRO


NAME
     intro - the cache call

SYNOPSIS (C)
     #include <apollo/base.h>
     #include <apollo/cache.h>

     void cache_$clear(void)

SYNOPSIS (Pascal)
     %include '/sys/ins/base.ins.pas';
     %include '/sys/ins/cache.ins.pas';

     procedure cache_$clear;

SYNOPSIS (FORTRAN)
     %include '/sys/ins/base.ins.ftn'
     %include '/sys/ins/cache.ins.ftn'

              call cache_$clear

DESCRIPTION
     There is only one cache_$ call, cache_$clear.  It is used to clear the
     hardware caches when a program modifies an executable data segment during
     runtime (writes self-modifying code).  There are no status codes or data
     types associated with this call.  The cache_$clear call always clears the
     instruction stream cache (I-cache); on DN10000-series workstations and
     68040-based workstations, it also clears the data cache (D-cache).


Self-Modifying Code
     The normal method for creating self-modifying code is to write executable
     binary into an array and then transfer execution into that array.  Pro-
     grams must empty out the instruction cache by calling cache_$clear before
     executing the array, since none of the context stored in the cache will
     be valid after transferring execution.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026