summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/reboot.c
blob: 81bf925f70f5115b23cae28d2398ae9b3c38152a (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) 2014 Intel Corporation; author Matt Fleming
 * Copyright (c) 2014 Red Hat, Inc., Mark Salter <msalter@redhat.com>
 */
#include <linux/efi.h>
#include <linux/reboot.h>

void efi_reboot(enum reboot_mode reboot_mode, const char *__unused)
{
	int efi_mode;

	if (!efi_enabled(EFI_RUNTIME_SERVICES))
		return;

	switch (reboot_mode) {
	case REBOOT_WARM:
	case REBOOT_SOFT:
		efi_mode = EFI_RESET_WARM;
		break;
	default:
		efi_mode = EFI_RESET_COLD;
		break;
	}

	efi.reset_system(efi_mode, EFI_SUCCESS, 0, NULL);
}