aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power
diff options
context:
space:
mode:
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/acpi/Makefile149
-rw-r--r--tools/power/acpi/man/acpidump.8 (renamed from tools/power/acpi/acpidump.8)0
-rw-r--r--tools/power/acpi/tools/acpidump/acpidump.c (renamed from tools/power/acpi/acpidump.c)0
-rw-r--r--tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c5
-rw-r--r--tools/power/cpupower/utils/cpupower-set.c6
5 files changed, 141 insertions, 19 deletions
diff --git a/tools/power/acpi/Makefile b/tools/power/acpi/Makefile
index bafeb8d662a3..d9186a2fdf06 100644
--- a/tools/power/acpi/Makefile
+++ b/tools/power/acpi/Makefile
@@ -1,18 +1,143 @@
1PROG= acpidump 1# tools/power/acpi/Makefile - ACPI tool Makefile
2SRCS= acpidump.c 2#
3# Copyright (c) 2013, Intel Corporation
4# Author: Lv Zheng <lv.zheng@intel.com>
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License
8# as published by the Free Software Foundation; version 2
9# of the License.
10
11OUTPUT=./
12ifeq ("$(origin O)", "command line")
13 OUTPUT := $(O)/
14endif
15
16ifneq ($(OUTPUT),)
17# check that the output directory actually exists
18OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
19$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
20endif
21
22# --- CONFIGURATION BEGIN ---
23
24# Set the following to `true' to make a unstripped, unoptimized
25# binary. Leave this set to `false' for production use.
26DEBUG ?= true
27
28# make the build silent. Set this to something else to make it noisy again.
29V ?= false
30
31# Prefix to the directories we're installing to
32DESTDIR ?=
33
34# --- CONFIGURATION END ---
35
36# Directory definitions. These are default and most probably
37# do not need to be changed. Please note that DESTDIR is
38# added in front of any of them
39
40bindir ?= /usr/bin
41sbindir ?= /usr/sbin
42mandir ?= /usr/man
43
44# Toolchain: what tools do we use, and what options do they need:
45
46INSTALL = /usr/bin/install -c
47INSTALL_PROGRAM = ${INSTALL}
48INSTALL_DATA = ${INSTALL} -m 644
49INSTALL_SCRIPT = ${INSTALL_PROGRAM}
50
51# If you are running a cross compiler, you may want to set this
52# to something more interesting, like "arm-linux-". If you want
53# to compile vs uClibc, that can be done here as well.
54CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
55CC = $(CROSS)gcc
56LD = $(CROSS)gcc
57STRIP = $(CROSS)strip
58HOSTCC = gcc
59
60# check if compiler option is supported
61cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
62
63# use '-Os' optimization if available, else use -O2
64OPTIMIZATION := $(call cc-supports,-Os,-O2)
65
66WARNINGS := -Wall
67WARNINGS += $(call cc-supports,-Wstrict-prototypes)
68WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
69
3KERNEL_INCLUDE := ../../../include 70KERNEL_INCLUDE := ../../../include
4CFLAGS += -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE) 71CFLAGS += -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE)
72CFLAGS += $(WARNINGS)
73
74ifeq ($(strip $(V)),false)
75 QUIET=@
76 ECHO=@echo
77else
78 QUIET=
79 ECHO=@\#
80endif
81export QUIET ECHO
82
83# if DEBUG is enabled, then we do not strip or optimize
84ifeq ($(strip $(DEBUG)),true)
85 CFLAGS += -O1 -g -DDEBUG
86 STRIPCMD = /bin/true -Since_we_are_debugging
87else
88 CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
89 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
90endif
91
92# if DEBUG is enabled, then we do not strip or optimize
93ifeq ($(strip $(DEBUG)),true)
94 CFLAGS += -O1 -g -DDEBUG
95 STRIPCMD = /bin/true -Since_we_are_debugging
96else
97 CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
98 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
99endif
100
101# --- ACPIDUMP BEGIN ---
102
103vpath %.c \
104 tools/acpidump
105
106DUMP_OBJS = \
107 acpidump.o
108
109DUMP_OBJS := $(addprefix $(OUTPUT)tools/acpidump/,$(DUMP_OBJS))
110
111$(OUTPUT)acpidump: $(DUMP_OBJS)
112 $(ECHO) " LD " $@
113 $(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(DUMP_OBJS) -L$(OUTPUT) -o $@
114 $(QUIET) $(STRIPCMD) $@
115
116$(OUTPUT)tools/acpidump/%.o: %.c
117 $(ECHO) " CC " $@
118 $(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
119
120# --- ACPIDUMP END ---
121
122all: $(OUTPUT)acpidump
123 echo $(OUTPUT)
124
125clean:
126 -find $(OUTPUT) \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
127 | xargs rm -f
128 -rm -f $(OUTPUT)acpidump
5 129
6all: acpidump 130install-tools:
7$(PROG) : $(SRCS) 131 $(INSTALL) -d $(DESTDIR)${bindir}
8 $(CC) $(CFLAGS) $(SRCS) -o $(PROG) 132 $(INSTALL_PROGRAM) $(OUTPUT)acpidump $(DESTDIR)${sbindir}
9 133
10CLEANFILES= $(PROG) 134install-man:
135 $(INSTALL_DATA) -D man/acpidump.8 $(DESTDIR)${mandir}/man8/acpidump.8
11 136
12clean : 137install: all install-tools install-man
13 rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS)) *~
14 138
15install : 139uninstall:
16 install acpidump /usr/sbin/acpidump 140 - rm -f $(DESTDIR)${sbindir}/acpidump
17 install acpidump.8 /usr/share/man/man8 141 - rm -f $(DESTDIR)${mandir}/man8/acpidump.8
18 142
143.PHONY: all utils install-tools install-man install uninstall clean
diff --git a/tools/power/acpi/acpidump.8 b/tools/power/acpi/man/acpidump.8
index adfa99166e5e..adfa99166e5e 100644
--- a/tools/power/acpi/acpidump.8
+++ b/tools/power/acpi/man/acpidump.8
diff --git a/tools/power/acpi/acpidump.c b/tools/power/acpi/tools/acpidump/acpidump.c
index a84553a0e0df..a84553a0e0df 100644
--- a/tools/power/acpi/acpidump.c
+++ b/tools/power/acpi/tools/acpidump/acpidump.c
diff --git a/tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c b/tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c
index 66cace601e57..0f10b81e3322 100644
--- a/tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c
+++ b/tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c
@@ -25,12 +25,9 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28 28#include <linux/acpi.h>
29#include <asm/io.h> 29#include <asm/io.h>
30 30
31#include <acpi/acpi_bus.h>
32#include <acpi/acpi_drivers.h>
33
34static int pm_tmr_ioport = 0; 31static int pm_tmr_ioport = 0;
35 32
36/*helper function to safely read acpi pm timesource*/ 33/*helper function to safely read acpi pm timesource*/
diff --git a/tools/power/cpupower/utils/cpupower-set.c b/tools/power/cpupower/utils/cpupower-set.c
index dc4de3762111..bcf1d2f0b791 100644
--- a/tools/power/cpupower/utils/cpupower-set.c
+++ b/tools/power/cpupower/utils/cpupower-set.c
@@ -18,9 +18,9 @@
18#include "helpers/bitmask.h" 18#include "helpers/bitmask.h"
19 19
20static struct option set_opts[] = { 20static struct option set_opts[] = {
21 { .name = "perf-bias", .has_arg = optional_argument, .flag = NULL, .val = 'b'}, 21 { .name = "perf-bias", .has_arg = required_argument, .flag = NULL, .val = 'b'},
22 { .name = "sched-mc", .has_arg = optional_argument, .flag = NULL, .val = 'm'}, 22 { .name = "sched-mc", .has_arg = required_argument, .flag = NULL, .val = 'm'},
23 { .name = "sched-smt", .has_arg = optional_argument, .flag = NULL, .val = 's'}, 23 { .name = "sched-smt", .has_arg = required_argument, .flag = NULL, .val = 's'},
24 { }, 24 { },
25}; 25};
26 26