diff --git a/src/browser/starter.js b/src/browser/starter.js index ce0bb006..a63ee3e2 100644 --- a/src/browser/starter.js +++ b/src/browser/starter.js @@ -213,7 +213,6 @@ function V86Starter(options) "verw": function() { return cpu.verw.apply(cpu, arguments); }, "verr": function() { return cpu.verr.apply(cpu, arguments); }, - "update_cs_size": function() { return cpu.update_cs_size.apply(cpu, arguments); }, "cpuid": function() { return cpu.cpuid.apply(cpu, arguments); }, "load_ldt": function() { return cpu.load_ldt.apply(cpu, arguments); }, diff --git a/src/native/js_imports.h b/src/native/js_imports.h index 61feb516..a32f43f4 100644 --- a/src/native/js_imports.h +++ b/src/native/js_imports.h @@ -44,7 +44,6 @@ extern void popa16(void); extern void popa32(void); extern void undefined_instruction(void); extern void unimplemented_sse(void); -extern void update_cs_size(int32_t); extern void update_eflags(int32_t); extern bool switch_seg(int32_t, int32_t); extern void lss16(int32_t, int32_t, int32_t); diff --git a/src/rust/cpu2/cpu.rs b/src/rust/cpu2/cpu.rs index 4b221b36..0e95bd17 100644 --- a/src/rust/cpu2/cpu.rs +++ b/src/rust/cpu2/cpu.rs @@ -921,6 +921,14 @@ pub unsafe fn cpl_changed() { *last_virt_esp = -1; } +pub unsafe fn update_cs_size(new_size: bool) { + if *is_32 != new_size { + *is_32 = new_size; + // TODO: + // update_operand_size(); + } +} + pub unsafe fn test_privileges_for_io(port: i32, size: i32) -> bool { if *protected_mode && (*cpl > getiopl() as u8 || (*flags & FLAG_VM != 0)) { if !*tss_size_32 { diff --git a/src/rust/cpu2/instructions_0f.rs b/src/rust/cpu2/instructions_0f.rs index 1221a389..2eb4a487 100644 --- a/src/rust/cpu2/instructions_0f.rs +++ b/src/rust/cpu2/instructions_0f.rs @@ -21,8 +21,6 @@ extern "C" { #[no_mangle] fn cpuid(); #[no_mangle] - fn update_cs_size(cs_size: bool); - #[no_mangle] fn lsl(r: i32, v: i32) -> i32; #[no_mangle] fn lar(r: i32, v: i32) -> i32;