diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2007-05-02 13:27:07 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:07 -0400 |
commit | 7c17e70613d2c70f9d5d0b5d37126fd5e8e9b728 (patch) | |
tree | 9e6aac1a33f5f8830242b76ea83ddc2160f525b2 /arch/x86_64/kernel/acpi | |
parent | 90b1c2085ea1955641e60a4f0acd63fdc271cd0b (diff) |
[PATCH] x86-64: Get rid of dead code in suspend resume
o Get rid of dead code in wakeup.S
o We never restore from saved_gdt, saved_idt, saved_ltd, saved_tss, saved_cr3,
saved_cr4, saved_cr0, real_save_gdt, saved_efer, saved_efer2. Get rid
of of associated code.
o Get rid of bogus_magic, bogus_31_magic and bogus_magic2. No longer being
used.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/acpi')
-rw-r--r-- | arch/x86_64/kernel/acpi/wakeup.S | 57 |
1 files changed, 1 insertions, 56 deletions
diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S index 185faa911db5..6ece70e91a32 100644 --- a/arch/x86_64/kernel/acpi/wakeup.S +++ b/arch/x86_64/kernel/acpi/wakeup.S | |||
@@ -258,8 +258,6 @@ gdt_48a: | |||
258 | .word 0, 0 # gdt base (filled in later) | 258 | .word 0, 0 # gdt base (filled in later) |
259 | 259 | ||
260 | 260 | ||
261 | real_save_gdt: .word 0 | ||
262 | .quad 0 | ||
263 | real_magic: .quad 0 | 261 | real_magic: .quad 0 |
264 | video_mode: .quad 0 | 262 | video_mode: .quad 0 |
265 | video_flags: .quad 0 | 263 | video_flags: .quad 0 |
@@ -272,10 +270,6 @@ bogus_32_magic: | |||
272 | movb $0xb3,%al ; outb %al,$0x80 | 270 | movb $0xb3,%al ; outb %al,$0x80 |
273 | jmp bogus_32_magic | 271 | jmp bogus_32_magic |
274 | 272 | ||
275 | bogus_31_magic: | ||
276 | movb $0xb1,%al ; outb %al,$0x80 | ||
277 | jmp bogus_31_magic | ||
278 | |||
279 | bogus_cpu: | 273 | bogus_cpu: |
280 | movb $0xbc,%al ; outb %al,$0x80 | 274 | movb $0xbc,%al ; outb %al,$0x80 |
281 | jmp bogus_cpu | 275 | jmp bogus_cpu |
@@ -346,16 +340,6 @@ check_vesaa: | |||
346 | 340 | ||
347 | _setbada: jmp setbada | 341 | _setbada: jmp setbada |
348 | 342 | ||
349 | .code64 | ||
350 | bogus_magic: | ||
351 | movw $0x0e00 + 'B', %ds:(0xb8018) | ||
352 | jmp bogus_magic | ||
353 | |||
354 | bogus_magic2: | ||
355 | movw $0x0e00 + '2', %ds:(0xb8018) | ||
356 | jmp bogus_magic2 | ||
357 | |||
358 | |||
359 | wakeup_stack_begin: # Stack grows down | 343 | wakeup_stack_begin: # Stack grows down |
360 | 344 | ||
361 | .org 0xff0 | 345 | .org 0xff0 |
@@ -373,28 +357,11 @@ ENTRY(wakeup_end) | |||
373 | # | 357 | # |
374 | # Returned address is location of code in low memory (past data and stack) | 358 | # Returned address is location of code in low memory (past data and stack) |
375 | # | 359 | # |
360 | .code64 | ||
376 | ENTRY(acpi_copy_wakeup_routine) | 361 | ENTRY(acpi_copy_wakeup_routine) |
377 | pushq %rax | 362 | pushq %rax |
378 | pushq %rcx | ||
379 | pushq %rdx | 363 | pushq %rdx |
380 | 364 | ||
381 | sgdt saved_gdt | ||
382 | sidt saved_idt | ||
383 | sldt saved_ldt | ||
384 | str saved_tss | ||
385 | |||
386 | movq %cr3, %rdx | ||
387 | movq %rdx, saved_cr3 | ||
388 | movq %cr4, %rdx | ||
389 | movq %rdx, saved_cr4 | ||
390 | movq %cr0, %rdx | ||
391 | movq %rdx, saved_cr0 | ||
392 | sgdt real_save_gdt - wakeup_start (,%rdi) | ||
393 | movl $MSR_EFER, %ecx | ||
394 | rdmsr | ||
395 | movl %eax, saved_efer | ||
396 | movl %edx, saved_efer2 | ||
397 | |||
398 | movl saved_video_mode, %edx | 365 | movl saved_video_mode, %edx |
399 | movl %edx, video_mode - wakeup_start (,%rdi) | 366 | movl %edx, video_mode - wakeup_start (,%rdi) |
400 | movl acpi_video_flags, %edx | 367 | movl acpi_video_flags, %edx |
@@ -407,17 +374,8 @@ ENTRY(acpi_copy_wakeup_routine) | |||
407 | cmpl $0x9abcdef0, %eax | 374 | cmpl $0x9abcdef0, %eax |
408 | jne bogus_32_magic | 375 | jne bogus_32_magic |
409 | 376 | ||
410 | # make sure %cr4 is set correctly (features, etc) | ||
411 | movl saved_cr4 - __START_KERNEL_map, %eax | ||
412 | movq %rax, %cr4 | ||
413 | |||
414 | movl saved_cr0 - __START_KERNEL_map, %eax | ||
415 | movq %rax, %cr0 | ||
416 | jmp 1f # Flush pipelines | ||
417 | 1: | ||
418 | # restore the regs we used | 377 | # restore the regs we used |
419 | popq %rdx | 378 | popq %rdx |
420 | popq %rcx | ||
421 | popq %rax | 379 | popq %rax |
422 | ENTRY(do_suspend_lowlevel_s4bios) | 380 | ENTRY(do_suspend_lowlevel_s4bios) |
423 | ret | 381 | ret |
@@ -512,16 +470,3 @@ ENTRY(saved_eip) .quad 0 | |||
512 | ENTRY(saved_esp) .quad 0 | 470 | ENTRY(saved_esp) .quad 0 |
513 | 471 | ||
514 | ENTRY(saved_magic) .quad 0 | 472 | ENTRY(saved_magic) .quad 0 |
515 | |||
516 | ALIGN | ||
517 | # saved registers | ||
518 | saved_gdt: .quad 0,0 | ||
519 | saved_idt: .quad 0,0 | ||
520 | saved_ldt: .quad 0 | ||
521 | saved_tss: .quad 0 | ||
522 | |||
523 | saved_cr0: .quad 0 | ||
524 | saved_cr3: .quad 0 | ||
525 | saved_cr4: .quad 0 | ||
526 | saved_efer: .quad 0 | ||
527 | saved_efer2: .quad 0 | ||