| 1385 | // clobbered with zeros but that's okay |
| 1386 | class KernelMemory { |
| 1387 | constructor(main_sd, worker_sd, pipes, pipe_addr) { |
| 1388 | this.main_sd = main_sd; |
| 1389 | this.worker_sd = worker_sd; |
| 1390 | this.rpipe = pipes[0]; |
| 1391 | this.wpipe = pipes[1]; |
| 1392 | this.pipe_addr = pipe_addr; // &pipe.pipe_buf |
| 1393 | this.pipe_addr2 = pipe_addr.add(0x10); // &pipe.pipe_buf.buffer |
| 1394 | this.rw_buf = new Buffer(0x14); |
| 1395 | this.addr_buf = new Buffer(0x14); |
| 1396 | this.data_buf = new Buffer(0x14); |
| 1397 | this.data_buf.write32(0xc, 0x40000000); |
| 1398 | } |
| 1399 | |
| 1400 | _verify_len(len) { |
| 1401 | if (!(Number.isInteger(len) && 0 <= len <= 0xffffffff)) { |