blob: 634f7660c03f9e9fa472a512f846afaa1871a506 [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
7#include <common.h>
Simon Glass9b61c7c2019-11-14 12:57:41 -07008#include <irq_func.h>
Simon Glassefedba72017-01-16 07:03:58 -07009#include <asm/processor-flags.h>
10
11void enable_interrupts(void)
12{
13 asm("sti\n");
14}
15
16int 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
25int interrupt_init(void)
26{
27 /* Nothing to do - this was already done in SPL */
28 return 0;
29}