simos_interface.c
2.29 KB
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
/*
* Copyright (C) 1996-1998 by the Board of Trustees
* of Leland Stanford Junior University.
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
/*
SimOS cache <-> Chal2 bus-interface definitions
by Stephen Gold, 6 May 1997
*/
#include "sim.h"
#include "machine_params.h"
#include "chal2/simos_interface.h"
#define DUMMY
static int linesize = 64;
#ifdef DUMMY
void Chal2CycleAdvance (void)
{
}
Result
Chal2Request (int cpu_id, int request_type, PA requested_paddr,
int request_id, PA replaced_paddr, int writeback_flag,
byte *replaced_data_ptr)
{
return SUCCESS;
}
#endif /* DUMMY */
void
Chal2Completion (unsigned cpu_id, int request_id, int new_cache_state,
void *returned_data_ptr)
{
CacheCmdDone((int)cpu_id, request_id, new_cache_state,
MEMSYS_STATUS_SUCCESS, 0x0, (byte *)returned_data_ptr);
}
bool
Chal2Flush (unsigned cpu_id, PA paddr, void *flushback_data_ptr)
{
return CacheWriteback ((int)cpu_id, paddr, linesize,
(byte *)flushback_data_ptr);
}
bool
Chal2Invalidate (unsigned cpu_id, PA paddr, bool *flushback_indicator,
void *flushback_data_ptr)
{
return CacheExtract ((int)cpu_id, paddr, linesize,
(int *)flushback_indicator, (byte *)flushback_data_ptr);
}
void
Chal2Unimplemented (void)
{
Sim_Error ("unimplemented chal2 function");
}
void
Chal2SetRemap (int cpunum, PA mask)
{
Sim_Error ("unimplemented chal2 function: SetRemap");
}
void
Chal2ControlRemap (int cpunum, int isEnabled)
{
Sim_Error ("unimplemented chal2 function: ControlRemap");
}
PA
Chal2GetNodeAddress (int cpu_id)
{
return (cpu_id * MEM_SIZE(0))/NUM_CPUS(0);
}
/*****************************************************************
* MemsysInit for Chal2
*****************************************************************/
void
Chal2MemInit (void)
{
memsysVec.type = CHAL2;
memsysVec.NoMemoryDelay = FALSE;
memsysVec.InMagicCR = FALSE;
memsysVec.MemsysCmd = Chal2Request;
memsysVec.MemsysDumpStats = Chal2Unimplemented;
memsysVec.MemsysDone = Chal2Unimplemented;
memsysVec.MemsysStatus = Chal2Unimplemented;
memsysVec.MemsysDrain = Chal2Unimplemented;
memsysVec.MemsysSetRemap = Chal2SetRemap;
memsysVec.MemsysControlRemap = Chal2ControlRemap;
memsysVec.MemsysGetNodeAddress = Chal2GetNodeAddress;
} /* Chal2MemInit () */