/*
 * $Header: /smsa/bsd:include/dev/memops.h:bsd  1.5  $
 * $Source: /smsa/bsd:include/dev/memops.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 */

#ifndef __dev_memops_h
#define __dev_memops_h

/* memops.h
 *
 * Operations on memory - implemented in assembler...
 *
 */

/* init_mem_16wr
 *
 * Initialise memory to "value" in units of 16 words over the range
 * [base..limit).  Base and limit are word-aligned addresses.  Limit
 * must have a value expressible as base + n*16*4 where n > 0.  A
 * minimum of 16 words is initialised.
 */

extern void init_mem_16wr (/* void *base, void *limit, int value */);


/* copy_mem_16wrf
 *
 * Copy a word-aligned area of memory defined by [sbase..slimit) to
 * the area starting at dbase.  Slimit must have a value expressible
 * as sbase + n*16*4 where n > 0.  A minimum of 16 words is copied.
 * The copy proceeds in forward order.
 */

extern void copy_mem_16wrf (/* void *sbase, void *slimit, void *dbase */);

/* copy_mem_16wrb
 * 
 * Copy a word-aligned area of memory defined by [slimit..sbase) to the
 * word-aligned area ending at dbase (exclusive of the byte at address
 * dbase).  A minimum of 16 words is copied.  The copy proceeds in
 * backwards order (i.e. through addresses decreasing from sbase/dbase
 * by 8-word blocks. BUT NOTE: the words in each 8-word block are copied
 * in FORWARD order.
 */

extern void copy_mem_16wrb (/* void *sbase, void *slimit, void *dbase */);

/* clear_M_charsegs
 *
 * Clears "count" 3 word wide by 28 lines deep 8-char blocks as used 
 * in the H96x32 text mode.  A line is 144 bytes long.  "start" is
 * the address of the first segment on the top line, of the block to
 * be cleared.
 */
extern void clear_M_charsegs (/* unsigned long *start, int count */);

/* bic_M_charseg
 *
 * Performs a 96-bit "bic" operation between the mask specified
 * as m[0..2] and each of 28 x 3-word segments each a line apart.
 * A set bit in m<n> corresponds to a bit which will be cleared
 * in memory.
 */
extern void bic_M_charseg (/* unsigned long *seg, unsigned long *mask */);

#endif/*__dev_memops_h*/

/* EOF memops.h */
