Skip to content

Commit 7db4c0a

Browse files
fyin1lijinxia
authored andcommitted
DM: Add funciton to update PM_WAK_STS
According to ACPI spec, when system back to working mode from S3, WAK_STS bit (15) should be set. Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Reviewed-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent a8a27d8 commit 7db4c0a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

devicemodel/arch/x86/pm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,15 @@ pm1_status_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
175175
return 0;
176176
}
177177

178+
void
179+
pm_backto_wakeup(struct vmctx *ctx)
180+
{
181+
/* According to ACPI 5.0 Table 4-16: bit 15, WAK_STS should be
182+
* set when system trasition to the working state
183+
*/
184+
pm1_status |= PM1_WAK_STS;
185+
}
186+
178187
static int
179188
pm1_enable_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
180189
uint32_t *eax, void *arg)

devicemodel/core/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ vm_suspend_resume(struct vmctx *ctx)
622622
vm_stop_watchdog(ctx);
623623
wait_for_resume(ctx);
624624

625+
pm_backto_wakeup(ctx);
625626
vm_reset_watchdog(ctx);
626627
vm_reset(ctx);
627628
}

devicemodel/include/acpi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ void dsdt_indent(int levels);
5858
void dsdt_unindent(int levels);
5959
void sci_init(struct vmctx *ctx);
6060
void pm_write_dsdt(struct vmctx *ctx, int ncpu);
61+
void pm_backto_wakeup(struct vmctx *ctx);
6162

6263
#endif /* _ACPI_H_ */

0 commit comments

Comments
 (0)