[ltp] patch for thinkpad-modules under 2.6.9-rc2

Ari Pollak linux-thinkpad@linux-thinkpad.org
Wed, 15 Sep 2004 17:24:55 -0400


This is a multi-part message in MIME format.
--------------070709010500000908040903
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

the format of referencing cpu_gdt_table changed in 2.6.9, so the 
attached patch fixes compiling thinkpad-modules under it.

--------------070709010500000908040903
Content-Type: text/plain;
 name="thinkpad.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="thinkpad.patch"

--- thinkpad/2.6/drivers/thinkpadpm.c	2004-09-15 17:20:25.000000000 -0400
+++ thinkpad/2.6/drivers/thinkpadpm.c.orig	2004-09-15 17:19:05.000000000 -0400
@@ -207,8 +207,8 @@
 	cpus = apm_save_cpus();
 	
 	cpu = get_cpu();
-	save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8];
-	per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = bad_bios_desc;
+	save_desc_40 = cpu_gdt_table[cpu][0x40 / 8];
+	cpu_gdt_table[cpu][0x40 / 8] = bad_bios_desc;
 
 	local_save_flags(flags);
 	APM_DO_CLI;
@@ -231,7 +231,7 @@
 		: "memory", "cc");
 	APM_DO_RESTORE_SEGS;
 	local_irq_restore(flags);
-	per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = save_desc_40;
+	cpu_gdt_table[cpu][0x40 / 8] = save_desc_40;
 	put_cpu();
 	apm_restore_cpus(cpus);
 	
@@ -265,9 +265,8 @@
 	cpus = apm_save_cpus();
 	
 	cpu = get_cpu();
-
-	save_desc_40 = per_cpu(cpu_gdt_table, cpu)[0x40 / 8];
-	per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = bad_bios_desc;
+	save_desc_40 = cpu_gdt_table[cpu][0x40 / 8];
+	cpu_gdt_table[cpu][0x40 / 8] = bad_bios_desc;
 
 	local_save_flags(flags);
 	APM_DO_CLI;
@@ -294,7 +293,7 @@
 	}
 	APM_DO_RESTORE_SEGS;
 	local_irq_restore(flags);
-	per_cpu(cpu_gdt_table, cpu)[0x40 / 8] = save_desc_40;
+	cpu_gdt_table[smp_processor_id()][0x40 / 8] = save_desc_40;
 	put_cpu();
 	apm_restore_cpus(cpus);
 	return error;

--------------070709010500000908040903--