Introduce a gSystemShutdown flag to be able to check if system is shutting down. ACPI Embedded Controller now uses polling when it is set to true.
This might help with ACPI shutdown issues, if not this change can be reverted. Not verified as it works on all my machines even without this. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38585 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
|
||||
/* during kernel startup, interrupts are disabled (among other things) */
|
||||
extern bool gKernelStartup;
|
||||
extern bool gKernelShutdown;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -604,7 +604,7 @@ EcSpaceHandler(uint32 function, acpi_physical_address address, uint32 width,
|
||||
* (Not sure if it's needed)
|
||||
*/
|
||||
|
||||
if (gKernelStartup || sc->ec_suspending) {
|
||||
if (gKernelStartup || gKernelShutdown || sc->ec_suspending) {
|
||||
if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) {
|
||||
//CTR0(KTR_ACPI, "ec running gpe handler directly");
|
||||
EcGpeQueryHandler(sc);
|
||||
@@ -667,7 +667,7 @@ EcWaitEvent(struct acpi_ec_cookie* sc, EC_EVENT event, int32 generationCount)
|
||||
int32 count, i;
|
||||
|
||||
// int need_poll = cold || rebooting || ec_polled_mode || sc->ec_suspending;
|
||||
int needPoll = ec_polled_mode || sc->ec_suspending || gKernelStartup;
|
||||
int needPoll = ec_polled_mode || sc->ec_suspending || gKernelStartup || gKernelShutdown;
|
||||
|
||||
// The main CPU should be much faster than the EC. So the status should
|
||||
// be "not ready" when we start waiting. But if the main CPU is really
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#endif
|
||||
|
||||
bool gKernelStartup = true;
|
||||
bool gKernelShutdown = false;
|
||||
|
||||
static kernel_args sKernelArgs;
|
||||
static uint32 sCpuRendezvous;
|
||||
|
||||
@@ -15,6 +15,8 @@ system_shutdown(bool reboot)
|
||||
int32 cookie = 0;
|
||||
team_info info;
|
||||
|
||||
gKernelShutdown = true;
|
||||
|
||||
// Now shutdown all system services!
|
||||
// TODO: Once we are sure we can shutdown the system on all hardware
|
||||
// checking reboot may not be necessary anymore.
|
||||
|
||||
Reference in New Issue
Block a user