1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
/* $OpenBSD: cmmu.h,v 1.3 2001/03/09 05:44:40 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
* HISTORY
*
*/
#ifndef __MACHINE_CMMU_H__
#define __MACHINE_CMMU_H__
#ifndef _LOCORE
#include <machine/mmu.h> /* batc_template_t */
#endif
#include <machine/board.h>
/* Area Description */
#define AREA_D_WT 0x00000200 /* write through */
#define AREA_D_G 0x00000080 /* global */
#define AREA_D_CI 0x00000040 /* cache inhibit */
#define AREA_D_TE 0x00000001 /* translation enable */
/* Segment Description */
#define SEG_D_WT 0x00000200 /* write through */
#define SEG_D_SP 0x00000100 /* supervisor protection */
#define SEG_D_G 0x00000080 /* global */
#define SEG_D_CI 0x00000040 /* cache inhibit */
#define SEG_D_WP 0x00000004 /* write protect */
#define SEG_D_V 0x00000001 /* valid */
/*
* Flags for cmmu_flush_tlb
*/
#define FLUSH_KERNEL 1
#define FLUSH_USER 0
#define FLUSH_ALL ((vm_offset_t)~0)
#ifndef _LOCORE
/*
* Prototypes and stuff for cmmu.c.
*/
extern unsigned cpu_sets[MAX_CPUS];
extern int cpu_cmmu_ratio;
extern unsigned ncpus;
extern unsigned cache_policy;
#ifdef CMMU_DEBUG
void show_apr(unsigned value);
void show_sctr(unsigned value);
#endif
#if DDB
void cmmu_show_translation(unsigned, unsigned, unsigned, int);
void cmmu_cache_state(unsigned, unsigned);
void show_cmmu_info(unsigned);
#endif
/*
* Prototypes from "mvme88k/mvme88k/cmmu.c
*/
unsigned cmmu_cpu_number(void);
#if !DDB
static
#endif /* !DDB */
unsigned cmmu_remote_get(unsigned cpu, unsigned r, unsigned data);
unsigned cmmu_get_idr(unsigned data);
void cmmu_init(void);
void cmmu_shutdown_now(void);
void cmmu_parity_enable(void);
#if !DDB
static
#endif /* !DDB */
void setup_board_config(void);
void setup_cmmu_config(void);
void cmmu_dump_config(void);
unsigned cmmu_get_by_mode(int cpu, int mode);
void cpu_configuration_print(int master);
void dma_cachectl(vm_offset_t va, int size, int op);
void cmmu_remote_set(unsigned cpu, unsigned r, unsigned data, unsigned x);
void cmmu_set_sapr(unsigned ap);
void cmmu_remote_set_sapr(unsigned cpu, unsigned ap);
void cmmu_set_uapr(unsigned ap);
void cmmu_flush_tlb(unsigned kernel, vm_offset_t vaddr, int size);
void cmmu_flush_remote_cache(int cpu, vm_offset_t physaddr, int size);
void cmmu_flush_cache(vm_offset_t physaddr, int size);
void cmmu_flush_remote_inst_cache(int cpu, vm_offset_t physaddr, int size);
void cmmu_flush_inst_cache(vm_offset_t physaddr, int size);
void cmmu_flush_remote_data_cache(int cpu, vm_offset_t physaddr, int size);
void cmmu_flush_data_cache(vm_offset_t physaddr, int size);
void cmmu_pmap_activate(
unsigned cpu,
unsigned uapr,
batc_template_t i_batc[BATC_MAX],
batc_template_t d_batc[BATC_MAX]);
void cmmu_flush_remote_tlb(
unsigned cpu,
unsigned kernel,
vm_offset_t vaddr,
int size);
void cmmu_set_batc_entry(
unsigned cpu,
unsigned entry_no,
unsigned data, /* 1 = data, 0 = instruction */
unsigned value); /* the value to stuff into the batc */
void cmmu_set_pair_batc_entry(
unsigned cpu,
unsigned entry_no,
unsigned value); /* the value to stuff into the batc */
#endif /* _LOCORE */
#endif /* __MACHINE_CMMU_H__ */
|