freeze: restore state with thaw request
Change-Id: I7d6efd2c47020bedb716b6bd72d8a72b874c3cb2
This commit is contained in:
committed by
Masamichi Takagi
parent
04a528ab27
commit
dec133c1dd
2
ihk
2
ihk
Submodule ihk updated: 02ef2693af...d5dc1632cc
@ -17,13 +17,19 @@ freeze()
|
||||
unsigned long flags;
|
||||
struct ihk_os_cpu_monitor *monitor = cpu_local_var(monitor);
|
||||
|
||||
monitor->status_bak = monitor->status;
|
||||
monitor->status_bak = monitor->status
|
||||
| IHK_OS_MONITOR_ALLOW_THAW_REQUEST;
|
||||
monitor->status = IHK_OS_MONITOR_KERNEL_FROZEN;
|
||||
flags = cpu_enable_interrupt_save();
|
||||
frozen:
|
||||
while (monitor->status == IHK_OS_MONITOR_KERNEL_FROZEN) {
|
||||
cpu_halt();
|
||||
cpu_pause();
|
||||
}
|
||||
if (monitor->status_bak != IHK_OS_MONITOR_KERNEL_THAW) {
|
||||
monitor->status = IHK_OS_MONITOR_KERNEL_FROZEN;
|
||||
goto frozen;
|
||||
}
|
||||
cpu_restore_interrupt(flags);
|
||||
monitor->status = monitor->status_bak;
|
||||
}
|
||||
@ -53,8 +59,10 @@ freeze_thaw(void *nmi_ctx)
|
||||
}
|
||||
}
|
||||
else if (multi_intr_mode == 2) {
|
||||
if (monitor->status == IHK_OS_MONITOR_KERNEL_FROZEN) {
|
||||
monitor->status = IHK_OS_MONITOR_KERNEL_THAW;
|
||||
if (monitor->status_bak & IHK_OS_MONITOR_ALLOW_THAW_REQUEST) {
|
||||
monitor->status = monitor->status_bak
|
||||
& ~IHK_OS_MONITOR_ALLOW_THAW_REQUEST;
|
||||
monitor->status_bak = IHK_OS_MONITOR_KERNEL_THAW;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user