Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add cpuinfo-noop.c stubs for cpufreq/cpuinfo on Android cdylib

cpuinfo-linux.c / cpufreq-linux.c are gated out for Android (bionic
doesn't ship cpu-features.h in default includes), but their exported
functions are referenced from upper layers as diagnostics. Add no-op
stubs for cpucount_linux, cpuusage_linux, frequency_linux,
{min,current,max}_scaling_frequency, cpustatetimes_linux,
current_scaling_governor, cpufreq_available_governors,
cpufreq_set_governor.

Returning 1-cpu / no-frequencies / empty-strings is safe — these are
diagnostic-only and don't drive scheduling decisions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

+36
+1
firmware/SOURCES
··· 1988 1988 target/hosted/android/cdylib/rb_zig_compat.c 1989 1989 target/hosted/android/cdylib/lcd-noop.c 1990 1990 target/hosted/android/cdylib/button-noop.c 1991 + target/hosted/android/cdylib/cpuinfo-noop.c 1991 1992 #else 1992 1993 /* Existing Java-shell Android app */ 1993 1994 target/hosted/lc-unix.c
+1
firmware/target/hosted/android/cdylib/SOURCES
··· 4 4 rb_zig_compat.c 5 5 lcd-noop.c 6 6 button-noop.c 7 + cpuinfo-noop.c
+34
firmware/target/hosted/android/cdylib/cpuinfo-noop.c
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later 2 + * 3 + * Stubs for cpuinfo-linux.c / cpufreq-linux.c which we gate out of the 4 + * cdylib build (bionic doesn't ship cpu-features.h in default includes, 5 + * and we don't need cpu-info introspection from the engine — JS already 6 + * has Android's own /proc/cpuinfo if it ever needs it). 7 + * 8 + * Returning 1 cpu / no-frequencies is harmless: the upper layer uses 9 + * these only for diagnostics, not for scheduling decisions. 10 + */ 11 + 12 + #include <stdbool.h> 13 + #include <stddef.h> 14 + 15 + struct cpuusage; 16 + struct time_state; 17 + struct cpufreq_governor; 18 + 19 + bool current_scaling_governor(int cpu, char *g, int gsize) 20 + { (void)cpu; if (g && gsize > 0) g[0] = 0; return false; } 21 + 22 + int cpuusage_linux(struct cpuusage *u) { (void)u; return 0; } 23 + int cpucount_linux(void) { return 1; } 24 + int frequency_linux(int cpu) { (void)cpu; return 0; } 25 + int min_scaling_frequency(int cpu) { (void)cpu; return 0; } 26 + int current_scaling_frequency(int cpu) { (void)cpu; return 0; } 27 + int max_scaling_frequency(int cpu) { (void)cpu; return 0; } 28 + int cpustatetimes_linux(int cpu, struct time_state *d, int max) 29 + { (void)cpu; (void)d; (void)max; return 0; } 30 + 31 + void cpufreq_available_governors(char *g, int gsize, int cpu) 32 + { (void)g; (void)gsize; (void)cpu; if (g && gsize > 0) g[0] = 0; } 33 + 34 + void cpufreq_set_governor(const char *g, int cpu) { (void)g; (void)cpu; }