MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / htif_write

Function htif_write

tinyemu/riscv_machine.c:153–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static void htif_write(void *opaque, uint32_t offset, uint32_t val,
154 int size_log2)
155{
156 RISCVMachine *s = opaque;
157
158 assert(size_log2 == 2);
159 switch(offset) {
160 case 0:
161 s->htif_tohost = (s->htif_tohost & ~0xffffffff) | val;
162 break;
163 case 4:
164 s->htif_tohost = (s->htif_tohost & 0xffffffff) | ((uint64_t)val << 32);
165 htif_handle_cmd(s);
166 break;
167 case 8:
168 s->htif_fromhost = (s->htif_fromhost & ~0xffffffff) | val;
169 break;
170 case 12:
171 s->htif_fromhost = (s->htif_fromhost & 0xffffffff) |
172 (uint64_t)val << 32;
173 break;
174 default:
175 break;
176 }
177}
178
179#if 0
180static void htif_poll(RISCVMachine *s)

Callers

nothing calls this directly

Calls 1

htif_handle_cmdFunction · 0.85

Tested by

no test coverage detected