Skip to contentSkip to conversation

s-t-RAM: load gdt the right way

PATCH New Pavel Machek 1 participant 1 message Apr 21, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s-t-RAM: load gdt the right way

Sleep code uses wrong version of lgdt, that does the wrong thing when gdt is beyond 16MB or so...

arch/i386/kernel/acpi/wakeup.S +3 -2
@@ -74,8 +90,9 @@
 	movw	%ax,%fs
 	movw	$0x0e00 + 'i', %fs:(0x12)
 	
-	# need a gdt
-	lgdt	real_save_gdt - wakeup_code
+	# need a gdt -- use lgdtl to force 32-bit operands, in case
+	# the GDT is located past 16 megabytes
+	lgdtl	real_save_gdt - wakeup_code
 
 	movl	real_save_cr0 - wakeup_code, %eax
 	movl	%eax, %cr0
arch/x86_64/kernel/acpi/wakeup.S +1 -1
@@ -67,7 +67,7 @@
 	shll	$4, %eax
 	addl	$(gdta - wakeup_code), %eax
 	movl	%eax, gdt_48a +2 - wakeup_code
-	lgdt	%ds:gdt_48a - wakeup_code		# load gdt with whatever is
+	lgdtl	%ds:gdt_48a - wakeup_code	# load gdt with whatever is
 						# appropriate
 
 	movl	$1, %eax			# protected mode (PE) bit
Signature · 1 line
Boycott Kodak -- for their patent abuse against Java.