interrupts.c 464 B

1234567891011121314151617181920212223242526272829
  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. #include <common.h>
  8. #include <asm/processor-flags.h>
  9. void enable_interrupts(void)
  10. {
  11. asm("sti\n");
  12. }
  13. int disable_interrupts(void)
  14. {
  15. long flags;
  16. asm volatile ("pushfq ; popq %0 ; cli\n" : "=g" (flags) : );
  17. return flags & X86_EFLAGS_IF;
  18. }
  19. int interrupt_init(void)
  20. {
  21. /* Nothing to do - this was already done in SPL */
  22. return 0;
  23. }