Fri Dec 1 22:57:07 2017 UTC ()
note some bits no longer present in SuperSPARC-II.


(mrg)
diff -r1.97 -r1.98 src/sys/arch/sparc/sparc/cache.c

cvs diff -r1.97 -r1.98 src/sys/arch/sparc/sparc/cache.c (expand / switch to unified diff)

--- src/sys/arch/sparc/sparc/cache.c 2007/03/04 09:03:34 1.97
+++ src/sys/arch/sparc/sparc/cache.c 2017/12/01 22:57:07 1.98
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cache.c,v 1.97 2007/03/04 09:03:34 macallan Exp $ */ 1/* $NetBSD: cache.c,v 1.98 2017/12/01 22:57:07 mrg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 4 * Copyright (c) 1996
5 * The President and Fellows of Harvard College. All rights reserved. 5 * The President and Fellows of Harvard College. All rights reserved.
6 * Copyright (c) 1992, 1993 6 * Copyright (c) 1992, 1993
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 * 8 *
9 * This software was developed by the Computer Systems Engineering group 9 * This software was developed by the Computer Systems Engineering group
10 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 10 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
11 * contributed to Berkeley. 11 * contributed to Berkeley.
12 * 12 *
13 * All advertising materials mentioning features or use of this software 13 * All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement: 14 * must display the following acknowledgement:
@@ -49,27 +49,27 @@ @@ -49,27 +49,27 @@
49 * 49 *
50 * @(#)cache.c 8.2 (Berkeley) 10/30/93 50 * @(#)cache.c 8.2 (Berkeley) 10/30/93
51 * 51 *
52 */ 52 */
53 53
54/* 54/*
55 * Cache routines. 55 * Cache routines.
56 * 56 *
57 * TODO: 57 * TODO:
58 * - rework range flush 58 * - rework range flush
59 */ 59 */
60 60
61#include <sys/cdefs.h> 61#include <sys/cdefs.h>
62__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.97 2007/03/04 09:03:34 macallan Exp $"); 62__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.98 2017/12/01 22:57:07 mrg Exp $");
63 63
64#include "opt_multiprocessor.h" 64#include "opt_multiprocessor.h"
65#include "opt_sparc_arch.h" 65#include "opt_sparc_arch.h"
66 66
67#include <sys/param.h> 67#include <sys/param.h>
68#include <sys/systm.h> 68#include <sys/systm.h>
69#include <sys/kernel.h> 69#include <sys/kernel.h>
70 70
71#include <uvm/uvm_extern.h> 71#include <uvm/uvm_extern.h>
72 72
73#include <machine/ctlreg.h> 73#include <machine/ctlreg.h>
74#include <machine/pte.h> 74#include <machine/pte.h>
75 75
@@ -963,28 +963,28 @@ viking_pcache_flush_page(paddr_t pa, int @@ -963,28 +963,28 @@ viking_pcache_flush_page(paddr_t pa, int
963 * line: the line within the set (0-3) 963 * line: the line within the set (0-3)
964 * type: 1: read set tag; 2: read physical tag 964 * type: 1: read set tag; 2: read physical tag
965 * 965 *
966 * The (type 2) tag read from this address is a 64-bit word 966 * The (type 2) tag read from this address is a 64-bit word
967 * formatted as follows: 967 * formatted as follows:
968 * 968 *
969 * 5 4 4 969 * 5 4 4
970 * 63 6 8 0 23 0 970 * 63 6 8 0 23 0
971 * +-------+-+-------+-+-------+-+-----------+----------------+ 971 * +-------+-+-------+-+-------+-+-----------+----------------+
972 * | xxx |V| xxx |D| xxx |S| xxx | PA[35-12] | 972 * | xxx |V| xxx |D| xxx |S| xxx | PA[35-12] |
973 * +-------+-+-------+-+-------+-+-----------+----------------+ 973 * +-------+-+-------+-+-------+-+-----------+----------------+
974 * 974 *
975 * PA: bits 12-35 of the physical address 975 * PA: bits 12-35 of the physical address
976 * S: line shared bit 976 * S: line shared bit (not present on SuperSPARC-II)
977 * D: line dirty bit 977 * D: line dirty bit (not present on SuperSPARC-II)
978 * V: line valid bit 978 * V: line valid bit
979 */ 979 */
980 980
981#define VIKING_DCACHETAG_S 0x0000010000000000ULL /* line valid bit */ 981#define VIKING_DCACHETAG_S 0x0000010000000000ULL /* line valid bit */
982#define VIKING_DCACHETAG_D 0x0001000000000000ULL /* line dirty bit */ 982#define VIKING_DCACHETAG_D 0x0001000000000000ULL /* line dirty bit */
983#define VIKING_DCACHETAG_V 0x0100000000000000ULL /* line shared bit */ 983#define VIKING_DCACHETAG_V 0x0100000000000000ULL /* line shared bit */
984#define VIKING_DCACHETAG_PAMASK 0x0000000000ffffffULL /* PA tag field */ 984#define VIKING_DCACHETAG_PAMASK 0x0000000000ffffffULL /* PA tag field */
985 985
986 for (set = 0; set < 128; set++) { 986 for (set = 0; set < 128; set++) {
987 /* Set set number and access type */ 987 /* Set set number and access type */
988 tagaddr = (set << 5) | (2 << 30); 988 tagaddr = (set << 5) | (2 << 30);
989 989
990 /* Examine the tag for each line in the set */ 990 /* Examine the tag for each line in the set */