|
40 | 40 | #define CPU_IVAR_CPUID_SIZE 3 |
41 | 41 | #define CPU_IVAR_CPUID 4 |
42 | 42 |
|
43 | | -static __inline struct pcpu *cpu_get_pcpu(device_t dev) |
| 43 | +static __inline struct pcpu * |
| 44 | +cpu_get_pcpu(device_t dev) |
44 | 45 | { |
45 | 46 | uintptr_t v = 0; |
| 47 | + |
46 | 48 | BUS_READ_IVAR(device_get_parent(dev), dev, CPU_IVAR_PCPU, &v); |
47 | 49 | return ((struct pcpu *)v); |
48 | 50 | } |
49 | 51 |
|
50 | | -static __inline int32_t cpu_get_nominal_mhz(device_t dev) |
| 52 | +static __inline int32_t |
| 53 | +cpu_get_nominal_mhz(device_t dev) |
51 | 54 | { |
52 | 55 | uintptr_t v = 0; |
| 56 | + |
53 | 57 | if (BUS_READ_IVAR(device_get_parent(dev), dev, |
54 | 58 | CPU_IVAR_NOMINAL_MHZ, &v) != 0) |
55 | 59 | return (-1); |
56 | 60 | return ((int32_t)v); |
57 | 61 | } |
58 | 62 |
|
59 | | -static __inline const uint32_t *cpu_get_cpuid(device_t dev, size_t *count) |
| 63 | +static __inline const uint32_t * |
| 64 | +cpu_get_cpuid(device_t dev, size_t *count) |
60 | 65 | { |
61 | 66 | uintptr_t v = 0; |
| 67 | + |
62 | 68 | if (BUS_READ_IVAR(device_get_parent(dev), dev, |
63 | 69 | CPU_IVAR_CPUID_SIZE, &v) != 0) |
64 | 70 | return (NULL); |
@@ -124,10 +130,10 @@ TAILQ_HEAD(cf_level_lst, cf_level); |
124 | 130 | * state. It is probably a bug to not combine this with "info only" |
125 | 131 | */ |
126 | 132 | #define CPUFREQ_TYPE_MASK 0xffff |
127 | | -#define CPUFREQ_TYPE_RELATIVE (1<<0) |
128 | | -#define CPUFREQ_TYPE_ABSOLUTE (1<<1) |
129 | | -#define CPUFREQ_FLAG_INFO_ONLY (1<<16) |
130 | | -#define CPUFREQ_FLAG_UNCACHED (1<<17) |
| 133 | +#define CPUFREQ_TYPE_RELATIVE (1 << 0) |
| 134 | +#define CPUFREQ_TYPE_ABSOLUTE (1 << 1) |
| 135 | +#define CPUFREQ_FLAG_INFO_ONLY (1 << 16) |
| 136 | +#define CPUFREQ_FLAG_UNCACHED (1 << 17) |
131 | 137 |
|
132 | 138 | /* |
133 | 139 | * When setting a level, the caller indicates the priority of this request. |
@@ -162,7 +168,7 @@ int cpufreq_settings_changed(device_t dev); |
162 | 168 | * The new level and the result of the change (0 is success) is passed in. |
163 | 169 | * If the driver wishes to revoke the change from cpufreq_pre_change, it |
164 | 170 | * stores a non-zero error code in the result parameter and the change will |
165 | | - * not be made. If the post-change eventhandler gets a non-zero result, |
| 171 | + * not be made. If the post-change eventhandler gets a non-zero result, |
166 | 172 | * no change was made and the previous level remains in effect. If a change |
167 | 173 | * is revoked, the post-change eventhandler is still called with the error |
168 | 174 | * value supplied by the revoking driver. This gives listeners who cached |
|
0 commit comments