sk.h
1.71 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
#ifndef __SK_CONSTANTS_H
#define __SK_CONSTANTS_H
#include <regdef.h>
#include <asm.h>
#include <PR/R4300.h>
#include <PR/rcp.h>
/* This is ugly, but I can't get the pre-processor to take
* the '\' char to break up this line. So, for now...
*/
#define SK_ENTRY_AND_RETURN li t0, PHYS_TO_K1(MI_SEC_MODE_REG); .set noreorder; lw t1, (t0); nop; .set reorder; j ra
/* registers saved to stack during NMI */
#define NMI_K0
#define NMI_K1
#define NMI_T0
#define PTR .word
#define PTRSIZE 4
#define PTRLOG 2
#define NUMSKCALLS 5
/* physical addresses for internal SK */
#define SK_HEAP_INIT_ADDR 0x1fc40000
/* XXX: don't know why the address below won't work for
* KSEG0 (didn't try KSEG1). For now lets try temporary
* value that works.
*/
// #define SK_STACK_INIT_ADDR 0x1fc50000
#define SK_STACK_INIT_ADDR 0x02000000
/* register saving for SK */
#define SK_API_CONTEXT_SIZE (14*4) /* double-word aligned */
#define SK_SP_S0 0
#define SK_SP_S1 4
#define SK_SP_S2 8
#define SK_SP_S3 16
#define SK_SP_S4 20
#define SK_SP_S5 24
#define SK_SP_S6 28
#define SK_SP_S7 32
#define SK_SP_FP 36
#define SK_SP_SP 40
#define SK_SP_GP 44
#define SK_SP_SR 48
#define SK_SP_RA 52
/*
#define SK_API_SAVE \
sw s0, SK_SP_S0(sp); \
sw s1, SK_SP_S0(sp); \
sw s2, SK_SP_S0(sp); \
sw s3, SK_SP_S0(sp); \
sw s4, SK_SP_S0(sp); \
sw s5, SK_SP_S0(sp); \
sw s6, SK_SP_S0(sp); \
sw s7, SK_SP_S0(sp); \
sw fp, SK_SP_GP(sp); \
sw gp, SK_SP_FP(sp);
#define SK_API_RESTORE \
lw s0, SK_SP_S0(sp); \
lw s1, SK_SP_S0(sp); \
lw s2, SK_SP_S0(sp); \
lw s3, SK_SP_S0(sp); \
lw s4, SK_SP_S0(sp); \
lw s5, SK_SP_S0(sp); \
lw s6, SK_SP_S0(sp); \
lw s7, SK_SP_S0(sp); \
lw fp, SK_SP_GP(sp); \
lw gp, SK_SP_FP(sp);
*/
#endif