mkottman / acpi_call

A linux kernel module that enables calls to ACPI methods through /proc/acpi/call. Now with support for Integer, String and Buffer parameters.
307 stars 131 forks source link

#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead. #51

Open snakeroot opened 9 years ago

snakeroot commented 9 years ago

Kernel: 3.17-rc5

Issue: Compilation terminates with the following error message:

make -C /usr/lib/modules/3.17.0-rc5-zenbook/build M=/tmp/makepkg/acpi_call-git/src/acpi_call-build modules make[1]: Entering directory '/usr/src/3.17.0-rc5-zenbook' CC [M] /tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.o In file included from include/acpi/platform/acenv.h:172:0, from include/acpi/acpi.h:56, from /tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.c:9: include/acpi/platform/aclinux.h:52:2: error: #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."

error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."

^ scripts/Makefile.build:263: recipe for target '/tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.o' failed make[2]: * [/tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.o] Error 1 Makefile:1373: recipe for target 'module/tmp/makepkg/acpi_call-git/src/acpi_call-build' failed make[1]: * [module/tmp/makepkg/acpi_call-git/src/acpi_call-build] Error 2 make[1]: Leaving directory '/usr/src/3.17.0-rc5-zenbook' Makefile:8: recipe for target 'default' failed make: *\ [default] Error 2

Apparent solution:

Replace '#include <acpi/acpi.h>' with '#include <linux/acpi.h>': sed -i -e 's:<acpi/acpi.h>:<linux/acpi.h>:' acpi_call.c

module then builds, installs, loads and seems to work

JohnDoe42 commented 9 years ago

Same issue here. Please fix this

waterfoul commented 9 years ago

you can fix this by adding

define BUILDING_ACPICA

on line 2

Earnestly commented 8 years ago

This issue is still present

biji commented 8 years ago

get same error, compiling on fedora 24 Kernel: 4.5.6-300.fc24.x86_64

archenroot commented 7 years ago

Can you pull this fix into upstream repo, so others can benefit?

biji commented 7 years ago

You can checkout my fork: https://github.com/biji/acpi_call

archenroot commented 7 years ago

I will, I used the damadmai fork and finally I was able to compile, but unfortunately when executed turn_off_gpu.sh script all failed on my Dell XPS 15 9550 with Nvidia 960M. Probably the project is not updated with all relevant addresses for my hardware...

However I found workaround with bbswich project, after loaded, I issue bbswitch load_state=0

And card is OFF finally.

Zibri commented 6 years ago

see https://github.com/mkottman/acpi_call/pull/71

kopax commented 4 years ago

Thanks for the fork @biji, it seems to fix an error but then with Debian 10 I have Warning: modules_install: missing 'System.map' file. Skipping depmod., this warning succeed but sudo make install produce nothing, Any idea what to do ?