2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2017-01-16 14:03:58 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2016 Google, Inc
|
|
|
|
* Written by Simon Glass <sjg@chromium.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2019-11-14 19:57:41 +00:00
|
|
|
#include <irq_func.h>
|
2017-01-16 14:03:58 +00:00
|
|
|
#include <asm/processor-flags.h>
|
|
|
|
|
|
|
|
void enable_interrupts(void)
|
|
|
|
{
|
|
|
|
asm("sti\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
int disable_interrupts(void)
|
|
|
|
{
|
|
|
|
long flags;
|
|
|
|
|
|
|
|
asm volatile ("pushfq ; popq %0 ; cli\n" : "=g" (flags) : );
|
|
|
|
|
|
|
|
return flags & X86_EFLAGS_IF;
|
|
|
|
}
|
|
|
|
|
|
|
|
int interrupt_init(void)
|
|
|
|
{
|
|
|
|
/* Nothing to do - this was already done in SPL */
|
|
|
|
return 0;
|
|
|
|
}
|