cpu: Port update_cs_size to Rust
The JS version needs to stay too since it can be called by other JS-only functions.
This commit is contained in:
parent
1712d25725
commit
56ec3be5a4
|
@ -213,7 +213,6 @@ function V86Starter(options)
|
||||||
"verw": function() { return cpu.verw.apply(cpu, arguments); },
|
"verw": function() { return cpu.verw.apply(cpu, arguments); },
|
||||||
"verr": function() { return cpu.verr.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); },
|
"cpuid": function() { return cpu.cpuid.apply(cpu, arguments); },
|
||||||
|
|
||||||
"load_ldt": function() { return cpu.load_ldt.apply(cpu, arguments); },
|
"load_ldt": function() { return cpu.load_ldt.apply(cpu, arguments); },
|
||||||
|
|
|
@ -44,7 +44,6 @@ extern void popa16(void);
|
||||||
extern void popa32(void);
|
extern void popa32(void);
|
||||||
extern void undefined_instruction(void);
|
extern void undefined_instruction(void);
|
||||||
extern void unimplemented_sse(void);
|
extern void unimplemented_sse(void);
|
||||||
extern void update_cs_size(int32_t);
|
|
||||||
extern void update_eflags(int32_t);
|
extern void update_eflags(int32_t);
|
||||||
extern bool switch_seg(int32_t, int32_t);
|
extern bool switch_seg(int32_t, int32_t);
|
||||||
extern void lss16(int32_t, int32_t, int32_t);
|
extern void lss16(int32_t, int32_t, int32_t);
|
||||||
|
|
|
@ -921,6 +921,14 @@ pub unsafe fn cpl_changed() {
|
||||||
*last_virt_esp = -1;
|
*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 {
|
pub unsafe fn test_privileges_for_io(port: i32, size: i32) -> bool {
|
||||||
if *protected_mode && (*cpl > getiopl() as u8 || (*flags & FLAG_VM != 0)) {
|
if *protected_mode && (*cpl > getiopl() as u8 || (*flags & FLAG_VM != 0)) {
|
||||||
if !*tss_size_32 {
|
if !*tss_size_32 {
|
||||||
|
|
|
@ -21,8 +21,6 @@ extern "C" {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn cpuid();
|
fn cpuid();
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn update_cs_size(cs_size: bool);
|
|
||||||
#[no_mangle]
|
|
||||||
fn lsl(r: i32, v: i32) -> i32;
|
fn lsl(r: i32, v: i32) -> i32;
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn lar(r: i32, v: i32) -> i32;
|
fn lar(r: i32, v: i32) -> i32;
|
||||||
|
|
Loading…
Reference in a new issue