v86 0.5.333 → 0.5.337

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -192,7 +192,7 @@ var emulator = new V86({
192
192
  });
193
193
  ```
194
194
 
195
- See [starter.js](src/browser/starter.js).
195
+ See [v86.d.ts](v86.d.ts) for TypeScript definitions. You can use `make doc` (TypeDoc) or `make denodoc` (Deno) to generate HTML documentation in `./docs/api/`.
196
196
 
197
197
  ## License
198
198
 
@@ -206,6 +206,13 @@ if ("undefined" === typeof XMLHttpRequest || "undefined" !== typeof process && p
206
206
  }, 1000 * ([1, 1, 2, 3, 5, 8, 13, 21][$number_of_tries$$] || 34));
207
207
  }
208
208
  var $http$$ = new XMLHttpRequest;
209
+ const $abort$$ = () => $http$$.abort();
210
+ if ($options$jscomp$35$$.signal) {
211
+ if ($options$jscomp$35$$.signal.aborted) {
212
+ return;
213
+ }
214
+ $options$jscomp$35$$.signal.addEventListener("abort", $abort$$, {once:!0});
215
+ }
209
216
  $http$$.open($options$jscomp$35$$.method || "get", $filename$jscomp$3$$, !0);
210
217
  $http$$.responseType = $options$jscomp$35$$.as_json ? "json" : "arraybuffer";
211
218
  if ($options$jscomp$35$$.headers) {
@@ -218,6 +225,7 @@ if ("undefined" === typeof XMLHttpRequest || "undefined" !== typeof process && p
218
225
  200 === $http$$.status && (console.error("Server sent full file in response to ranged request, aborting", {filename:$filename$jscomp$3$$}), $http$$.abort());
219
226
  });
220
227
  $http$$.onload = function() {
228
+ $options$jscomp$35$$.signal && $options$jscomp$35$$.signal.removeEventListener("abort", $abort$$);
221
229
  if (4 === $http$$.readyState) {
222
230
  if (200 !== $http$$.status && 206 !== $http$$.status) {
223
231
  console.error("Loading the image " + $filename$jscomp$3$$ + " failed (status %d)", $http$$.status), 500 <= $http$$.status && 600 > $http$$.status && $retry$$();
@@ -233,6 +241,7 @@ if ("undefined" === typeof XMLHttpRequest || "undefined" !== typeof process && p
233
241
  }
234
242
  };
235
243
  $http$$.onerror = function($e$jscomp$8$$) {
244
+ $options$jscomp$35$$.signal && $options$jscomp$35$$.signal.removeEventListener("abort", $abort$$);
236
245
  console.error("Loading the image " + $filename$jscomp$3$$ + " failed", $e$jscomp$8$$);
237
246
  $retry$$();
238
247
  };
@@ -673,7 +682,7 @@ $AsyncXHRBuffer$$module$src$buffer$$.prototype.get_from_cache = function($block_
673
682
  }
674
683
  return $len$jscomp$6_result$jscomp$4$$;
675
684
  };
676
- $AsyncXHRBuffer$$module$src$buffer$$.prototype.get = function($offset$jscomp$31$$, $len$jscomp$7$$, $fn$jscomp$3$$) {
685
+ $AsyncXHRBuffer$$module$src$buffer$$.prototype.get = function($offset$jscomp$31$$, $len$jscomp$7$$, $fn$jscomp$3$$, $options$jscomp$37$$) {
677
686
  $dbg_assert$$module$src$log$$($offset$jscomp$31$$ + $len$jscomp$7$$ <= this.byteLength);
678
687
  $dbg_assert$$module$src$log$$(0 === $offset$jscomp$31$$ % 256);
679
688
  $dbg_assert$$module$src$log$$(0 === $len$jscomp$7$$ % 256);
@@ -688,7 +697,7 @@ $AsyncXHRBuffer$$module$src$buffer$$.prototype.get = function($offset$jscomp$31$
688
697
  $block$jscomp$2_buffer$jscomp$20$$ = new Uint8Array($block$jscomp$2_buffer$jscomp$20$$);
689
698
  this.handle_read($requested_start$$, $requested_length$$, $block$jscomp$2_buffer$jscomp$20$$);
690
699
  $requested_start$$ === $offset$jscomp$31$$ && $requested_length$$ === $len$jscomp$7$$ ? $fn$jscomp$3$$($block$jscomp$2_buffer$jscomp$20$$) : $fn$jscomp$3$$($block$jscomp$2_buffer$jscomp$20$$.subarray($offset$jscomp$31$$ - $requested_start$$, $offset$jscomp$31$$ - $requested_start$$ + $len$jscomp$7$$));
691
- }.bind(this), range:{start:$requested_start$$, length:$requested_length$$}, });
700
+ }.bind(this), range:{start:$requested_start$$, length:$requested_length$$}, signal:$options$jscomp$37$$?.signal, });
692
701
  }
693
702
  };
694
703
  $AsyncXHRBuffer$$module$src$buffer$$.prototype.set = function($start$jscomp$18_start_block$$, $data$jscomp$81$$, $fn$jscomp$4$$) {
@@ -758,7 +767,7 @@ $AsyncXHRPartfileBuffer$$module$src$buffer$$.prototype.load = function() {
758
767
  void 0 === this.byteLength && $dbg_assert$$module$src$log$$(!1);
759
768
  this.onload && this.onload(Object.create(null));
760
769
  };
761
- $AsyncXHRPartfileBuffer$$module$src$buffer$$.prototype.get = function($offset$jscomp$33$$, $len$jscomp$10$$, $fn$jscomp$6$$) {
770
+ $AsyncXHRPartfileBuffer$$module$src$buffer$$.prototype.get = function($offset$jscomp$33$$, $len$jscomp$10$$, $fn$jscomp$6$$, $options$jscomp$38$$) {
762
771
  $dbg_assert$$module$src$log$$($offset$jscomp$33$$ + $len$jscomp$10$$ <= this.byteLength);
763
772
  $dbg_assert$$module$src$log$$(0 === $offset$jscomp$33$$ % 256);
764
773
  $dbg_assert$$module$src$log$$(0 === $len$jscomp$10$$ % 256);
@@ -782,7 +791,7 @@ $AsyncXHRPartfileBuffer$$module$src$buffer$$.prototype.get = function($offset$js
782
791
  this.handle_read(($start_index$$ + $i$jscomp$13$$) * this.fixed_chunk_size, this.fixed_chunk_size | 0, $block$jscomp$9_buffer$jscomp$21_decompressed$$);
783
792
  $finished$$++;
784
793
  $finished$$ === $total_count$$ && $fn$jscomp$6$$($blocks$$.subarray($m_offset$$, $m_offset$$ + $len$jscomp$10$$));
785
- }.bind(this), });
794
+ }.bind(this), signal:$options$jscomp$38$$?.signal, });
786
795
  }
787
796
  } else {
788
797
  $load_file$$module$src$lib$$(this.basename + $offset$jscomp$33$$ + "-" + ($offset$jscomp$33$$ + $len$jscomp$10$$) + this.extension, {done:function($block$jscomp$10_buffer$jscomp$22$$) {
@@ -790,7 +799,7 @@ $AsyncXHRPartfileBuffer$$module$src$buffer$$.prototype.get = function($offset$js
790
799
  $block$jscomp$10_buffer$jscomp$22$$ = new Uint8Array($block$jscomp$10_buffer$jscomp$22$$);
791
800
  this.handle_read($offset$jscomp$33$$, $len$jscomp$10$$, $block$jscomp$10_buffer$jscomp$22$$);
792
801
  $fn$jscomp$6$$($block$jscomp$10_buffer$jscomp$22$$);
793
- }.bind(this), });
802
+ }.bind(this), signal:$options$jscomp$38$$?.signal, });
794
803
  }
795
804
  }
796
805
  };
@@ -3381,19 +3390,19 @@ function $handle_fake_dhcp$$module$src$browser$fake_network$$($packet$jscomp$5_r
3381
3390
  $reply$jscomp$4$$.ipv4 = {proto:17, src:$adapter$jscomp$5$$.router_ip, dest:$adapter$jscomp$5$$.vm_ip, };
3382
3391
  $reply$jscomp$4$$.udp = {sport:67, dport:68, };
3383
3392
  $reply$jscomp$4$$.dhcp = {htype:1, hlen:6, hops:0, xid:$packet$jscomp$5_router_ip$$.dhcp.xid, secs:0, flags:0, ciaddr:0, yiaddr:$iptolong$$module$src$browser$fake_network$$($adapter$jscomp$5$$.vm_ip), siaddr:$iptolong$$module$src$browser$fake_network$$($adapter$jscomp$5$$.router_ip), giaddr:$iptolong$$module$src$browser$fake_network$$($adapter$jscomp$5$$.router_ip), chaddr:$packet$jscomp$5_router_ip$$.dhcp.chaddr, };
3384
- let $options$jscomp$37$$ = [], $fix$$ = $packet$jscomp$5_router_ip$$.dhcp.options.find(function($x$jscomp$102$$) {
3393
+ let $options$jscomp$39$$ = [], $fix$$ = $packet$jscomp$5_router_ip$$.dhcp.options.find(function($x$jscomp$102$$) {
3385
3394
  return 53 === $x$jscomp$102$$[0];
3386
3395
  });
3387
3396
  $fix$$ && 3 === $fix$$[2] && ($packet$jscomp$5_router_ip$$.dhcp.op = 3);
3388
- 1 === $packet$jscomp$5_router_ip$$.dhcp.op && ($reply$jscomp$4$$.dhcp.op = 2, $options$jscomp$37$$.push(new Uint8Array([53, 1, 2])));
3389
- 3 === $packet$jscomp$5_router_ip$$.dhcp.op && ($reply$jscomp$4$$.dhcp.op = 2, $options$jscomp$37$$.push(new Uint8Array([53, 1, 5])), $options$jscomp$37$$.push(new Uint8Array([51, 4, 8, 0, 0, 0])));
3397
+ 1 === $packet$jscomp$5_router_ip$$.dhcp.op && ($reply$jscomp$4$$.dhcp.op = 2, $options$jscomp$39$$.push(new Uint8Array([53, 1, 2])));
3398
+ 3 === $packet$jscomp$5_router_ip$$.dhcp.op && ($reply$jscomp$4$$.dhcp.op = 2, $options$jscomp$39$$.push(new Uint8Array([53, 1, 5])), $options$jscomp$39$$.push(new Uint8Array([51, 4, 8, 0, 0, 0])));
3390
3399
  $packet$jscomp$5_router_ip$$ = [$adapter$jscomp$5$$.router_ip[0], $adapter$jscomp$5$$.router_ip[1], $adapter$jscomp$5$$.router_ip[2], $adapter$jscomp$5$$.router_ip[3]];
3391
- $options$jscomp$37$$.push(new Uint8Array([1, 4, 255, 255, 255, 0]));
3392
- $adapter$jscomp$5$$.masquerade && ($options$jscomp$37$$.push(new Uint8Array([3, 4].concat($packet$jscomp$5_router_ip$$))), $options$jscomp$37$$.push(new Uint8Array([6, 4].concat($packet$jscomp$5_router_ip$$))));
3393
- $options$jscomp$37$$.push(new Uint8Array([54, 4].concat($packet$jscomp$5_router_ip$$)));
3394
- $options$jscomp$37$$.push(new Uint8Array([60, 3].concat($V86_ASCII$$module$src$browser$fake_network$$)));
3395
- $options$jscomp$37$$.push(new Uint8Array([255, 0]));
3396
- $reply$jscomp$4$$.dhcp.options = $options$jscomp$37$$;
3400
+ $options$jscomp$39$$.push(new Uint8Array([1, 4, 255, 255, 255, 0]));
3401
+ $adapter$jscomp$5$$.masquerade && ($options$jscomp$39$$.push(new Uint8Array([3, 4].concat($packet$jscomp$5_router_ip$$))), $options$jscomp$39$$.push(new Uint8Array([6, 4].concat($packet$jscomp$5_router_ip$$))));
3402
+ $options$jscomp$39$$.push(new Uint8Array([54, 4].concat($packet$jscomp$5_router_ip$$)));
3403
+ $options$jscomp$39$$.push(new Uint8Array([60, 3].concat($V86_ASCII$$module$src$browser$fake_network$$)));
3404
+ $options$jscomp$39$$.push(new Uint8Array([255, 0]));
3405
+ $reply$jscomp$4$$.dhcp.options = $options$jscomp$39$$;
3397
3406
  $adapter$jscomp$5$$.receive($make_packet$$module$src$browser$fake_network$$($adapter$jscomp$5$$.eth_encoder_buf, $reply$jscomp$4$$));
3398
3407
  }
3399
3408
  function $handle_fake_networking$$module$src$browser$fake_network$$($arp$jscomp$inline_346_bop$jscomp$inline_84_data$jscomp$118_icmp$jscomp$inline_336_now_n$jscomp$inline_93_packet_subnet$jscomp$inline_108_payload$jscomp$inline_78_reply$jscomp$inline_100_reply$jscomp$inline_104_reply$jscomp$inline_110_reply$jscomp$inline_350_tcp$jscomp$inline_338_tuple$jscomp$inline_82_udp$jscomp$inline_341_view$jscomp$inline_335_view$jscomp$inline_340$$, $adapter$jscomp$6$$) {
@@ -3953,10 +3962,10 @@ async function $on_data_http$$module$src$browser$fetch_network$$($data$jscomp$13
3953
3962
  });
3954
3963
  }
3955
3964
  }
3956
- $FetchNetworkAdapter$$module$src$browser$fetch_network$$.prototype.fetch = async function($url$jscomp$25$$, $options$jscomp$39$$) {
3965
+ $FetchNetworkAdapter$$module$src$browser$fetch_network$$.prototype.fetch = async function($url$jscomp$25$$, $options$jscomp$41$$) {
3957
3966
  this.cors_proxy && ($url$jscomp$25$$ = this.cors_proxy + encodeURIComponent($url$jscomp$25$$));
3958
3967
  try {
3959
- const $resp$jscomp$2$$ = await fetch($url$jscomp$25$$, $options$jscomp$39$$), $ab$jscomp$1$$ = await $resp$jscomp$2$$.arrayBuffer();
3968
+ const $resp$jscomp$2$$ = await fetch($url$jscomp$25$$, $options$jscomp$41$$), $ab$jscomp$1$$ = await $resp$jscomp$2$$.arrayBuffer();
3960
3969
  return [$resp$jscomp$2$$, $ab$jscomp$1$$];
3961
3970
  } catch ($e$jscomp$18$$) {
3962
3971
  return console.warn("Fetch Failed: " + $url$jscomp$25$$ + "\n" + $e$jscomp$18$$), [{status:502, statusText:"Fetch Error", headers:new Headers({"Content-Type":"text/plain"}), }, (new TextEncoder).encode(`Fetch ${$url$jscomp$25$$} failed:\n\n${$e$jscomp$18$$.stack}`).buffer];
@@ -4323,8 +4332,8 @@ function $KeyboardAdapter$$module$src$browser$keyboard$$($bus$jscomp$10$$) {
4323
4332
  };
4324
4333
  this.init();
4325
4334
  }
4326
- ;function $DummyScreenAdapter$$module$src$browser$dummy_screen$$($options$jscomp$40$$) {
4327
- var $text_mode_data$jscomp$1$$, $text_mode_width$jscomp$1$$ = 0, $text_mode_height$jscomp$1$$ = 0, $charmap$jscomp$2$$ = $get_charmap$$module$src$lib$$($options$jscomp$40$$?.encoding);
4335
+ ;function $DummyScreenAdapter$$module$src$browser$dummy_screen$$($options$jscomp$42$$) {
4336
+ var $text_mode_data$jscomp$1$$, $text_mode_width$jscomp$1$$ = 0, $text_mode_height$jscomp$1$$ = 0, $charmap$jscomp$2$$ = $get_charmap$$module$src$lib$$($options$jscomp$42$$?.encoding);
4328
4337
  this.put_char = function($row$jscomp$4$$, $col$jscomp$2$$, $chr$jscomp$4$$) {
4329
4338
  $dbg_assert$$module$src$log$$(0 <= $row$jscomp$4$$ && $row$jscomp$4$$ < $text_mode_height$jscomp$1$$);
4330
4339
  $dbg_assert$$module$src$log$$(0 <= $col$jscomp$2$$ && $col$jscomp$2$$ < $text_mode_width$jscomp$1$$);
@@ -4371,8 +4380,8 @@ function $KeyboardAdapter$$module$src$browser$keyboard$$($bus$jscomp$10$$) {
4371
4380
  };
4372
4381
  this.set_size_text(80, 25);
4373
4382
  }
4374
- ;function $ANSIScreenAdapter$$module$src$browser$ansi_screen$$($options$jscomp$41$$) {
4375
- var $text_mode_data$jscomp$2$$, $text_mode_width$jscomp$2$$ = 0, $text_mode_height$jscomp$2$$ = 0, $charmap$jscomp$3$$ = $get_charmap$$module$src$lib$$($options$jscomp$41$$?.encoding);
4383
+ ;function $ANSIScreenAdapter$$module$src$browser$ansi_screen$$($options$jscomp$43$$) {
4384
+ var $text_mode_data$jscomp$2$$, $text_mode_width$jscomp$2$$ = 0, $text_mode_height$jscomp$2$$ = 0, $charmap$jscomp$3$$ = $get_charmap$$module$src$lib$$($options$jscomp$43$$?.encoding);
4376
4385
  this.put_char = function($p$jscomp$1_row$jscomp$6$$, $col$jscomp$4$$, $chr$jscomp$6$$, $blinking$jscomp$2$$, $bg_color$jscomp$4$$, $fg_color$jscomp$4$$) {
4377
4386
  $dbg_assert$$module$src$log$$(0 <= $p$jscomp$1_row$jscomp$6$$ && $p$jscomp$1_row$jscomp$6$$ < $text_mode_height$jscomp$2$$);
4378
4387
  $dbg_assert$$module$src$log$$(0 <= $col$jscomp$4$$ && $col$jscomp$4$$ < $text_mode_width$jscomp$2$$);
@@ -5562,8 +5571,8 @@ $FS$$module$lib$filesystem$$.prototype.read_file = function($file$jscomp$3_p$jsc
5562
5571
  const $inode$jscomp$34$$ = this.GetInode($file$jscomp$3_p$jscomp$3$$.id);
5563
5572
  return this.Read($file$jscomp$3_p$jscomp$3$$.id, 0, $inode$jscomp$34$$.size);
5564
5573
  };
5565
- function $V86$$module$src$browser$starter$$($options$jscomp$42$$) {
5566
- "number" === typeof $options$jscomp$42$$.log_level && ($LOG_LEVEL$$module$src$log$$ = $options$jscomp$42$$.log_level);
5574
+ function $V86$$module$src$browser$starter$$($options$jscomp$44$$) {
5575
+ "number" === typeof $options$jscomp$44$$.log_level && ($LOG_LEVEL$$module$src$log$$ = $options$jscomp$44$$.log_level);
5567
5576
  this.cpu_is_running = !1;
5568
5577
  this.cpu_exception_hook = function() {
5569
5578
  };
@@ -5619,10 +5628,10 @@ function $V86$$module$src$browser$starter$$($options$jscomp$42$$) {
5619
5628
  }, codegen_finalize:($wasm_table_index$$, $start$jscomp$29$$, $state_flags$$, $ptr$jscomp$4$$, $len$jscomp$24$$) => {
5620
5629
  $cpu$jscomp$12$$.codegen_finalize($wasm_table_index$$, $start$jscomp$29$$, $state_flags$$, $ptr$jscomp$4$$, $len$jscomp$24$$);
5621
5630
  }, jit_clear_func:$wasm_table_index$jscomp$1$$ => $cpu$jscomp$12$$.jit_clear_func($wasm_table_index$jscomp$1$$), jit_clear_all_funcs:() => $cpu$jscomp$12$$.jit_clear_all_funcs(), __indirect_function_table:$wasm_table$$, };
5622
- let $wasm_fn$$ = $options$jscomp$42$$.wasm_fn;
5631
+ let $wasm_fn$$ = $options$jscomp$44$$.wasm_fn;
5623
5632
  $wasm_fn$$ || ($wasm_fn$$ = $env$$ => new Promise($resolve$jscomp$2$$ => {
5624
5633
  let $v86_bin$$ = "v86-debug.wasm", $v86_bin_fallback$$ = "v86-fallback.wasm";
5625
- $options$jscomp$42$$.wasm_path ? ($v86_bin$$ = $options$jscomp$42$$.wasm_path, $v86_bin_fallback$$ = $v86_bin$$.replace("v86.wasm", "v86-fallback.wasm")) : "undefined" === typeof window && "string" === typeof __dirname ? ($v86_bin$$ = __dirname + "/" + $v86_bin$$, $v86_bin_fallback$$ = __dirname + "/" + $v86_bin_fallback$$) : ($v86_bin$$ = "build/" + $v86_bin$$, $v86_bin_fallback$$ = "build/" + $v86_bin_fallback$$);
5634
+ $options$jscomp$44$$.wasm_path ? ($v86_bin$$ = $options$jscomp$44$$.wasm_path, $v86_bin_fallback$$ = $v86_bin$$.replace("v86.wasm", "v86-fallback.wasm")) : "undefined" === typeof window && "string" === typeof __dirname ? ($v86_bin$$ = __dirname + "/" + $v86_bin$$, $v86_bin_fallback$$ = __dirname + "/" + $v86_bin_fallback$$) : ($v86_bin$$ = "build/" + $v86_bin$$, $v86_bin_fallback$$ = "build/" + $v86_bin_fallback$$);
5626
5635
  $load_file$$module$src$lib$$($v86_bin$$, {done:async $bytes$jscomp$5$$ => {
5627
5636
  try {
5628
5637
  const {instance:$instance$$} = await WebAssembly.instantiate($bytes$jscomp$5$$, $env$$);
@@ -5644,12 +5653,12 @@ function $V86$$module$src$browser$starter$$($options$jscomp$42$$) {
5644
5653
  $emulator_exports$$.rust_init();
5645
5654
  $emulator_exports$$ = this.v86 = new $v86$$module$src$main$$(this.emulator_bus, {exports:$emulator_exports$$, wasm_table:$wasm_table$$});
5646
5655
  $cpu$jscomp$12$$ = $emulator_exports$$.cpu;
5647
- this.continue_init($emulator_exports$$, $options$jscomp$42$$);
5656
+ this.continue_init($emulator_exports$$, $options$jscomp$44$$);
5648
5657
  });
5649
5658
  this.zstd_worker = null;
5650
5659
  this.zstd_worker_request_id = 0;
5651
5660
  }
5652
- $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emulator$jscomp$1$$, $options$jscomp$43$$) {
5661
+ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emulator$jscomp$1$$, $options$jscomp$45$$) {
5653
5662
  function $put_on_settings$$($name$jscomp$100$$, $buffer$jscomp$42$$) {
5654
5663
  switch($name$jscomp$100$$) {
5655
5664
  case "hda":
@@ -5697,7 +5706,7 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5697
5706
  if ($settings$$.initial_state) {
5698
5707
  $dbg_log$$module$src$log$$("Filesystem basefs ignored: Overridden by state image");
5699
5708
  } else {
5700
- if ($settings$$.fs9p.load_from_json($settings$$.fs9p_json), $options$jscomp$43$$.bzimage_initrd_from_filesystem) {
5709
+ if ($settings$$.fs9p.load_from_json($settings$$.fs9p_json), $options$jscomp$45$$.bzimage_initrd_from_filesystem) {
5701
5710
  const {bzimage_path:$bzimage_path$$, initrd_path:$initrd_path$$} = this.get_bzimage_initrd_from_filesystem($settings$$.fs9p);
5702
5711
  $dbg_log$$module$src$log$$("Found bzimage: " + $bzimage_path$$ + " and initrd: " + $initrd_path$$);
5703
5712
  const [$initrd$$, $bzimage$$] = await Promise.all([$settings$$.fs9p.read_file($initrd_path$$), $settings$$.fs9p.read_file($bzimage_path$$), ]);
@@ -5706,13 +5715,13 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5706
5715
  }
5707
5716
  }
5708
5717
  } else {
5709
- $dbg_assert$$module$src$log$$(!$options$jscomp$43$$.bzimage_initrd_from_filesystem || $settings$$.initial_state, "bzimage_initrd_from_filesystem: Requires a filesystem");
5718
+ $dbg_assert$$module$src$log$$(!$options$jscomp$45$$.bzimage_initrd_from_filesystem || $settings$$.initial_state, "bzimage_initrd_from_filesystem: Requires a filesystem");
5710
5719
  }
5711
5720
  this.serial_adapter && this.serial_adapter.show && this.serial_adapter.show();
5712
5721
  this.virtio_console_adapter && this.virtio_console_adapter.show && this.virtio_console_adapter.show();
5713
5722
  this.v86.init($settings$$);
5714
5723
  $settings$$.initial_state && ($emulator$jscomp$1$$.restore_state($settings$$.initial_state), $settings$$.initial_state = void 0);
5715
- $options$jscomp$43$$.autostart && this.v86.run();
5724
+ $options$jscomp$45$$.autostart && this.v86.run();
5716
5725
  this.emulator_bus.send("emulator-loaded");
5717
5726
  }
5718
5727
  this.bus.register("emulator-stopped", function() {
@@ -5723,45 +5732,45 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5723
5732
  this.cpu_is_running = !0;
5724
5733
  this.screen_adapter.continue();
5725
5734
  }, this);
5726
- var $settings$$ = {}, $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$43$$.boot_order ? $options$jscomp$43$$.boot_order : $options$jscomp$43$$.fda ? 801 : $options$jscomp$43$$.hda ? 786 : 291;
5727
- $settings$$.acpi = $options$jscomp$43$$.acpi;
5728
- $settings$$.disable_jit = $options$jscomp$43$$.disable_jit;
5735
+ var $settings$$ = {}, $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$45$$.boot_order ? $options$jscomp$45$$.boot_order : $options$jscomp$45$$.fda ? 801 : $options$jscomp$45$$.hda ? 786 : 291;
5736
+ $settings$$.acpi = $options$jscomp$45$$.acpi;
5737
+ $settings$$.disable_jit = $options$jscomp$45$$.disable_jit;
5729
5738
  $settings$$.load_devices = !0;
5730
- $settings$$.memory_size = $options$jscomp$43$$.memory_size || 67108864;
5731
- $settings$$.vga_memory_size = $options$jscomp$43$$.vga_memory_size || 8388608;
5739
+ $settings$$.memory_size = $options$jscomp$45$$.memory_size || 67108864;
5740
+ $settings$$.vga_memory_size = $options$jscomp$45$$.vga_memory_size || 8388608;
5732
5741
  $settings$$.boot_order = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$;
5733
- $settings$$.fastboot = $options$jscomp$43$$.fastboot || !1;
5742
+ $settings$$.fastboot = $options$jscomp$45$$.fastboot || !1;
5734
5743
  $settings$$.fda = void 0;
5735
5744
  $settings$$.fdb = void 0;
5736
- $settings$$.uart1 = $options$jscomp$43$$.uart1;
5737
- $settings$$.uart2 = $options$jscomp$43$$.uart2;
5738
- $settings$$.uart3 = $options$jscomp$43$$.uart3;
5739
- $settings$$.cmdline = $options$jscomp$43$$.cmdline;
5740
- $settings$$.preserve_mac_from_state_image = $options$jscomp$43$$.preserve_mac_from_state_image;
5741
- $settings$$.mac_address_translation = $options$jscomp$43$$.mac_address_translation;
5742
- $settings$$.cpuid_level = $options$jscomp$43$$.cpuid_level;
5743
- $settings$$.virtio_balloon = $options$jscomp$43$$.virtio_balloon;
5744
- $settings$$.virtio_console = !!$options$jscomp$43$$.virtio_console;
5745
- if ($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$43$$.network_relay_url || $options$jscomp$43$$.net_device && $options$jscomp$43$$.net_device.relay_url) {
5746
- "fetch" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ ? this.network_adapter = new $FetchNetworkAdapter$$module$src$browser$fetch_network$$(this.bus, $options$jscomp$43$$.net_device) : "inbrowser" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ ? this.network_adapter = new $InBrowserNetworkAdapter$$module$src$browser$inbrowser_network$$(this.bus, $options$jscomp$43$$.net_device) : $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.startsWith("wisp://") ||
5747
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.startsWith("wisps://") ? this.network_adapter = new $WispNetworkAdapter$$module$src$browser$wisp_network$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, this.bus, $options$jscomp$43$$.net_device) : this.network_adapter = new $NetworkAdapter$$module$src$browser$network$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, this.bus);
5748
- }
5749
- $settings$$.net_device = $options$jscomp$43$$.net_device || {type:"ne2k"};
5750
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$43$$.screen || {};
5751
- $options$jscomp$43$$.screen_container && ($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container = $options$jscomp$43$$.screen_container);
5752
- $options$jscomp$43$$.disable_keyboard || (this.keyboard_adapter = new $KeyboardAdapter$$module$src$browser$keyboard$$(this.bus));
5753
- $options$jscomp$43$$.disable_mouse || (this.mouse_adapter = new $MouseAdapter$$module$src$browser$mouse$$(this.bus, $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container));
5745
+ $settings$$.uart1 = $options$jscomp$45$$.uart1;
5746
+ $settings$$.uart2 = $options$jscomp$45$$.uart2;
5747
+ $settings$$.uart3 = $options$jscomp$45$$.uart3;
5748
+ $settings$$.cmdline = $options$jscomp$45$$.cmdline;
5749
+ $settings$$.preserve_mac_from_state_image = $options$jscomp$45$$.preserve_mac_from_state_image;
5750
+ $settings$$.mac_address_translation = $options$jscomp$45$$.mac_address_translation;
5751
+ $settings$$.cpuid_level = $options$jscomp$45$$.cpuid_level;
5752
+ $settings$$.virtio_balloon = $options$jscomp$45$$.virtio_balloon;
5753
+ $settings$$.virtio_console = !!$options$jscomp$45$$.virtio_console;
5754
+ if ($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$45$$.network_relay_url || $options$jscomp$45$$.net_device && $options$jscomp$45$$.net_device.relay_url) {
5755
+ "fetch" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ ? this.network_adapter = new $FetchNetworkAdapter$$module$src$browser$fetch_network$$(this.bus, $options$jscomp$45$$.net_device) : "inbrowser" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ ? this.network_adapter = new $InBrowserNetworkAdapter$$module$src$browser$inbrowser_network$$(this.bus, $options$jscomp$45$$.net_device) : $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.startsWith("wisp://") ||
5756
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.startsWith("wisps://") ? this.network_adapter = new $WispNetworkAdapter$$module$src$browser$wisp_network$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, this.bus, $options$jscomp$45$$.net_device) : this.network_adapter = new $NetworkAdapter$$module$src$browser$network$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, this.bus);
5757
+ }
5758
+ $settings$$.net_device = $options$jscomp$45$$.net_device || {type:"ne2k"};
5759
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$45$$.screen || {};
5760
+ $options$jscomp$45$$.screen_container && ($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container = $options$jscomp$45$$.screen_container);
5761
+ $options$jscomp$45$$.disable_keyboard || (this.keyboard_adapter = new $KeyboardAdapter$$module$src$browser$keyboard$$(this.bus));
5762
+ $options$jscomp$45$$.disable_mouse || (this.mouse_adapter = new $MouseAdapter$$module$src$browser$mouse$$(this.bus, $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container));
5754
5763
  this.screen_adapter = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container ? new $ScreenAdapter$$module$src$browser$screen$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, () => this.v86.cpu.devices.vga && this.v86.cpu.devices.vga.screen_fill_buffer()) : $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.ansi ? new $ANSIScreenAdapter$$module$src$browser$ansi_screen$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$) :
5755
5764
  new $DummyScreenAdapter$$module$src$browser$dummy_screen$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$);
5756
5765
  $settings$$.screen = this.screen_adapter;
5757
5766
  $settings$$.screen_options = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$;
5758
- $settings$$.serial_console = $options$jscomp$43$$.serial_console || {type:"none"};
5759
- $options$jscomp$43$$.serial_container_xtermjs ? ($settings$$.serial_console.type = "xtermjs", $settings$$.serial_console.container = $options$jscomp$43$$.serial_container_xtermjs) : $options$jscomp$43$$.serial_container && ($settings$$.serial_console.type = "textarea", $settings$$.serial_console.container = $options$jscomp$43$$.serial_container);
5767
+ $settings$$.serial_console = $options$jscomp$45$$.serial_console || {type:"none"};
5768
+ $options$jscomp$45$$.serial_container_xtermjs ? ($settings$$.serial_console.type = "xtermjs", $settings$$.serial_console.container = $options$jscomp$45$$.serial_container_xtermjs) : $options$jscomp$45$$.serial_container && ($settings$$.serial_console.type = "textarea", $settings$$.serial_console.container = $options$jscomp$45$$.serial_container);
5760
5769
  "xtermjs" === $settings$$.serial_console?.type ? this.serial_adapter = new $SerialAdapterXtermJS$$module$src$browser$serial$$($settings$$.serial_console.container, this.bus, $settings$$.serial_console.xterm_lib || window.Terminal) : "textarea" === $settings$$.serial_console?.type && (this.serial_adapter = new $SerialAdapter$$module$src$browser$serial$$($settings$$.serial_console.container, this.bus));
5761
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$43$$.virtio_console && "boolean" === typeof $options$jscomp$43$$.virtio_console ? {type:"none"} : $options$jscomp$43$$.virtio_console;
5770
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$45$$.virtio_console && "boolean" === typeof $options$jscomp$45$$.virtio_console ? {type:"none"} : $options$jscomp$45$$.virtio_console;
5762
5771
  "xtermjs" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$?.type ? this.virtio_console_adapter = new $VirtioConsoleAdapterXtermJS$$module$src$browser$serial$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container, this.bus, $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.xterm_lib || window.Terminal) : "textarea" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$?.type &&
5763
5772
  (this.virtio_console_adapter = new $VirtioConsoleAdapter$$module$src$browser$serial$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container, this.bus));
5764
- $options$jscomp$43$$.disable_speaker || (this.speaker_adapter = new $SpeakerAdapter$$module$src$browser$speaker$$(this.bus));
5773
+ $options$jscomp$45$$.disable_speaker || (this.speaker_adapter = new $SpeakerAdapter$$module$src$browser$speaker$$(this.bus));
5765
5774
  var $files_to_load$$ = [];
5766
5775
  $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = ($name$jscomp$101$$, $file$jscomp$4$$) => {
5767
5776
  if ($file$jscomp$4$$) {
@@ -5778,27 +5787,27 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5778
5787
  }
5779
5788
  }
5780
5789
  };
5781
- $options$jscomp$43$$.state && console.warn("Warning: Unknown option 'state'. Did you mean 'initial_state'?");
5782
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("bios", $options$jscomp$43$$.bios);
5783
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("vga_bios", $options$jscomp$43$$.vga_bios);
5784
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("cdrom", $options$jscomp$43$$.cdrom);
5785
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("hda", $options$jscomp$43$$.hda);
5786
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("hdb", $options$jscomp$43$$.hdb);
5787
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("fda", $options$jscomp$43$$.fda);
5788
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("fdb", $options$jscomp$43$$.fdb);
5789
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("initial_state", $options$jscomp$43$$.initial_state);
5790
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("multiboot", $options$jscomp$43$$.multiboot);
5791
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("bzimage", $options$jscomp$43$$.bzimage);
5792
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("initrd", $options$jscomp$43$$.initrd);
5793
- if ($options$jscomp$43$$.filesystem && $options$jscomp$43$$.filesystem.handle9p) {
5794
- $settings$$.handle9p = $options$jscomp$43$$.filesystem.handle9p;
5790
+ $options$jscomp$45$$.state && console.warn("Warning: Unknown option 'state'. Did you mean 'initial_state'?");
5791
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("bios", $options$jscomp$45$$.bios);
5792
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("vga_bios", $options$jscomp$45$$.vga_bios);
5793
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("cdrom", $options$jscomp$45$$.cdrom);
5794
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("hda", $options$jscomp$45$$.hda);
5795
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("hdb", $options$jscomp$45$$.hdb);
5796
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("fda", $options$jscomp$45$$.fda);
5797
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("fdb", $options$jscomp$45$$.fdb);
5798
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("initial_state", $options$jscomp$45$$.initial_state);
5799
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("multiboot", $options$jscomp$45$$.multiboot);
5800
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("bzimage", $options$jscomp$45$$.bzimage);
5801
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("initrd", $options$jscomp$45$$.initrd);
5802
+ if ($options$jscomp$45$$.filesystem && $options$jscomp$45$$.filesystem.handle9p) {
5803
+ $settings$$.handle9p = $options$jscomp$45$$.filesystem.handle9p;
5795
5804
  } else {
5796
- if ($options$jscomp$43$$.filesystem && $options$jscomp$43$$.filesystem.proxy_url) {
5797
- $settings$$.proxy9p = $options$jscomp$43$$.filesystem.proxy_url;
5805
+ if ($options$jscomp$45$$.filesystem && $options$jscomp$45$$.filesystem.proxy_url) {
5806
+ $settings$$.proxy9p = $options$jscomp$45$$.filesystem.proxy_url;
5798
5807
  } else {
5799
- if ($options$jscomp$43$$.filesystem) {
5800
- $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$43$$.filesystem.basefs;
5801
- var $base_url$$ = $options$jscomp$43$$.filesystem.baseurl;
5808
+ if ($options$jscomp$45$$.filesystem) {
5809
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$45$$.filesystem.basefs;
5810
+ var $base_url$$ = $options$jscomp$45$$.filesystem.baseurl;
5802
5811
  let $file_storage$jscomp$1$$ = new $MemoryFileStorage$$module$src$browser$filestorage$$;
5803
5812
  $base_url$$ && ($file_storage$jscomp$1$$ = new $ServerFileStorageWrapper$$module$src$browser$filestorage$$($file_storage$jscomp$1$$, $base_url$$, this.zstd_decompress.bind(this)));
5804
5813
  $settings$$.fs9p = this.fs9p = new $FS$$module$lib$filesystem$$($file_storage$jscomp$1$$);
@@ -6110,19 +6119,19 @@ $V86$$module$src$browser$starter$$.prototype.automatically = function($steps$$)
6110
6119
  };
6111
6120
  $run$$($steps$$);
6112
6121
  };
6113
- $V86$$module$src$browser$starter$$.prototype.wait_until_vga_screen_contains = async function($expected$$, $options$jscomp$44_screen_put_char$$) {
6122
+ $V86$$module$src$browser$starter$$.prototype.wait_until_vga_screen_contains = async function($expected$$, $options$jscomp$46_screen_put_char$$) {
6114
6123
  const $match_multi$$ = Array.isArray($expected$$);
6115
- var $end$jscomp$20_timeout_msec$$ = $options$jscomp$44_screen_put_char$$?.timeout_msec || 0;
6124
+ var $end$jscomp$20_timeout_msec$$ = $options$jscomp$46_screen_put_char$$?.timeout_msec || 0;
6116
6125
  const $changed_rows$jscomp$1$$ = new Set;
6117
- $options$jscomp$44_screen_put_char$$ = $args$jscomp$2$$ => $changed_rows$jscomp$1$$.add($args$jscomp$2$$[0]);
6126
+ $options$jscomp$46_screen_put_char$$ = $args$jscomp$2$$ => $changed_rows$jscomp$1$$.add($args$jscomp$2$$[0]);
6118
6127
  const $contains_expected$$ = ($screen_line$$, $pattern$jscomp$4$$) => $pattern$jscomp$4$$.test ? $pattern$jscomp$4$$.test($screen_line$$) : $screen_line$$.startsWith($pattern$jscomp$4$$), $screen_lines$$ = [];
6119
- this.add_listener("screen-put-char", $options$jscomp$44_screen_put_char$$);
6128
+ this.add_listener("screen-put-char", $options$jscomp$46_screen_put_char$$);
6120
6129
  for ($screen_line$jscomp$1_succeeded$$ of this.screen_adapter.get_text_screen()) {
6121
6130
  if ($match_multi$$) {
6122
6131
  $screen_lines$$.push($screen_line$jscomp$1_succeeded$$.trimRight());
6123
6132
  } else {
6124
6133
  if ($contains_expected$$($screen_line$jscomp$1_succeeded$$, $expected$$)) {
6125
- return this.remove_listener("screen-put-char", $options$jscomp$44_screen_put_char$$), !0;
6134
+ return this.remove_listener("screen-put-char", $options$jscomp$46_screen_put_char$$), !0;
6126
6135
  }
6127
6136
  }
6128
6137
  }
@@ -6158,7 +6167,7 @@ $V86$$module$src$browser$starter$$.prototype.wait_until_vga_screen_contains = as
6158
6167
  }
6159
6168
  $changed_rows$jscomp$1$$.clear();
6160
6169
  }
6161
- this.remove_listener("screen-put-char", $options$jscomp$44_screen_put_char$$);
6170
+ this.remove_listener("screen-put-char", $options$jscomp$46_screen_put_char$$);
6162
6171
  return $screen_line$jscomp$1_succeeded$$;
6163
6172
  };
6164
6173
  $V86$$module$src$browser$starter$$.prototype.read_memory = function($offset$jscomp$62$$, $length$jscomp$25$$) {
@@ -8583,7 +8592,7 @@ function $IDEInterface$$module$src$ide$$($channel$jscomp$31$$, $interface_nr$$,
8583
8592
  this.data_end = this.data_length = 0;
8584
8593
  this.current_command = -1;
8585
8594
  this.last_io_id = this.write_dest = 0;
8586
- this.in_progress_io_ids = new Set;
8595
+ this.in_progress_io_ids = new Map;
8587
8596
  this.cancelled_io_ids = new Set;
8588
8597
  this.current_atapi_command = -1;
8589
8598
  this.atapi_add_sense = this.atapi_sense_key = 0;
@@ -9194,8 +9203,8 @@ $IDEInterface$$module$src$ide$$.prototype.report_write = function($byte_count$js
9194
9203
  this.bus.send("ide-write-end", [this.channel_nr, $byte_count$jscomp$10$$, $byte_count$jscomp$10$$ / this.sector_size | 0]);
9195
9204
  };
9196
9205
  $IDEInterface$$module$src$ide$$.prototype.read_buffer = function($start$jscomp$39$$, $length$jscomp$31$$, $callback$jscomp$46$$) {
9197
- const $id$jscomp$24$$ = this.last_io_id++;
9198
- this.in_progress_io_ids.add($id$jscomp$24$$);
9206
+ const $id$jscomp$24$$ = this.last_io_id++, $abort$jscomp$1$$ = new AbortController;
9207
+ this.in_progress_io_ids.set($id$jscomp$24$$, $abort$jscomp$1$$);
9199
9208
  this.buffer.get($start$jscomp$39$$, $length$jscomp$31$$, $data$jscomp$207$$ => {
9200
9209
  if (this.cancelled_io_ids.delete($id$jscomp$24$$)) {
9201
9210
  $dbg_assert$$module$src$log$$(!this.in_progress_io_ids.has($id$jscomp$24$$));
@@ -9204,11 +9213,11 @@ $IDEInterface$$module$src$ide$$.prototype.read_buffer = function($start$jscomp$3
9204
9213
  $dbg_assert$$module$src$log$$($removed$$);
9205
9214
  $callback$jscomp$46$$($data$jscomp$207$$);
9206
9215
  }
9207
- });
9216
+ }, {signal:$abort$jscomp$1$$.signal});
9208
9217
  };
9209
9218
  $IDEInterface$$module$src$ide$$.prototype.cancel_io_operations = function() {
9210
- for (const $id$jscomp$25$$ of this.in_progress_io_ids) {
9211
- this.cancelled_io_ids.add($id$jscomp$25$$);
9219
+ for (const [$id$jscomp$25$$, $abort$jscomp$2$$] of this.in_progress_io_ids) {
9220
+ this.cancelled_io_ids.add($id$jscomp$25$$), $abort$jscomp$2$$.abort();
9212
9221
  }
9213
9222
  this.in_progress_io_ids.clear();
9214
9223
  };
@@ -11728,28 +11737,28 @@ $CPU$$module$src$cpu$$.prototype.dump_wasm = function($buffer$jscomp$67$$) {
11728
11737
  $module$jscomp$2$$ && $module$jscomp$2$$.destroy();
11729
11738
  }
11730
11739
  };
11731
- function $VirtIO$$module$src$virtio$$($cpu$jscomp$27$$, $options$jscomp$45$$) {
11740
+ function $VirtIO$$module$src$virtio$$($cpu$jscomp$27$$, $options$jscomp$47$$) {
11732
11741
  this.cpu = $cpu$jscomp$27$$;
11733
11742
  this.pci = $cpu$jscomp$27$$.devices.pci;
11734
- this.device_id = $options$jscomp$45$$.device_id;
11735
- this.pci_space = [244, 26, $options$jscomp$45$$.device_id & 255, $options$jscomp$45$$.device_id >> 8, 7, 5, 16, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 168, 0, 0, 0, 16, 191, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 26, $options$jscomp$45$$.subsystem_device_id & 255, $options$jscomp$45$$.subsystem_device_id >> 8, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ];
11743
+ this.device_id = $options$jscomp$47$$.device_id;
11744
+ this.pci_space = [244, 26, $options$jscomp$47$$.device_id & 255, $options$jscomp$47$$.device_id >> 8, 7, 5, 16, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 168, 0, 0, 0, 16, 191, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 26, $options$jscomp$47$$.subsystem_device_id & 255, $options$jscomp$47$$.subsystem_device_id >> 8, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ];
11736
11745
  this.pci_space = this.pci_space.concat(Array(256 - this.pci_space.length).fill(0));
11737
- this.pci_id = $options$jscomp$45$$.pci_id;
11746
+ this.pci_id = $options$jscomp$47$$.pci_id;
11738
11747
  this.pci_bars = [];
11739
- this.name = $options$jscomp$45$$.name;
11748
+ this.name = $options$jscomp$47$$.name;
11740
11749
  this.driver_feature_select = this.device_feature_select = 0;
11741
11750
  this.device_feature = new Uint32Array(4);
11742
11751
  this.driver_feature = new Uint32Array(4);
11743
- for ($f$jscomp$7_offsets$$ of $options$jscomp$45$$.common.features) {
11752
+ for ($f$jscomp$7_offsets$$ of $options$jscomp$47$$.common.features) {
11744
11753
  $dbg_assert$$module$src$log$$(0 <= $f$jscomp$7_offsets$$, "VirtIO device<" + this.name + "> feature bit numbers must be non-negative"), $dbg_assert$$module$src$log$$(128 > $f$jscomp$7_offsets$$, "VirtIO device<" + this.name + "> feature bit numbers assumed less than 128 in implementation"), this.device_feature[$f$jscomp$7_offsets$$ >>> 5] |= 1 << ($f$jscomp$7_offsets$$ & 31), this.driver_feature[$f$jscomp$7_offsets$$ >>> 5] |= 1 << ($f$jscomp$7_offsets$$ & 31);
11745
11754
  }
11746
- $dbg_assert$$module$src$log$$($options$jscomp$45$$.common.features.includes(32), "VirtIO device<" + this.name + "> only non-transitional devices are supported");
11755
+ $dbg_assert$$module$src$log$$($options$jscomp$47$$.common.features.includes(32), "VirtIO device<" + this.name + "> only non-transitional devices are supported");
11747
11756
  this.features_ok = !0;
11748
11757
  this.device_status = 0;
11749
11758
  this.config_has_changed = !1;
11750
11759
  this.config_generation = 0;
11751
11760
  this.queues = [];
11752
- for (var $effective_offset_queue_options$$ of $options$jscomp$45$$.common.queues) {
11761
+ for (var $effective_offset_queue_options$$ of $options$jscomp$47$$.common.queues) {
11753
11762
  this.queues.push(new $VirtQueue$$module$src$virtio$$($cpu$jscomp$27$$, this, $effective_offset_queue_options$$));
11754
11763
  }
11755
11764
  this.queue_select = 0;
@@ -11757,22 +11766,22 @@ function $VirtIO$$module$src$virtio$$($cpu$jscomp$27$$, $options$jscomp$45$$) {
11757
11766
  this.isr_status = 0;
11758
11767
  var $f$jscomp$7_offsets$$ = new Set;
11759
11768
  for ($capabilities_offset$jscomp$82$$ of this.queues.map($q$jscomp$2$$ => $q$jscomp$2$$.notify_offset)) {
11760
- $effective_offset_queue_options$$ = $options$jscomp$45$$.notification.single_handler ? 0 : $capabilities_offset$jscomp$82$$, $f$jscomp$7_offsets$$.add($effective_offset_queue_options$$), $dbg_assert$$module$src$log$$($options$jscomp$45$$.notification.handlers[$effective_offset_queue_options$$], "VirtIO device<" + this.name + "> every queue's notifier must exist");
11769
+ $effective_offset_queue_options$$ = $options$jscomp$47$$.notification.single_handler ? 0 : $capabilities_offset$jscomp$82$$, $f$jscomp$7_offsets$$.add($effective_offset_queue_options$$), $dbg_assert$$module$src$log$$($options$jscomp$47$$.notification.handlers[$effective_offset_queue_options$$], "VirtIO device<" + this.name + "> every queue's notifier must exist");
11761
11770
  }
11762
- for (const [$index$jscomp$88$$, $handler$jscomp$15$$] of $options$jscomp$45$$.notification.handlers.entries()) {
11771
+ for (const [$index$jscomp$88$$, $handler$jscomp$15$$] of $options$jscomp$47$$.notification.handlers.entries()) {
11763
11772
  $dbg_assert$$module$src$log$$(!$handler$jscomp$15$$ || $f$jscomp$7_offsets$$.has($index$jscomp$88$$), "VirtIO device<" + this.name + "> no defined notify handler should be unused");
11764
11773
  }
11765
11774
  var $capabilities_offset$jscomp$82$$ = [];
11766
- $capabilities_offset$jscomp$82$$.push(this.create_common_capability($options$jscomp$45$$.common));
11767
- $capabilities_offset$jscomp$82$$.push(this.create_notification_capability($options$jscomp$45$$.notification));
11768
- $capabilities_offset$jscomp$82$$.push(this.create_isr_capability($options$jscomp$45$$.isr_status));
11769
- $options$jscomp$45$$.device_specific && $capabilities_offset$jscomp$82$$.push(this.create_device_specific_capability($options$jscomp$45$$.device_specific));
11775
+ $capabilities_offset$jscomp$82$$.push(this.create_common_capability($options$jscomp$47$$.common));
11776
+ $capabilities_offset$jscomp$82$$.push(this.create_notification_capability($options$jscomp$47$$.notification));
11777
+ $capabilities_offset$jscomp$82$$.push(this.create_isr_capability($options$jscomp$47$$.isr_status));
11778
+ $options$jscomp$47$$.device_specific && $capabilities_offset$jscomp$82$$.push(this.create_device_specific_capability($options$jscomp$47$$.device_specific));
11770
11779
  this.init_capabilities($capabilities_offset$jscomp$82$$);
11771
11780
  $cpu$jscomp$27$$.devices.pci.register_device(this);
11772
11781
  this.reset();
11773
11782
  }
11774
- $VirtIO$$module$src$virtio$$.prototype.create_common_capability = function($options$jscomp$46$$) {
11775
- return {type:1, bar:0, port:$options$jscomp$46$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array(0), struct:[{bytes:4, name:"device_feature_select", read:() => this.device_feature_select, write:$data$jscomp$221$$ => {
11783
+ $VirtIO$$module$src$virtio$$.prototype.create_common_capability = function($options$jscomp$48$$) {
11784
+ return {type:1, bar:0, port:$options$jscomp$48$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array(0), struct:[{bytes:4, name:"device_feature_select", read:() => this.device_feature_select, write:$data$jscomp$221$$ => {
11776
11785
  this.device_feature_select = $data$jscomp$221$$;
11777
11786
  }, }, {bytes:4, name:"device_feature", read:() => this.device_feature[this.device_feature_select] || 0, write:() => {
11778
11787
  }, }, {bytes:4, name:"driver_feature_select", read:() => this.driver_feature_select, write:$data$jscomp$223$$ => {
@@ -11794,7 +11803,7 @@ $VirtIO$$module$src$virtio$$.prototype.create_common_capability = function($opti
11794
11803
  this.features_ok || ($data$jscomp$227$$ & 8 && $dbg_log$$module$src$log$$("Removing FEATURES_OK", 2097152), $data$jscomp$227$$ &= -9);
11795
11804
  this.device_status = $data$jscomp$227$$;
11796
11805
  if ($data$jscomp$227$$ & ~this.device_status & 4) {
11797
- $options$jscomp$46$$.on_driver_ok();
11806
+ $options$jscomp$48$$.on_driver_ok();
11798
11807
  }
11799
11808
  }, }, {bytes:1, name:"config_generation", read:() => this.config_generation, write:() => {
11800
11809
  }, }, {bytes:2, name:"queue_select", read:() => this.queue_select, write:$data$jscomp$229$$ => {
@@ -11825,27 +11834,27 @@ $VirtIO$$module$src$virtio$$.prototype.create_common_capability = function($opti
11825
11834
  0 !== $data$jscomp$239$$ && $dbg_log$$module$src$log$$("Warning: High dword of 64 bit queue_used ignored:" + $data$jscomp$239$$, 2097152);
11826
11835
  }, }, ], };
11827
11836
  };
11828
- $VirtIO$$module$src$virtio$$.prototype.create_notification_capability = function($options$jscomp$47$$) {
11837
+ $VirtIO$$module$src$virtio$$.prototype.create_notification_capability = function($options$jscomp$49$$) {
11829
11838
  const $notify_struct$$ = [];
11830
11839
  let $notify_off_multiplier$$;
11831
- $options$jscomp$47$$.single_handler ? ($dbg_assert$$module$src$log$$(1 === $options$jscomp$47$$.handlers.length, "VirtIO device<" + this.name + "> too many notify handlers specified: expected single handler"), $notify_off_multiplier$$ = 0) : $notify_off_multiplier$$ = 2;
11832
- for (const [$i$jscomp$116$$, $handler$jscomp$16$$] of $options$jscomp$47$$.handlers.entries()) {
11840
+ $options$jscomp$49$$.single_handler ? ($dbg_assert$$module$src$log$$(1 === $options$jscomp$49$$.handlers.length, "VirtIO device<" + this.name + "> too many notify handlers specified: expected single handler"), $notify_off_multiplier$$ = 0) : $notify_off_multiplier$$ = 2;
11841
+ for (const [$i$jscomp$116$$, $handler$jscomp$16$$] of $options$jscomp$49$$.handlers.entries()) {
11833
11842
  $notify_struct$$.push({bytes:2, name:"notify" + $i$jscomp$116$$, read:() => 65535, write:$handler$jscomp$16$$ || (() => {
11834
11843
  }), });
11835
11844
  }
11836
- return {type:2, bar:1, port:$options$jscomp$47$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array([$notify_off_multiplier$$ & 255, $notify_off_multiplier$$ >> 8 & 255, $notify_off_multiplier$$ >> 16 & 255, $notify_off_multiplier$$ >> 24, ]), struct:$notify_struct$$, };
11845
+ return {type:2, bar:1, port:$options$jscomp$49$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array([$notify_off_multiplier$$ & 255, $notify_off_multiplier$$ >> 8 & 255, $notify_off_multiplier$$ >> 16 & 255, $notify_off_multiplier$$ >> 24, ]), struct:$notify_struct$$, };
11837
11846
  };
11838
- $VirtIO$$module$src$virtio$$.prototype.create_isr_capability = function($options$jscomp$48$$) {
11839
- return {type:3, bar:2, port:$options$jscomp$48$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array(0), struct:[{bytes:1, name:"isr_status", read:() => {
11847
+ $VirtIO$$module$src$virtio$$.prototype.create_isr_capability = function($options$jscomp$50$$) {
11848
+ return {type:3, bar:2, port:$options$jscomp$50$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array(0), struct:[{bytes:1, name:"isr_status", read:() => {
11840
11849
  const $isr_status$$ = this.isr_status;
11841
11850
  this.lower_irq();
11842
11851
  return $isr_status$$;
11843
11852
  }, write:() => {
11844
11853
  }, }, ], };
11845
11854
  };
11846
- $VirtIO$$module$src$virtio$$.prototype.create_device_specific_capability = function($options$jscomp$49$$) {
11847
- $dbg_assert$$module$src$log$$(~$options$jscomp$49$$.offset & 3, "VirtIO device<" + this.name + "> device specific cap offset must be 4-byte aligned");
11848
- return {type:4, bar:3, port:$options$jscomp$49$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array(0), struct:$options$jscomp$49$$.struct, };
11855
+ $VirtIO$$module$src$virtio$$.prototype.create_device_specific_capability = function($options$jscomp$51$$) {
11856
+ $dbg_assert$$module$src$log$$(~$options$jscomp$51$$.offset & 3, "VirtIO device<" + this.name + "> device specific cap offset must be 4-byte aligned");
11857
+ return {type:4, bar:3, port:$options$jscomp$51$$.initial_port, use_mmio:!1, offset:0, extra:new Uint8Array(0), struct:$options$jscomp$51$$.struct, };
11849
11858
  };
11850
11859
  $VirtIO$$module$src$virtio$$.prototype.init_capabilities = function($cap_len$jscomp$1_capabilities$jscomp$1_write$$) {
11851
11860
  let $cap_next$$ = this.pci_space[52] = 64;
@@ -12027,13 +12036,13 @@ $VirtIO$$module$src$virtio$$.prototype.lower_irq = function() {
12027
12036
  this.isr_status = 0;
12028
12037
  this.pci.lower_irq(this.pci_id);
12029
12038
  };
12030
- function $VirtQueue$$module$src$virtio$$($cpu$jscomp$28$$, $virtio$$, $options$jscomp$50$$) {
12039
+ function $VirtQueue$$module$src$virtio$$($cpu$jscomp$28$$, $virtio$$, $options$jscomp$52$$) {
12031
12040
  this.cpu = $cpu$jscomp$28$$;
12032
12041
  this.virtio = $virtio$$;
12033
- this.size_supported = this.size = $options$jscomp$50$$.size_supported;
12042
+ this.size_supported = this.size = $options$jscomp$52$$.size_supported;
12034
12043
  this.mask = this.size - 1;
12035
12044
  this.enabled = !1;
12036
- this.notify_offset = $options$jscomp$50$$.notify_offset;
12045
+ this.notify_offset = $options$jscomp$52$$.notify_offset;
12037
12046
  this.num_staged_replies = this.used_addr = this.avail_last_idx = this.avail_addr = this.desc_addr = 0;
12038
12047
  this.reset();
12039
12048
  }