mips.h
1.44 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
#ifndef __TV_rkmips_h_
#define __TV_rkmips_h_
/*
** RiscKernel machine dependent definitions for the mips R4000 series
** processors.
*/
#ifdef _LANGUAGE_ASSEMBLY
/*
** Arguments to system calls are in a0,a1,a2,a3,t0,t1,t2,t3.
*/
#define TVSYSCALL(name) \
LEAF(name); \
li v0,__TV_TRAP_/**/name; \
syscall; \
j ra; \
END(name);
#define TVSYSCALL5(name) \
LEAF(name); \
li v0,__TV_TRAP_/**/name; \
lw t0,0+4*4(sp); \
syscall; \
j ra; \
END(name);
#define TVSYSCALL6(name) \
LEAF(name); \
li v0,__TV_TRAP_/**/name; \
lw t0,0+4*4(sp); \
lw t1,4+4*4(sp); \
syscall; \
j ra; \
END(name);
#define TVSYSCALL0(a) TVSYSCALL(a)
#define TVSYSCALL1(a) TVSYSCALL(a)
#define TVSYSCALL2(a) TVSYSCALL(a)
#define TVSYSCALL3(a) TVSYSCALL(a)
#define TVSYSCALL4(a) TVSYSCALL(a)
#endif
/************************************************************************/
/* Size of a page */
#define TV_PAGE_SIZE 4096
#define TV_PAGE_MASK 4095
#define TV_PAGE_SHIFT 12
/* Mapping restrictions for regions */
#define TV_REGION_GRANULARITY 4096
#define TV_REGION_ALIGNMENT 4096
#define TV_REGION_SHARED_ALIGNMENT 65536
/* Maximum size of an id set */
#define TV_MAX_SET_SIZE 200
/* Extra bit set of exception was in delay slot */
#define TV_EXC_IN_DELAY_SLOT 0x8000
/* Base for rk system calls */
#define __TV_TRAP_BASE 0
#endif /* __TV_rkmips_h_ */