virtual-machine 0.0.18 → 0.0.20
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.
|
@@ -206,14 +206,14 @@ if (!("encodeInto" in cachedTextEncoder)) {
|
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
var WASM_VECTOR_LEN = 0;
|
|
209
|
-
function
|
|
210
|
-
wasm.
|
|
209
|
+
function wasm_bindgen__convert__closures_____invoke__hf42da40d1dcec156(arg0, arg1) {
|
|
210
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hf42da40d1dcec156(arg0, arg1);
|
|
211
211
|
}
|
|
212
212
|
function wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919(arg0, arg1, arg2) {
|
|
213
213
|
wasm.wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919(arg0, arg1, arg2);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
wasm.
|
|
215
|
+
function wasm_bindgen__convert__closures_____invoke__h63aabd61d982f555(arg0, arg1) {
|
|
216
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h63aabd61d982f555(arg0, arg1);
|
|
217
217
|
}
|
|
218
218
|
var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
219
219
|
}, unregister: () => {
|
|
@@ -303,9 +303,12 @@ var WasmVm = class {
|
|
|
303
303
|
}
|
|
304
304
|
/**
|
|
305
305
|
* Execute a single instruction.
|
|
306
|
+
* Returns true if the VM is still running, false if halted.
|
|
307
|
+
* @returns {boolean}
|
|
306
308
|
*/
|
|
307
309
|
step() {
|
|
308
|
-
wasm.wasmvm_step(this.__wbg_ptr);
|
|
310
|
+
const ret = wasm.wasmvm_step(this.__wbg_ptr);
|
|
311
|
+
return ret !== 0;
|
|
309
312
|
}
|
|
310
313
|
/**
|
|
311
314
|
* Push an input byte to the UART.
|
|
@@ -314,6 +317,23 @@ var WasmVm = class {
|
|
|
314
317
|
input(byte) {
|
|
315
318
|
wasm.wasmvm_input(this.__wbg_ptr, byte);
|
|
316
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* Get the halt code if the VM has halted.
|
|
322
|
+
* Code 0x5555 typically means successful shutdown (PASS).
|
|
323
|
+
* @returns {bigint}
|
|
324
|
+
*/
|
|
325
|
+
halt_code() {
|
|
326
|
+
const ret = wasm.wasmvm_halt_code(this.__wbg_ptr);
|
|
327
|
+
return BigInt.asUintN(64, ret);
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Check if the VM has halted (e.g., due to shutdown command).
|
|
331
|
+
* @returns {boolean}
|
|
332
|
+
*/
|
|
333
|
+
is_halted() {
|
|
334
|
+
const ret = wasm.wasmvm_is_halted(this.__wbg_ptr);
|
|
335
|
+
return ret !== 0;
|
|
336
|
+
}
|
|
317
337
|
/**
|
|
318
338
|
* Load a disk image and attach it as a VirtIO block device.
|
|
319
339
|
* This should be called before starting execution if the kernel needs a filesystem.
|
|
@@ -567,11 +587,11 @@ function __wbg_get_imports() {
|
|
|
567
587
|
return ret;
|
|
568
588
|
};
|
|
569
589
|
imports.wbg.__wbindgen_cast_3dba8e634cba348f = function(arg0, arg1) {
|
|
570
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
590
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h69b64ae87dd7e1f7, wasm_bindgen__convert__closures_____invoke__h63aabd61d982f555);
|
|
571
591
|
return ret;
|
|
572
592
|
};
|
|
573
593
|
imports.wbg.__wbindgen_cast_8184f83d0f362634 = function(arg0, arg1) {
|
|
574
|
-
const ret = makeClosure(arg0, arg1, wasm.
|
|
594
|
+
const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h69b64ae87dd7e1f7, wasm_bindgen__convert__closures_____invoke__hf42da40d1dcec156);
|
|
575
595
|
return ret;
|
|
576
596
|
};
|
|
577
597
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|