[Solved] ACPICA : Unable to shutdown (AE_NOT_EXIST)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
wichtounet
Member
Member
Posts: 90
Joined: Fri Nov 01, 2013 4:05 pm
Location: Fribourg, Switzerland
Contact:

[Solved] ACPICA : Unable to shutdown (AE_NOT_EXIST)

Post by wichtounet »

Hi,

I've implemented the ACPICA OSL for my OS and performed a full initialization of ACPICA. The initialization seems to work. This is what is printed during initialization:
TRACE: Initializing Namespace objects:
: 8.8s] (id ) - 4382992 Objects with 1 Devices, 96 Regions, 15 Methods (3/31/14 Serial/Non/Cvt)
TRACE: Table [SSDT7: 8.8s] (id ) - 4390657 Objects with 2 Devices, 1 Regions, 0 Methods (0/0/0 Serial/Non/Cvt)
TRACE: Completing Region/Field/Buffer/Package initialization:
TRACE: Initialized 3/3 Regions 0/0 Fields 6/6 Buffers 4/4 Packages (106 nodes)
TRACE: Initializing Device/Processor/Thermal objects and executing _INI/_STA methods:
TRACE: Executed 0 _INI methods requiring 0 _STA executions (examined 18 objects)
However, I'm not able to shutdown the system. Here is my shutdown code:

Code: Select all

    auto status = AcpiEnterSleepStatePrep(5);

    if(ACPI_FAILURE(status)){
        logging::logf(logging::log_level::ERROR, "acpica: Impossible to prepare sleep state: error: %s\n", AcpiGbl_ExceptionNames_Env[status].Name);
        return;
    }

    size_t rflags;
    arch::disable_hwint(rflags);
    status = AcpiEnterSleepState(5);

    if(ACPI_FAILURE(status)){
        logging::logf(logging::log_level::ERROR, "acpica: Impossible to enter sleep state: error: %s\n", AcpiGbl_ExceptionNames_Env[status].Name);
        return;
    }

    k_print_line("acpi poweroff failed.");
    arch::enable_hwint(rflags);
The call to AcpiEnterSleepState returns AE_NOT_EXIST

Is there anything else I have to do for ACPICA shutdown ?

Thanks
Last edited by wichtounet on Sun Jul 24, 2016 7:32 am, edited 2 times in total.
Thor Operating System: C++ 64 bits OS: https://github.com/wichtounet/thor-os
Good osdeving!
User avatar
wichtounet
Member
Member
Posts: 90
Joined: Fri Nov 01, 2013 4:05 pm
Location: Fribourg, Switzerland
Contact:

Re: ACPICA : Unable to shutdown (AE_NOT_EXIST)

Post by wichtounet »

I found the issue :)

I had to replace:

Code: Select all

    status = AcpiInitializeTables(nullptr, 16, false);
by

Code: Select all

    status = AcpiInitializeTables(nullptr, 16, true);
I guess there was too many tables, so the resize is allowing more tables.
Thor Operating System: C++ 64 bits OS: https://github.com/wichtounet/thor-os
Good osdeving!
Post Reply