xref: /openbmc/u-boot/arch/x86/cpu/x86_64/interrupts.c (revision 9d922450)
1 /*
2  * (C) Copyright 2016 Google, Inc
3  * Written by Simon Glass <sjg@chromium.org>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #include <common.h>
9 #include <asm/processor-flags.h>
10 
11 void enable_interrupts(void)
12 {
13 	asm("sti\n");
14 }
15 
16 int disable_interrupts(void)
17 {
18 	long flags;
19 
20 	asm volatile ("pushfq ; popq %0 ; cli\n" : "=g" (flags) : );
21 
22 	return flags & X86_EFLAGS_IF;
23 }
24 
25 int interrupt_init(void)
26 {
27 	/* Nothing to do - this was already done in SPL */
28 	return 0;
29 }
30