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