b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From a21e75da32c0016f1575ea29775565934a67660d Mon Sep 17 00:00:00 2001 |
| 2 | From: "Sergey V. Lobanov" <sergey@lobanov.in> |
| 3 | Date: Sat, 5 Feb 2022 13:10:23 +0300 |
| 4 | Subject: [PATCH] Add cpuid compatibility header to build on non-x86 hosts |
| 5 | |
| 6 | Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in> |
| 7 | --- |
| 8 | cpuid-compat/cpuid.h | 17 +++++++++++++++++ |
| 9 | 1 file changed, 17 insertions(+) |
| 10 | create mode 100644 cpuid-compat/cpuid.h |
| 11 | |
| 12 | --- /dev/null |
| 13 | +++ b/cpuid-compat/cpuid.h |
| 14 | @@ -0,0 +1,17 @@ |
| 15 | +// SPDX-License-Identifier: GPL-2.0-or-later |
| 16 | +/* |
| 17 | + * cpuid compatibility header to build iucode-tool on non-x86 hosts |
| 18 | + * |
| 19 | + * Copyright (C) 2022 Sergey V. Lobanov <sergey@lobanov.in> |
| 20 | + */ |
| 21 | + |
| 22 | +#ifdef __APPLE__ |
| 23 | +# include <limits.h> |
| 24 | +#endif |
| 25 | + |
| 26 | +static __inline int __get_cpuid (unsigned int leaf, |
| 27 | + unsigned int *eax, unsigned int *ebx, |
| 28 | + unsigned int *ecx, unsigned int *edx) |
| 29 | +{ |
| 30 | + return 0; |
| 31 | +} |