CPU changes.
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
#include <86box/fdd.h>
|
#include <86box/fdd.h>
|
||||||
#include <86box/fdc.h>
|
#include <86box/fdc.h>
|
||||||
#include <86box/keyboard.h>
|
#include <86box/keyboard.h>
|
||||||
|
#include <86box/timer.h>
|
||||||
#include "386_common.h"
|
#include "386_common.h"
|
||||||
#include "x86_flags.h"
|
#include "x86_flags.h"
|
||||||
#include "x86seg.h"
|
#include "x86seg.h"
|
||||||
@@ -71,6 +72,9 @@ int smm_in_hlt = 0, smi_block = 0;
|
|||||||
uint32_t addr64, addr64_2;
|
uint32_t addr64, addr64_2;
|
||||||
uint32_t addr64a[8], addr64a_2[8];
|
uint32_t addr64a[8], addr64a_2[8];
|
||||||
|
|
||||||
|
static timer_t *cpu_fast_off_timer = NULL;
|
||||||
|
static double *cpu_fast_off_period = NULL;
|
||||||
|
|
||||||
|
|
||||||
#define AMD_SYSCALL_EIP (msr.star & 0xFFFFFFFF)
|
#define AMD_SYSCALL_EIP (msr.star & 0xFFFFFFFF)
|
||||||
#define AMD_SYSCALL_SB ((msr.star >> 32) & 0xFFFF)
|
#define AMD_SYSCALL_SB ((msr.star >> 32) & 0xFFFF)
|
||||||
@@ -1837,11 +1841,37 @@ sysret(uint32_t fetchdat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
cpu_register_fast_off_handler(void *timer, double *period)
|
||||||
|
{
|
||||||
|
cpu_fast_off_timer = (timer_t *) timer;
|
||||||
|
cpu_fast_off_period = period;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
cpu_fast_off_advance(void)
|
||||||
|
{
|
||||||
|
if (cpu_fast_off_period && (*cpu_fast_off_period != 0.0))
|
||||||
|
timer_on_auto(cpu_fast_off_timer, *cpu_fast_off_period);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
cpu_fast_off_period_set(uint16_t val, double period)
|
||||||
|
{
|
||||||
|
if (cpu_fast_off_period) {
|
||||||
|
*cpu_fast_off_period = ((double) (val + 1)) * period;
|
||||||
|
cpu_fast_off_advance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
smi_raise(void)
|
smi_raise(void)
|
||||||
{
|
{
|
||||||
if (is486 && (cpu_fast_off_flags & 0x80000000))
|
if (is486 && (cpu_fast_off_flags & 0x80000000))
|
||||||
cpu_fast_off_count = cpu_fast_off_val + 1;
|
cpu_fast_off_advance();
|
||||||
|
|
||||||
smi_line = 1;
|
smi_line = 1;
|
||||||
}
|
}
|
||||||
@@ -1851,7 +1881,7 @@ void
|
|||||||
nmi_raise(void)
|
nmi_raise(void)
|
||||||
{
|
{
|
||||||
if (is486 && (cpu_fast_off_flags & 0x20000000))
|
if (is486 && (cpu_fast_off_flags & 0x20000000))
|
||||||
cpu_fast_off_count = cpu_fast_off_val + 1;
|
cpu_fast_off_advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -733,6 +733,10 @@ extern uint8_t do_translate, do_translate2;
|
|||||||
|
|
||||||
extern void reset_808x(int hard);
|
extern void reset_808x(int hard);
|
||||||
|
|
||||||
|
extern void cpu_register_fast_off_handler(void *timer, double *period);
|
||||||
|
extern void cpu_fast_off_advance(void);
|
||||||
|
extern void cpu_fast_off_period_set(uint16_t vla, double period);
|
||||||
|
|
||||||
extern void smi_raise();
|
extern void smi_raise();
|
||||||
extern void nmi_raise();
|
extern void nmi_raise();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user