diff --git a/hw/acpi/core.c b/hw/acpi/core.c index b8d39012cd..f467779b3a 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -502,13 +502,21 @@ static inline int64_t acpi_pm_tmr_get_clock(void) void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar) { int64_t d = acpi_pm_tmr_get_clock(); +#ifdef XBOX + ar->tmr.overflow_time = (d + 0x80000000LL) & ~0x7fffffffLL; +#else ar->tmr.overflow_time = (d + 0x800000LL) & ~0x7fffffLL; +#endif } static uint32_t acpi_pm_tmr_get(ACPIREGS *ar) { uint32_t d = acpi_pm_tmr_get_clock(); +#ifdef XBOX + return d; +#else return d & 0xffffff; +#endif } static void acpi_pm_tmr_timer(void *opaque) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 3cf2a1679c..30c6a061e6 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -130,6 +130,9 @@ static void init_common_fadt_data(Object *o, AcpiFadtData *data) (1 << ACPI_FADT_F_SLP_BUTTON) | (1 << ACPI_FADT_F_RTC_S4) | (1 << ACPI_FADT_F_USE_PLATFORM_CLOCK) | +#ifdef XBOX + (1 << ACPI_FADT_F_TMR_VAL_EXT) | +#endif /* APIC destination mode ("Flat Logical") has an upper limit of 8 * CPUs for more than 8 CPUs, "Clustered Logical" mode has to be * used diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h index c20ace0d0b..58c5765d98 100644 --- a/include/hw/acpi/acpi.h +++ b/include/hw/acpi/acpi.h @@ -50,7 +50,11 @@ #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len" /* PM Timer ticks per second (HZ) */ +#ifdef XBOX +#define PM_TIMER_FREQUENCY 3375000 +#else #define PM_TIMER_FREQUENCY 3579545 +#endif /* ACPI fixed hardware registers */