Skip to content

Commit

Permalink
tools/power/acpi: Add userspace AML interface support
Browse files Browse the repository at this point in the history
This patch adds a userspace tool to access Linux kernel AML debugger
interface.

Tow modes are supported by this tool:
1. Interactive: Users are able to launch a debugging shell to talk with
   in-kernel AML debugger.
   Note that it's user duty to ensure kernel runtime integrity by using
   this debugging tool:
   A. Some control methods evaluated by the users may result in kernel
      panics if those control methods shouldn't be evaluated by the OSPMs
      according to the current BIOS/OS configurations.
   B. Currently if a single stepping evaluation couldn't run to an end,
      then the synchronization primitives acquired by the evaluation may
      block normal OSPM control method evaluations.
2. Batch: Users are able to execute debugger commands in a script.
   Note that in addition to the above duties, it's user duty to ensure
   script runtime integrity by using this debugging tool in this mode:
   C. Currently only those commands that are not used for single stepping
      are suitable to be used in this mode.
   D. If the execution of the command may cause a failure that could result
      in an endless kernel execution, the execution of the script may also
      get blocked.
To exit the utility, currently "exit/quit" commands are recommended, but
ctrl-C" can also be used.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Dec 14, 2015
1 parent 8cfb0cd commit 37645d6
Show file tree
Hide file tree
Showing 3 changed files with 473 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tools/power/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

include ../../scripts/Makefile.include

all: acpidump ec
clean: acpidump_clean ec_clean
install: acpidump_install ec_install
uninstall: acpidump_uninstall ec_uninstall
all: acpidbg acpidump ec
clean: acpidbg_clean acpidump_clean ec_clean
install: acpidbg_install acpidump_install ec_install
uninstall: acpidbg_uninstall acpidump_uninstall ec_uninstall

acpidump ec: FORCE
acpidbg acpidump ec: FORCE
$(call descend,tools/$@,all)
acpidump_clean ec_clean:
acpidbg_clean acpidump_clean ec_clean:
$(call descend,tools/$(@:_clean=),clean)
acpidump_install ec_install:
acpidbg_install acpidump_install ec_install:
$(call descend,tools/$(@:_install=),install)
acpidump_uninstall ec_uninstall:
acpidbg_uninstall acpidump_uninstall ec_uninstall:
$(call descend,tools/$(@:_uninstall=),uninstall)

.PHONY: FORCE
27 changes: 27 additions & 0 deletions tools/power/acpi/tools/acpidbg/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# tools/power/acpi/tools/acpidbg/Makefile - ACPI tool Makefile
#
# Copyright (c) 2015, Intel Corporation
# Author: Lv Zheng <lv.zheng@intel.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# of the License.

include ../../Makefile.config

TOOL = acpidbg
vpath %.c \
../../../../../drivers/acpi/acpica\
../../common\
../../os_specific/service_layers\
.
CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\
-I.\
-I../../../../../drivers/acpi/acpica\
-I../../../../../include
LDFLAGS += -lpthread
TOOL_OBJS = \
acpidbg.o

include ../../Makefile.rules
Loading

0 comments on commit 37645d6

Please sign in to comment.