solo.h
1.88 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
/*
* 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.
*
*/
/*****************************************************************
* solo.h
*
*****************************************************************/
#ifndef SOLO_H
#define SOLO_H
#include "cpu_state.h"
#include "simtypes.h"
#include "eventcallback.h"
#include "machine_params.h"
typedef struct soloState {
bool inBarrier;
SimTime syncStallStart;
EventCallbackHdr syncCallback;
void (*syncDoneCallback)(int cpuNum); /* Called when a sync finishes */
/* For explanations, see solo/syscall.c */
#define SYSCALL_BUF_SIZE 16384
int syscallNum; /* Sanity check for syscalls I can't
* handle atomically */
char syscallBuf[2][SYSCALL_BUF_SIZE];
/* Two buffers for syscall array assembly */
int syscallState[2]; /* Indication of progess for this buffer */
} SoloState;
extern SoloState machineState[];
extern int soloActiveProcs;
extern int soloCPUNum;
/* The soloHighStack and soloLowStack variables will always keep the */
/* bounds of the simulated processor's stack addresses. This provides */
/* flashlite's virtual to physical mapping function to know to put */
/* stack pages local. */
extern VA soloLowStack;
extern VA soloHighStack;
#define IS_STACK_REF(_addr) ((_addr > soloLowStack) && (_addr < soloHighStack))
extern int SoloEmulateSyscall(int cpuNum, int syscallNum);
extern void SoloTurnOnCaches(void);
extern void SoloTurnOffCaches(void);
extern bool SoloCachesAreOn(void);
extern void sys_place_range(unsigned start, unsigned stop, int node);
extern unsigned GetTotalMemPerProc(void);
extern void FlashLiteResetStats(void);
extern void SoloBackdoorSyncFinish(int cpuNum);
#endif