| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * (C) 2011 Thomas Renninger <trenn@suse.de>, Novell Inc. |
|---|
| 3 | | - * |
|---|
| 4 | | - * Licensed under the terms of the GNU GPL License version 2. |
|---|
| 5 | 4 | */ |
|---|
| 6 | 5 | |
|---|
| 7 | 6 | |
|---|
| .. | .. |
|---|
| 11 | 10 | #include <errno.h> |
|---|
| 12 | 11 | #include <string.h> |
|---|
| 13 | 12 | #include <getopt.h> |
|---|
| 13 | +#include <sys/utsname.h> |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | #include "helpers/helpers.h" |
|---|
| 16 | 16 | #include "helpers/sysfs.h" |
|---|
| .. | .. |
|---|
| 32 | 32 | extern char *optarg; |
|---|
| 33 | 33 | extern int optind, opterr, optopt; |
|---|
| 34 | 34 | unsigned int cpu; |
|---|
| 35 | + struct utsname uts; |
|---|
| 35 | 36 | |
|---|
| 36 | 37 | union { |
|---|
| 37 | 38 | struct { |
|---|
| .. | .. |
|---|
| 41 | 42 | } params; |
|---|
| 42 | 43 | int perf_bias = 0; |
|---|
| 43 | 44 | int ret = 0; |
|---|
| 45 | + |
|---|
| 46 | + ret = uname(&uts); |
|---|
| 47 | + if (!ret && (!strcmp(uts.machine, "ppc64le") || |
|---|
| 48 | + !strcmp(uts.machine, "ppc64"))) { |
|---|
| 49 | + fprintf(stderr, _("Subcommand not supported on POWER.\n")); |
|---|
| 50 | + return ret; |
|---|
| 51 | + } |
|---|
| 44 | 52 | |
|---|
| 45 | 53 | setlocale(LC_ALL, ""); |
|---|
| 46 | 54 | textdomain(PACKAGE); |
|---|
| .. | .. |
|---|
| 64 | 72 | default: |
|---|
| 65 | 73 | print_wrong_arg_exit(); |
|---|
| 66 | 74 | } |
|---|
| 67 | | - }; |
|---|
| 75 | + } |
|---|
| 68 | 76 | |
|---|
| 69 | 77 | if (!params.params) |
|---|
| 70 | 78 | print_wrong_arg_exit(); |
|---|