blob: ac53208bda679b2b5e53c7b3c1c773b71723f1db [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
wdenk12490652004-04-18 21:13:41 +00002/*
Michal Simek922ce202007-03-11 13:48:24 +01003 * (C) Copyright 2007 Michal Simek
wdenk12490652004-04-18 21:13:41 +00004 * (C) Copyright 2004 Atmark Techno, Inc.
5 *
Michal Simek922ce202007-03-11 13:48:24 +01006 * Michal SIMEK <monstr@monstr.eu>
wdenk12490652004-04-18 21:13:41 +00007 * Yasushi SHOJI <yashi@atmark-techno.com>
wdenk12490652004-04-18 21:13:41 +00008 */
9
Michal Simek922ce202007-03-11 13:48:24 +010010#include <common.h>
Michal Simek77a1e242007-05-07 17:22:25 +020011#include <asm/asm.h>
Michal Simek922ce202007-03-11 13:48:24 +010012
Michal Simek8b4bb3a2012-06-29 13:27:28 +020013void enable_interrupts(void)
wdenk12490652004-04-18 21:13:41 +000014{
Michal Simek056dbe82015-01-26 15:25:32 +010015 debug("Enable interrupts for the whole CPU\n");
Michal Simek98c19792007-05-07 23:58:31 +020016 MSRSET(0x2);
wdenk12490652004-04-18 21:13:41 +000017}
18
Michal Simek8b4bb3a2012-06-29 13:27:28 +020019int disable_interrupts(void)
wdenk12490652004-04-18 21:13:41 +000020{
Michal Simekc94f95e2010-12-21 08:30:39 +010021 unsigned int msr;
22
23 MFS(msr, rmsr);
Michal Simek98c19792007-05-07 23:58:31 +020024 MSRCLR(0x2);
Michal Simekc94f95e2010-12-21 08:30:39 +010025 return (msr & 0x2) != 0;
wdenk12490652004-04-18 21:13:41 +000026}
Michal Simek922ce202007-03-11 13:48:24 +010027
Michal Simekb78df3d2015-01-27 12:44:12 +010028int interrupt_init(void)
Michal Simek922ce202007-03-11 13:48:24 +010029{
Michal Simek922ce202007-03-11 13:48:24 +010030 return 0;
31}
32
Michal Simek8b4bb3a2012-06-29 13:27:28 +020033void interrupt_handler(void)
Michal Simek922ce202007-03-11 13:48:24 +010034{
Michal Simek3ebef532022-06-24 14:16:32 +020035 panic("Interrupt occurred\n");
Michal Simek922ce202007-03-11 13:48:24 +010036}