2009-04-13 20:07:02 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Rudolf Marek <r.marek@assembler.cz>
|
2009-11-10 23:17:15 +01:00
|
|
|
* Copyright (C) 2009 coresystems GmbH
|
2009-04-13 20:07:02 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2009-11-10 23:17:15 +01:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
2009-04-13 20:07:02 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
Remove address from GPLv2 headers
As per discussion with lawyers[tm], it's not a good idea to
shorten the license header too much - not for legal reasons
but because there are tools that look for them, and giving
them a standard pattern simplifies things.
However, we got confirmation that we don't have to update
every file ever added to coreboot whenever the FSF gets a
new lease, but can drop the address instead.
util/kconfig is excluded because that's imported code that
we may want to synchronize every now and then.
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} +
$ find * -type f
-a \! -name \*.patch \
-a \! -name \*_shipped \
-a \! -name LICENSE_GPL \
-a \! -name LGPL.txt \
-a \! -name COPYING \
-a \! -name DISCLAIMER \
-exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} +
Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/9233
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2015-03-26 15:17:45 +01:00
|
|
|
* Foundation, Inc.
|
2009-04-13 20:07:02 +02:00
|
|
|
*/
|
|
|
|
|
2009-11-10 23:17:15 +01:00
|
|
|
#define WAKEUP_BASE 0x600
|
|
|
|
#define RELOCATED(x) (x - __wakeup + WAKEUP_BASE)
|
|
|
|
|
|
|
|
/* CR0 bits */
|
|
|
|
#define PE (1 << 0)
|
|
|
|
|
|
|
|
.code32
|
|
|
|
.globl __wakeup
|
|
|
|
__wakeup:
|
|
|
|
/* First prepare the jmp to the resume vector */
|
|
|
|
mov 0x4(%esp), %eax /* vector */
|
2009-04-13 20:07:02 +02:00
|
|
|
/* last 4 bits of linear addr are taken as offset */
|
|
|
|
andw $0x0f, %ax
|
2009-11-10 23:17:15 +01:00
|
|
|
movw %ax, (__wakeup_offset)
|
2009-04-13 20:07:02 +02:00
|
|
|
mov 0x4(%esp), %eax
|
|
|
|
/* the rest is taken as segment */
|
|
|
|
shr $4, %eax
|
2009-11-10 23:17:15 +01:00
|
|
|
movw %ax, (__wakeup_segment)
|
|
|
|
|
|
|
|
/* Then overwrite coreboot with our backed up memory */
|
2011-11-17 22:03:38 +01:00
|
|
|
cld
|
|
|
|
movl 8(%esp), %esi
|
|
|
|
movl 12(%esp), %edi
|
|
|
|
movl 16(%esp), %ecx
|
|
|
|
shrl $2, %ecx
|
|
|
|
rep movsl
|
2009-11-10 23:17:15 +01:00
|
|
|
|
|
|
|
/* Activate the right segment descriptor real mode. */
|
|
|
|
ljmp $0x28, $RELOCATED(1f)
|
|
|
|
1:
|
|
|
|
.code16
|
|
|
|
/* 16 bit code from here on... */
|
|
|
|
|
|
|
|
/* Load the segment registers w/ properly configured
|
|
|
|
* segment descriptors. They will retain these
|
|
|
|
* configurations (limits, writability, etc.) once
|
|
|
|
* protected mode is turned off.
|
|
|
|
*/
|
|
|
|
mov $0x30, %ax
|
2010-04-27 08:56:47 +02:00
|
|
|
mov %ax, %ds
|
|
|
|
mov %ax, %es
|
|
|
|
mov %ax, %fs
|
|
|
|
mov %ax, %gs
|
|
|
|
mov %ax, %ss
|
2009-11-10 23:17:15 +01:00
|
|
|
|
|
|
|
/* Turn off protection */
|
2009-04-13 20:07:02 +02:00
|
|
|
movl %cr0, %eax
|
2009-11-10 23:17:15 +01:00
|
|
|
andl $~PE, %eax
|
2009-04-13 20:07:02 +02:00
|
|
|
movl %eax, %cr0
|
2009-11-10 23:17:15 +01:00
|
|
|
|
|
|
|
/* Now really going into real mode */
|
|
|
|
ljmp $0, $RELOCATED(1f)
|
|
|
|
1:
|
2009-04-13 20:07:02 +02:00
|
|
|
movw $0x0, %ax
|
|
|
|
movw %ax, %ds
|
|
|
|
movw %ax, %es
|
|
|
|
movw %ax, %ss
|
|
|
|
movw %ax, %fs
|
|
|
|
movw %ax, %gs
|
|
|
|
|
2009-11-10 23:17:15 +01:00
|
|
|
/* This is a FAR JMP to the OS waking vector. The C code changed
|
|
|
|
* the address to be correct.
|
|
|
|
*/
|
|
|
|
.byte 0xea
|
2009-04-13 20:07:02 +02:00
|
|
|
|
2009-11-10 23:17:15 +01:00
|
|
|
__wakeup_offset = RELOCATED(.)
|
|
|
|
.word 0x0000
|
2009-04-13 20:07:02 +02:00
|
|
|
|
2009-11-10 23:17:15 +01:00
|
|
|
__wakeup_segment = RELOCATED(.)
|
|
|
|
.word 0x0000
|
2009-04-13 20:07:02 +02:00
|
|
|
|
2009-11-10 23:17:15 +01:00
|
|
|
.globl __wakeup_size
|
2013-02-08 23:56:51 +01:00
|
|
|
__wakeup_size:
|
|
|
|
.long . - __wakeup
|