| .. | .. |
|---|
| 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" |
|---|
| .. | .. |
|---|
| 31 | 31 | extern char *optarg; |
|---|
| 32 | 32 | extern int optind, opterr, optopt; |
|---|
| 33 | 33 | unsigned int cpu; |
|---|
| 34 | + struct utsname uts; |
|---|
| 34 | 35 | |
|---|
| 35 | 36 | union { |
|---|
| 36 | 37 | struct { |
|---|
| .. | .. |
|---|
| 39 | 40 | int params; |
|---|
| 40 | 41 | } params = {}; |
|---|
| 41 | 42 | int ret = 0; |
|---|
| 43 | + |
|---|
| 44 | + ret = uname(&uts); |
|---|
| 45 | + if (!ret && (!strcmp(uts.machine, "ppc64le") || |
|---|
| 46 | + !strcmp(uts.machine, "ppc64"))) { |
|---|
| 47 | + fprintf(stderr, _("Subcommand not supported on POWER.\n")); |
|---|
| 48 | + return ret; |
|---|
| 49 | + } |
|---|
| 42 | 50 | |
|---|
| 43 | 51 | setlocale(LC_ALL, ""); |
|---|
| 44 | 52 | textdomain(PACKAGE); |
|---|
| .. | .. |
|---|
| 54 | 62 | default: |
|---|
| 55 | 63 | print_wrong_arg_exit(); |
|---|
| 56 | 64 | } |
|---|
| 57 | | - }; |
|---|
| 65 | + } |
|---|
| 58 | 66 | |
|---|
| 59 | 67 | if (!params.params) |
|---|
| 60 | 68 | params.params = 0x7; |
|---|