Merge ../linux-2.6-watchdog-mm
[pandora-kernel.git] / arch / i386 / kernel / acpi / boot.c
index c8f96cf..cbcb2c2 100644 (file)
@@ -333,7 +333,7 @@ acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
 /*
  * Parse Interrupt Source Override for the ACPI SCI
  */
-static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
+static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 {
        if (trigger == 0)       /* compatible SCI trigger is level */
                trigger = 3;
@@ -1327,3 +1327,25 @@ static int __init setup_acpi_sci(char *s)
        return 0;
 }
 early_param("acpi_sci", setup_acpi_sci);
+
+int __acpi_acquire_global_lock(unsigned int *lock)
+{
+       unsigned int old, new, val;
+       do {
+               old = *lock;
+               new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
+               val = cmpxchg(lock, old, new);
+       } while (unlikely (val != old));
+       return (new < 3) ? -1 : 0;
+}
+
+int __acpi_release_global_lock(unsigned int *lock)
+{
+       unsigned int old, new, val;
+       do {
+               old = *lock;
+               new = old & ~0x3;
+               val = cmpxchg(lock, old, new);
+       } while (unlikely (val != old));
+       return old & 0x1;
+}