1f24307deSSoby Mathew/* 2f24307deSSoby Mathew * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3f24307deSSoby Mathew * 4f24307deSSoby Mathew * Redistribution and use in source and binary forms, with or without 5f24307deSSoby Mathew * modification, are permitted provided that the following conditions are met: 6f24307deSSoby Mathew * 7f24307deSSoby Mathew * Redistributions of source code must retain the above copyright notice, this 8f24307deSSoby Mathew * list of conditions and the following disclaimer. 9f24307deSSoby Mathew * 10f24307deSSoby Mathew * Redistributions in binary form must reproduce the above copyright notice, 11f24307deSSoby Mathew * this list of conditions and the following disclaimer in the documentation 12f24307deSSoby Mathew * and/or other materials provided with the distribution. 13f24307deSSoby Mathew * 14f24307deSSoby Mathew * Neither the name of ARM nor the names of its contributors may be used 15f24307deSSoby Mathew * to endorse or promote products derived from this software without specific 16f24307deSSoby Mathew * prior written permission. 17f24307deSSoby Mathew * 18f24307deSSoby Mathew * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19f24307deSSoby Mathew * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20f24307deSSoby Mathew * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21f24307deSSoby Mathew * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22f24307deSSoby Mathew * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23f24307deSSoby Mathew * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24f24307deSSoby Mathew * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25f24307deSSoby Mathew * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26f24307deSSoby Mathew * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27f24307deSSoby Mathew * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28f24307deSSoby Mathew * POSSIBILITY OF SUCH DAMAGE. 29f24307deSSoby Mathew */ 30f24307deSSoby Mathew 31f24307deSSoby Mathew#include <arch.h> 32f24307deSSoby Mathew#include <asm_macros.S> 33f24307deSSoby Mathew 34f24307deSSoby Mathew .globl do_panic 35*1a0a3f06SYatharth Kochar .globl report_exception 36f24307deSSoby Mathew 37f24307deSSoby Mathew /*********************************************************** 38f24307deSSoby Mathew * The common implementation of do_panic for all BL stages 39f24307deSSoby Mathew ***********************************************************/ 40f24307deSSoby Mathewfunc do_panic 41f24307deSSoby Mathew b plat_panic_handler 42f24307deSSoby Mathewendfunc do_panic 43f24307deSSoby Mathew 44*1a0a3f06SYatharth Kochar /*********************************************************** 45*1a0a3f06SYatharth Kochar * This function is called from the vector table for 46*1a0a3f06SYatharth Kochar * unhandled exceptions. It reads the current mode and 47*1a0a3f06SYatharth Kochar * passes it to platform. 48*1a0a3f06SYatharth Kochar ***********************************************************/ 49*1a0a3f06SYatharth Kocharfunc report_exception 50*1a0a3f06SYatharth Kochar mrs r0, cpsr 51*1a0a3f06SYatharth Kochar and r0, #MODE32_MASK 52*1a0a3f06SYatharth Kochar bl plat_report_exception 53*1a0a3f06SYatharth Kochar bl plat_panic_handler 54*1a0a3f06SYatharth Kocharendfunc report_exception 55