blob: 244f7fd15eba3d0350796de67c834becab2386ea [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
Tom Rinicee346c2023-10-12 19:03:57 -040010#include <log.h>
11#include <vsprintf.h>
Michal Simek77a1e242007-05-07 17:22:25 +020012#include <asm/asm.h>
Michal Simek922ce202007-03-11 13:48:24 +010013
Michal Simek8b4bb3a2012-06-29 13:27:28 +020014void enable_interrupts(void)
wdenk12490652004-04-18 21:13:41 +000015{
Michal Simek056dbe82015-01-26 15:25:32 +010016 debug("Enable interrupts for the whole CPU\n");
Michal Simek98c19792007-05-07 23:58:31 +020017 MSRSET(0x2);
wdenk12490652004-04-18 21:13:41 +000018}
19
Michal Simek8b4bb3a2012-06-29 13:27:28 +020020int disable_interrupts(void)
wdenk12490652004-04-18 21:13:41 +000021{
Michal Simekc94f95e2010-12-21 08:30:39 +010022 unsigned int msr;
23
24 MFS(msr, rmsr);
Michal Simek98c19792007-05-07 23:58:31 +020025 MSRCLR(0x2);
Michal Simekc94f95e2010-12-21 08:30:39 +010026 return (msr & 0x2) != 0;
wdenk12490652004-04-18 21:13:41 +000027}
Michal Simek922ce202007-03-11 13:48:24 +010028
Michal Simekb78df3d2015-01-27 12:44:12 +010029int interrupt_init(void)
Michal Simek922ce202007-03-11 13:48:24 +010030{
Michal Simek922ce202007-03-11 13:48:24 +010031 return 0;
32}
33
Michal Simek8b4bb3a2012-06-29 13:27:28 +020034void interrupt_handler(void)
Michal Simek922ce202007-03-11 13:48:24 +010035{
Michal Simek3ebef532022-06-24 14:16:32 +020036 panic("Interrupt occurred\n");
Michal Simek922ce202007-03-11 13:48:24 +010037}