aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/lib/acpi_s3.c
blob: f679c06deb89e051a425a3e5d89a3cc3065a07d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#include <common.h>
#include <asm/acpi_s3.h>
#include <asm/post.h>

static void asmlinkage (*acpi_do_wakeup)(void *vector) = (void *)WAKEUP_BASE;

static void acpi_jump_to_wakeup(void *vector)
{
	/* Copy wakeup trampoline in place */
	memcpy((void *)WAKEUP_BASE, __wakeup, __wakeup_size);

	printf("Jumping to OS waking vector %p\n", vector);
	acpi_do_wakeup(vector);
}

void acpi_resume(void *wake_vec)
{
	post_code(POST_OS_RESUME);
	acpi_jump_to_wakeup(wake_vec);
}