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
|
/******************************************************************************
* Copyright (c) 2004, 2011 IBM Corporation
* All rights reserved.
* This program and the accompanying materials
* are made available under the terms of the BSD License
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/bsd-license.php
*
* Contributors:
* IBM Corporation - initial implementation
*****************************************************************************/
#include <libhvcall.h>
// : hv-putchar ( hvtermno char -- )
PRIM(hv_X2d_putchar)
char c = TOS.n; POP;
int hvtermno = TOS.n; POP;
hv_putchar(c, hvtermno);
MIRP
// : hv-getchar ( hvtermno -- char )
PRIM(hv_X2d_getchar)
TOS.n = hv_getchar(TOS.n);
MIRP
// : hv-haschar ( hvtermno -- res )
PRIM(hv_X2d_haschar)
TOS.n = hv_haschar(TOS.n);
MIRP
// : hv-reg-crq ( unit qaddr qsize -- res )
PRIM(hv_X2d_reg_X2d_crq)
unsigned long qsize = TOS.u; POP;
unsigned long qaddr = TOS.u; POP;
unsigned int unit = TOS.u;
TOS.n = hv_reg_crq(unit, qaddr, qsize);
MIRP
// : hv-free-crq ( unit -- )
PRIM(hv_X2d_free_X2d_crq)
unsigned int unit = TOS.u; POP;
hv_free_crq(unit);
MIRP
// : hv-send-crq ( unit msgaddr -- rc )
PRIM(hv_X2d_send_X2d_crq)
uint64_t *msgaddr = (uint64_t *)TOS.u; POP;
unsigned int unit = TOS.u;
TOS.n = hv_send_crq(unit, msgaddr);
MIRP
// : hv-put-tce ( liobn ioba tce -- rc )
PRIM(hv_X2d_put_X2d_tce)
uint64_t tce = TOS.u; POP;
uint64_t ioba = TOS.u; POP;
uint32_t liobn = TOS.u;
TOS.u = hv_generic(H_PUT_TCE, liobn, ioba, tce);
MIRP
PRIM(RB_X40)
unsigned long qaddr = TOS.u;
TOS.u = hv_logical_ci_load(1, qaddr);
MIRP
PRIM(RB_X21)
unsigned long qaddr = TOS.u; POP;
unsigned char val = TOS.u; POP;
hv_logical_ci_store(1, qaddr, val);
MIRP
PRIM(RW_X40)
unsigned long qaddr = TOS.u;
TOS.u = hv_logical_ci_load(2, qaddr);
MIRP
PRIM(RW_X21)
unsigned long qaddr = TOS.u; POP;
unsigned short val = TOS.u; POP;
hv_logical_ci_store(2, qaddr, val);
MIRP
PRIM(RL_X40)
unsigned long qaddr = TOS.u;
TOS.u = hv_logical_ci_load(4, qaddr);
MIRP
PRIM(RL_X21)
unsigned long qaddr = TOS.u; POP;
unsigned int val = TOS.u; POP;
hv_logical_ci_store(4, qaddr, val);
MIRP
PRIM(RX_X40)
unsigned long qaddr = TOS.u;
TOS.u = hv_logical_ci_load(8, qaddr);
MIRP
PRIM(RX_X21)
unsigned long qaddr = TOS.u; POP;
unsigned long val = TOS.u; POP;
hv_logical_ci_store(8, qaddr, val);
MIRP
PRIM(hv_X2d_logical_X2d_memop)
unsigned long op = TOS.u; POP;
unsigned long count = TOS.u; POP;
unsigned long esize = TOS.u; POP;
unsigned long src = TOS.u; POP;
unsigned long dst = TOS.u;
TOS.u = hv_logical_memop(dst, src, esize, count, op);
MIRP
PRIM(hv_X2d_cas)
unsigned long size = TOS.u; POP;
unsigned long buf = TOS.u; POP;
unsigned long vec = TOS.u;
TOS.u = hv_cas(vec, buf, size);
MIRP
PRIM(hv_X2d_rtas_X2d_update)
unsigned long rtas_entry = TOS.u; POP;
unsigned long rtas_base = TOS.u;
TOS.u = hv_generic(KVMPPC_H_RTAS_UPDATE, rtas_base, rtas_entry);
MIRP
PRIM(get_X2d_print_X2d_version)
unsigned long addr = TOS.u; POP;
get_print_banner(addr);
MIRP
PRIM(check_X2d_and_X2d_patch_X2d_sc1)
unsigned long end = TOS.u; POP;
unsigned long start = TOS.u; POP;
unsigned long patch_ins = TOS.u; POP;
patch_broken_sc1((void*)start, (void*)end, (void*)patch_ins);
MIRP
|