Simplify call_interrupt_vector from js

This commit is contained in:
Fabian 2018-12-09 20:26:47 -06:00
parent dca6be2d94
commit 70cc242eb1
2 changed files with 7 additions and 23 deletions

View file

@ -271,7 +271,7 @@ CPU.prototype.wasm_patch = function(wm)
this.trigger_ss = get_import("trigger_ss");
this.switch_cs_real_mode = get_import("switch_cs_real_mode");
this.call_interrupt_vector = get_import("call_interrupt_vector_js");
this.pic_call_irq = get_import("pic_call_irq");
this.get_tss_stack_addr = get_import("get_tss_stack_addr_js");
this.do_many_cycles_native = get_import("do_many_cycles_native");
@ -2370,12 +2370,6 @@ CPU.prototype.unimplemented_sse = function()
this.trigger_ud();
};
CPU.prototype.pic_call_irq = function(int)
{
this.previous_ip[0] = this.instruction_pointer[0]; // XXX: What if called after instruction (port IO)
this.call_interrupt_vector(int, false, false, 0);
};
CPU.prototype.handle_irqs = function()
{
//dbg_assert(this.prefixes[0] === 0);

View file

@ -363,22 +363,6 @@ impl InterruptDescriptor {
const TRAP_GATE: u8 = 0b111;
}
#[no_mangle]
pub unsafe fn call_interrupt_vector_js(
interrupt_nr: i32,
is_software_int: bool,
has_error_code: bool,
error_code: i32,
) {
let ec = if has_error_code {
Some(error_code)
}
else {
None
};
call_interrupt_vector(interrupt_nr, is_software_int, ec);
}
#[no_mangle]
pub unsafe fn switch_cs_real_mode(selector: i32) {
dbg_assert!(!*protected_mode || vm86_mode());
@ -2809,3 +2793,9 @@ pub unsafe fn handle_irqs() {
pic_acknowledge()
}
}
#[no_mangle]
pub unsafe fn pic_call_irq(interrupt_nr: i32) {
*previous_ip = *instruction_pointer; // XXX: What if called after instruction (port IO)
call_interrupt_vector(interrupt_nr, false, None);
}