blob: b84ff798814edc0849b64c8b2bb3fda90b3adf9b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Simon Glassefedba72017-01-16 07:03:58 -07002/*
3 * (C) Copyright 2016 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
Simon Glassefedba72017-01-16 07:03:58 -07005 */
6
Simon Glass9b61c7c2019-11-14 12:57:41 -07007#include <irq_func.h>
Simon Glassefedba72017-01-16 07:03:58 -07008#include <asm/processor-flags.h>
9
10void enable_interrupts(void)
11{
12 asm("sti\n");
13}
14
15int disable_interrupts(void)
16{
17 long flags;
18
19 asm volatile ("pushfq ; popq %0 ; cli\n" : "=g" (flags) : );
20
21 return flags & X86_EFLAGS_IF;
22}
23
24int interrupt_init(void)
25{
26 /* Nothing to do - this was already done in SPL */
27 return 0;
28}