diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 22 | ||||
-rw-r--r-- | arch/ia64/kernel/cpufreq/acpi-cpufreq.c | 4 |
2 files changed, 23 insertions, 3 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index c8f96cff07c6..094300b3a81f 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -1327,3 +1327,25 @@ static int __init setup_acpi_sci(char *s) | |||
1327 | return 0; | 1327 | return 0; |
1328 | } | 1328 | } |
1329 | early_param("acpi_sci", setup_acpi_sci); | 1329 | early_param("acpi_sci", setup_acpi_sci); |
1330 | |||
1331 | int __acpi_acquire_global_lock(unsigned int *lock) | ||
1332 | { | ||
1333 | unsigned int old, new, val; | ||
1334 | do { | ||
1335 | old = *lock; | ||
1336 | new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); | ||
1337 | val = cmpxchg(lock, old, new); | ||
1338 | } while (unlikely (val != old)); | ||
1339 | return (new < 3) ? -1 : 0; | ||
1340 | } | ||
1341 | |||
1342 | int __acpi_release_global_lock(unsigned int *lock) | ||
1343 | { | ||
1344 | unsigned int old, new, val; | ||
1345 | do { | ||
1346 | old = *lock; | ||
1347 | new = old & ~0x3; | ||
1348 | val = cmpxchg(lock, old, new); | ||
1349 | } while (unlikely (val != old)); | ||
1350 | return old & 0x1; | ||
1351 | } | ||
diff --git a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c index 088f130197ae..15c08d52f09f 100644 --- a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c +++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c | |||
@@ -276,12 +276,10 @@ acpi_cpufreq_cpu_init ( | |||
276 | 276 | ||
277 | dprintk("acpi_cpufreq_cpu_init\n"); | 277 | dprintk("acpi_cpufreq_cpu_init\n"); |
278 | 278 | ||
279 | data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); | 279 | data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); |
280 | if (!data) | 280 | if (!data) |
281 | return (-ENOMEM); | 281 | return (-ENOMEM); |
282 | 282 | ||
283 | memset(data, 0, sizeof(struct cpufreq_acpi_io)); | ||
284 | |||
285 | acpi_io_data[cpu] = data; | 283 | acpi_io_data[cpu] = data; |
286 | 284 | ||
287 | result = acpi_processor_register_performance(&data->acpi_data, cpu); | 285 | result = acpi_processor_register_performance(&data->acpi_data, cpu); |