Skip to content

Commit

Permalink
s2ram: kill old debugging junk
Browse files Browse the repository at this point in the history
This removes old debugging stuff, that should be no longer neccessary.  It
accessed VGA hardware (which may not be ready at this point), and used LEDs
at port 80 for debugging.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Pavel Machek authored and Linus Torvalds committed Oct 18, 2007
1 parent 8f4ce8c commit 50a1efe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
12 changes: 1 addition & 11 deletions arch/x86/kernel/acpi/wakeup_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# If physical address of wakeup_code is 0x12345, BIOS should call us with
# cs = 0x1234, eip = 0x05
#
#

#define BEEP \
inb $97, %al; \
Expand Down Expand Up @@ -52,7 +52,6 @@ wakeup_code:
BEEP
1:
mov $(wakeup_stack - wakeup_code), %sp # Private stack is needed for ASUS board
movw $0x0e00 + 'S', %fs:(0x12)

pushl $0 # Kill any dangerous flags
popfl
Expand Down Expand Up @@ -90,9 +89,6 @@ wakeup_code:
# make sure %cr4 is set correctly (features, etc)
movl real_save_cr4 - wakeup_code, %eax
movl %eax, %cr4
movw $0xb800, %ax
movw %ax,%fs
movw $0x0e00 + 'i', %fs:(0x12)

# need a gdt -- use lgdtl to force 32-bit operands, in case
# the GDT is located past 16 megabytes.
Expand All @@ -102,8 +98,6 @@ wakeup_code:
movl %eax, %cr0
jmp 1f
1:
movw $0x0e00 + 'n', %fs:(0x14)

movl real_magic - wakeup_code, %eax
cmpl $0x12345678, %eax
jne bogus_real_magic
Expand All @@ -122,13 +116,11 @@ real_save_cr4: .long 0
real_magic: .long 0
video_mode: .long 0
realmode_flags: .long 0
beep_flags: .long 0
real_efer_save_restore: .long 0
real_save_efer_edx: .long 0
real_save_efer_eax: .long 0

bogus_real_magic:
movw $0x0e00 + 'B', %fs:(0x12)
jmp bogus_real_magic

/* This code uses an extended set of video mode numbers. These include:
Expand Down Expand Up @@ -194,7 +186,6 @@ wakeup_pmode_return:
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
movw $0x0e00 + 'u', 0xb8016

# reload the gdt, as we need the full 32 bit address
lgdt saved_gdt
Expand All @@ -218,7 +209,6 @@ wakeup_pmode_return:
jmp *%eax

bogus_magic:
movw $0x0e00 + 'B', 0xb8018
jmp bogus_magic


Expand Down
32 changes: 0 additions & 32 deletions arch/x86/kernel/acpi/wakeup_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ wakeup_code:

# Running in *copy* of this code, somewhere in low 1MB.

movb $0xa1, %al ; outb %al, $0x80
cli
cld
# setup data segment
Expand All @@ -65,11 +64,6 @@ wakeup_code:
cmpl $0x12345678, %eax
jne bogus_real_magic

call verify_cpu # Verify the cpu supports long
# mode
testl %eax, %eax
jnz no_longmode

testl $1, realmode_flags - wakeup_code
jz 1f
lcall $0xc000,$3
Expand All @@ -84,12 +78,6 @@ wakeup_code:
call mode_set
1:

movw $0xb800, %ax
movw %ax,%fs
movw $0x0e00 + 'L', %fs:(0x10)

movb $0xa2, %al ; outb %al, $0x80

mov %ds, %ax # Find 32bit wakeup_code addr
movzx %ax, %esi # (Convert %ds:gdt to a liner ptr)
shll $4, %esi
Expand Down Expand Up @@ -117,14 +105,10 @@ wakeup_32_vector:
.code32
wakeup_32:
# Running in this code, but at low address; paging is not yet turned on.
movb $0xa5, %al ; outb %al, $0x80

movl $__KERNEL_DS, %eax
movl %eax, %ds

movw $0x0e00 + 'i', %ds:(0xb8012)
movb $0xa8, %al ; outb %al, $0x80;

/*
* Prepare for entering 64bits mode
*/
Expand Down Expand Up @@ -200,16 +184,11 @@ wakeup_long64:
*/
lgdt cpu_gdt_descr

movw $0x0e00 + 'n', %ds:(0xb8014)
movb $0xa9, %al ; outb %al, $0x80

movq saved_magic, %rax
movq $0x123456789abcdef0, %rdx
cmpq %rdx, %rax
jne bogus_64_magic

movw $0x0e00 + 'u', %ds:(0xb8016)

nop
nop
movw $__KERNEL_DS, %ax
Expand All @@ -220,13 +199,11 @@ wakeup_long64:
movw %ax, %gs
movq saved_rsp, %rsp

movw $0x0e00 + 'x', %ds:(0xb8018)
movq saved_rbx, %rbx
movq saved_rdi, %rdi
movq saved_rsi, %rsi
movq saved_rbp, %rbp

movw $0x0e00 + '!', %ds:(0xb801a)
movq saved_rip, %rax
jmp *%rax

Expand Down Expand Up @@ -256,21 +233,12 @@ realmode_flags: .quad 0

.code16
bogus_real_magic:
movb $0xba,%al ; outb %al,$0x80
jmp bogus_real_magic

.code64
bogus_64_magic:
movb $0xb3,%al ; outb %al,$0x80
jmp bogus_64_magic

.code16
no_longmode:
movb $0xbc,%al ; outb %al,$0x80
jmp no_longmode

#include "../verify_cpu_64.S"

/* This code uses an extended set of video mode numbers. These include:
* Aliases for standard modes
* NORMAL_VGA (-1)
Expand Down

0 comments on commit 50a1efe

Please sign in to comment.