--- initial
+++ final
@@ -1,92 +1,92 @@
 static int __init apm_init(void) {
   struct desc_struct *gdt;
   int err;
   dmi_check_system(apm_dmi_table);
   if (apm_info.bios.version == 0 || machine_is_olpc()) {
     printk(KERN_INFO "apm: BIOS not found.\n");
     return -ENODEV;
   }
   printk(KERN_INFO "apm: BIOS version %d.%d Flags 0x%02x (Driver version %s)\n", ((apm_info.bios.version >> 8) & 0xff), (apm_info.bios.version & 0xff), apm_info.bios.flags, driver_version);
   if ((apm_info.bios.flags & APM_32_BIT_SUPPORT) == 0) {
     printk(KERN_INFO "apm: no 32 bit BIOS support\n");
     return -ENODEV;
   }
   if (allow_ints) apm_info.allow_ints = 1;
   if (broken_psr) apm_info.get_power_status_broken = 1;
   if (realmode_power_off) apm_info.realmode_power_off = 1;
   /* User can override, but default is to trust DMI */
   if (apm_disabled != -1) apm_info.disabled = apm_disabled;
   /*
    * Fix for the Compaq Contura 3/25c which reports BIOS version 0.1
    * but is reportedly a 1.0 BIOS.
    */
   if (apm_info.bios.version == 0x001) apm_info.bios.version = 0x100;
   /* BIOS < 1.2 doesn't set cseg_16_len */
   if (apm_info.bios.version < 0x102) apm_info.bios.cseg_16_len = 0; /* 64k */
   if (debug) {
     printk(KERN_INFO "apm: entry %x:%x cseg16 %x dseg %x", apm_info.bios.cseg, apm_info.bios.offset, apm_info.bios.cseg_16, apm_info.bios.dseg);
     if (apm_info.bios.version > 0x100) printk(" cseg len %x, dseg len %x", apm_info.bios.cseg_len, apm_info.bios.dseg_len);
     if (apm_info.bios.version > 0x101) printk(" cseg16 len %x", apm_info.bios.cseg_16_len);
     printk("\n");
   }
   if (apm_info.disabled) {
     pr_notice("disabled on user request.\n");
     return -ENODEV;
   }
   if ((num_online_cpus() > 1) && !power_off && !smp) {
     pr_notice("disabled - APM is not SMP safe.\n");
     apm_info.disabled = 1;
     return -ENODEV;
   }
   if (!acpi_disabled) {
     pr_notice("overridden by ACPI.\n");
     apm_info.disabled = 1;
     return -ENODEV;
   }
   /*
    * Set up the long jump entry point to the APM BIOS, which is called
    * from inline assembly.
    */
   apm_bios_entry.offset = apm_info.bios.offset;
   apm_bios_entry.segment = APM_CS;
   /*
    * The APM 1.1 BIOS is supposed to provide limit information that it
    * recognizes.  Many machines do this correctly, but many others do
    * not restrict themselves to their claimed limit.  When this happens,
    * they will cause a segmentation violation in the kernel at boot time.
    * Most BIOS's, however, will respect a 64k limit, so we use that.
    *
    * Note we only set APM segments on CPU zero, since we pin the APM
    * code to that CPU.
    */
-  gdt = get_cpu_gdt_table(0);
+  gdt = get_cpu_gdt_rw(0);
   set_desc_base(&gdt[APM_CS >> 3], (unsigned long)__va((unsigned long)apm_info.bios.cseg << 4));
   set_desc_base(&gdt[APM_CS_16 >> 3], (unsigned long)__va((unsigned long)apm_info.bios.cseg_16 << 4));
   set_desc_base(&gdt[APM_DS >> 3], (unsigned long)__va((unsigned long)apm_info.bios.dseg << 4));
   proc_create("apm", 0, NULL, &apm_file_ops);
   kapmd_task = kthread_create(apm, NULL, "kapmd");
   if (IS_ERR(kapmd_task)) {
     pr_err("disabled - Unable to start kernel thread\n");
     err = PTR_ERR(kapmd_task);
     kapmd_task = NULL;
     remove_proc_entry("apm", NULL);
     return err;
   }
   wake_up_process(kapmd_task);
   if (num_online_cpus() > 1 && !smp) {
     printk(KERN_NOTICE "apm: disabled - APM is not SMP safe (power off active).\n");
     return 0;
   }
   /*
    * Note we don't actually care if the misc_device cannot be registered.
    * this driver can do its job without it, even if userspace can't
    * control it.  just log the error
    */
   if (misc_register(&apm_device)) printk(KERN_WARNING "apm: Could not register misc device.\n");
   if (HZ != 100) idle_period = (idle_period * HZ) / 100;
   if (idle_threshold < 100) {
     if (!cpuidle_register_driver(&apm_idle_driver))
       if (cpuidle_register_device(&apm_cpuidle_device)) cpuidle_unregister_driver(&apm_idle_driver);
   }
   return 0;
 }<sep>@@
expression e;
@@

- get_cpu_gdt_table
+ get_cpu_gdt_rw
    (e)