summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/stand/libsa
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-08-29 01:56:59 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-08-29 01:56:59 +0000
commite245092790e052e2d693d0653491e9b75f91b7a7 (patch)
treeff1e017c0a2201ed5ec7d0586cb1744878e8cd01 /sys/arch/hppa/stand/libsa
parent7563c7a84b4051ed3185e7f0ea545d4ffe2fbd93 (diff)
more functions
Diffstat (limited to 'sys/arch/hppa/stand/libsa')
-rw-r--r--sys/arch/hppa/stand/libsa/cache_c.c130
-rw-r--r--sys/arch/hppa/stand/libsa/cache_s.s220
2 files changed, 0 insertions, 350 deletions
diff --git a/sys/arch/hppa/stand/libsa/cache_c.c b/sys/arch/hppa/stand/libsa/cache_c.c
deleted file mode 100644
index d8f90394496..00000000000
--- a/sys/arch/hppa/stand/libsa/cache_c.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* $OpenBSD: cache_c.c,v 1.2 1998/07/08 21:34:31 mickey Exp $ */
-/* $NOWHERE: cache_c.c,v 2.1 1998/06/22 19:34:46 mickey Exp $ */
-
-/*
- * Copyright 1996 1995 by Open Software Foundation, Inc.
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation.
- *
- * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
- * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * pmk1.1
- */
-/*
- * (c) Copyright 1988 HEWLETT-PACKARD COMPANY
- *
- * To anyone who acknowledges that this file is provided "AS IS"
- * without any express or implied warranty:
- * permission to use, copy, modify, and distribute this file
- * for any purpose is hereby granted without fee, provided that
- * the above copyright notice and this notice appears in all
- * copies, and that the name of Hewlett-Packard Company not be
- * used in advertising or publicity pertaining to distribution
- * of the software without specific, written prior permission.
- * Hewlett-Packard Company makes no representations about the
- * suitability of this software for any purpose.
- */
-/*
- * HISTORY
- * $Log: cache_c.c,v $
- * Revision 1.2 1998/07/08 21:34:31 mickey
- * use those new pdc call types
- *
- * Revision 1.1.1.1 1998/06/23 18:46:41 mickey
- * ok, it boots, include and libkern to come
- *
- * Revision 2.1 1998/06/22 19:34:46 mickey
- * add cache manipulating routines
- *
- * Revision 1.1.2.1 1996/08/19 07:46:48 bruel
- * First revision
- * [1996/08/02 09:17:19 bruel]
- *
- * Revision 1.1.1.2 1996/08/02 09:17:19 bruel
- * First revision
- *
- * Revision 1.1.2.2 91/11/20 16:21:21 sharpe
- * Initial version from DSEE
- * [91/11/20 16:08:06 sharpe]
- *
- */
-
-/*
- * Stolen - Lock, stock, and barrel from tmm's pmap* .
- */
-
-#include "libsa.h"
-#include <machine/pdc.h>
-
-void
-fall(c_base, c_count, c_loop, c_stride, rot)
- int c_base, c_count, c_loop, c_stride;
- void (*rot)();
-{
- int addr, count, loop; /* Internal vars */
-
- addr = c_base;
- for (count = 0; count < c_count; count++) {
- for (loop = 0; loop < c_loop; loop++) {
- (*rot)(0, addr);
- }
- addr += c_stride;
- }
-
-}
-
-/*
- * fcacheall - Flush all caches.
- *
- * This routine is just a wrapper around the real cache flush routine.
- *
- * Parameters:
- * None.
- *
- * Returns:
- * Hopefully.
- */
-struct pdc_cache pdc_cacheinfo __attribute__ ((aligned(8)));
-
-void
-fcacheall()
-{
- extern int fice();
- extern int fdce();
- int err;
-
- err = (*pdc)(PDC_CACHE, PDC_CACHE_DFLT, &pdc_cacheinfo);
- if (err) {
-#ifdef DEBUG
- if (debug)
- printf("fcacheall: PDC_CACHE failed (%d).\n", err);
-#endif
- return;
- }
-
- /*
- * Flush the instruction, then data cache.
- */
- fall(pdc_cacheinfo.ic_base, pdc_cacheinfo.ic_count, pdc_cacheinfo.ic_loop,
- pdc_cacheinfo.ic_stride, fice);
- sync_caches();
- fall(pdc_cacheinfo.dc_base, pdc_cacheinfo.dc_count, pdc_cacheinfo.dc_loop,
- pdc_cacheinfo.dc_stride, fdce);
- sync_caches();
-}
-
diff --git a/sys/arch/hppa/stand/libsa/cache_s.s b/sys/arch/hppa/stand/libsa/cache_s.s
deleted file mode 100644
index 0812143d4a6..00000000000
--- a/sys/arch/hppa/stand/libsa/cache_s.s
+++ /dev/null
@@ -1,220 +0,0 @@
-/* $OpenBSD: cache_s.s,v 1.1 1998/06/23 18:46:42 mickey Exp $ */
-/* $NOWHERE: cache_s.s,v 2.1 1998/06/22 19:34:46 mickey Exp $ */
-
-/*
- * Copyright 1996 1995 by Open Software Foundation, Inc.
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation.
- *
- * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
- * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * pmk1.1
- */
-/*
- * (c) Copyright 1988 HEWLETT-PACKARD COMPANY
- *
- * To anyone who acknowledges that this file is provided "AS IS"
- * without any express or implied warranty:
- * permission to use, copy, modify, and distribute this file
- * for any purpose is hereby granted without fee, provided that
- * the above copyright notice and this notice appears in all
- * copies, and that the name of Hewlett-Packard Company not be
- * used in advertising or publicity pertaining to distribution
- * of the software without specific, written prior permission.
- * Hewlett-Packard Company makes no representations about the
- * suitability of this software for any purpose.
- */
-/*
- * HISTORY
- * $Log: cache_s.s,v $
- * Revision 1.1 1998/06/23 18:46:42 mickey
- * Initial revision
- *
- * Revision 2.1 1998/06/22 19:34:46 mickey
- * add cache manipulating routines
- *
- * Revision 1.1.2.1 1996/08/19 07:47:16 bruel
- * First revision
- * [1996/08/02 09:17:26 bruel]
- *
- * Revision 1.1.1.2 1996/08/02 09:17:26 bruel
- * First revision
- *
- * Revision 1.1.2.2 91/11/20 16:21:39 sharpe
- * Initial version from DSEE
- * [91/11/20 16:08:35 sharpe]
- *
- */
-
-/*
- * FlushDCache(start,size)
- * Stolen from pmap_fdcache.
- * void FlushDCache(space, start, end) - Flush the data cache.
- *
- * This routine flushes the given range of virtual addresses, from start (inclusive)
- * to end (exclusive) from the data cache.
- *
- */
- .space $TEXT$
- .subspa $CODE$
-
- .export FlushDCache,entry
- .proc
- .callinfo
-FlushDCache
- .entry
-
- comb,= %arg1,%r0,FDCdone /* If len=0, then done */
- ldi 0x10,%r21
- ldi 0x0f,%r22
- add %arg0,%arg1,%r20
- andcm %arg0,%r22,%arg0 /* Truncate lower bound to stridesize boundary */
- sub %r20,%arg0,%arg1
- ldi 0xff,%r22
- add %arg1,%r22,%arg1
- andcm %arg1,%r22,%arg1
- add %arg0,%arg1,%r20 /* Round up upper bound */
- fdc,m %r21(%arg0)
-FDCloop
- fdc,m %r21(%arg0) /* Flush block */
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- fdc,m %r21(%arg0)
- comb,<<,n %arg0,%r20,FDCloop /* Continue until fstart = fend */
- fdc,m %r21(%arg0)
-FDCdone
- bv 0(%rp) /* return */
- nop
- .exit
- .procend
-
- .export FlushICache,entry
- .proc
- .callinfo
-FlushICache
- .entry
-
- comb,= %arg1,%r0,PICdone /* If len=0, then done */
- ldi 0x10,%r21
- ldi 0x0f,%r22
- add %arg0,%arg1,%r20
- andcm %arg0,%r22,%arg0 /* Truncate lower bound to stridesize boundary */
- sub %r20,%arg0,%arg1
- ldi 0xff,%r22
- add %arg1,%r22,%arg1
- andcm %arg1,%r22,%arg1
- add %arg0,%arg1,%r20 /* Round up upper bound */
- fic,m %r21(%arg0)
-PICloop
- fic,m %r21(%arg0) /* Flush block */
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- fic,m %r21(%arg0)
- comb,<<,n %arg0,%r20,PICloop /* Continue until fstart = fend */
- fic,m %r21(%arg0)
-PICdone
- bv 0(%rp) /* return */
- nop
- .exit
- .procend
-
-/*
- * void sync_caches - Synchronize the cache.
- *
- * This routine executes a sync instruction and executes 7 nops.
- * Intended to be used with kdb when setting breakpoints.
- * Stolen from pmap_as.s.
- */
- .export sync_caches,entry
- .proc
- .callinfo
-sync_caches
- .entry
-
- sync /* Sync access */
- nop /* voodoo */
- nop
- nop
- nop
- nop
- nop
- bv 0(%rp)
- nop
- .exit
- .procend
-
-/*
- * void fdce(space, offset) - Perform fdce operation.
- *
- * This routine is called by pmap_fcacheall to whack the data cache. Must
- * be only used inside an architectured loop.
- */
- .export fdce,entry
- .proc
- .callinfo
-fdce
- .entry
-
- fdce 0(0,%arg1) /* Space does not make a difference */
- sync
- bv 0(%rp)
- nop
- .exit
- .procend
-
-/*
- * void fice(space, offset) - Perform fice operation.
- *
- * This routine is called by pmap_fcacheall to whack the instruction cache.
- * Must be only used inside an architectured loop
- */
- .export fice,entry
- .proc
- .callinfo
-fice
- .entry
- fice 0(0,%arg1) /* Space does not make a difference */
- sync
- bv 0(%rp)
- .exit
- .procend
-
- .end
-