1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#include <sel4/sel4.h> 14#include <sel4debug/user_exception.h> 15 16void debug_user_exception_message(int (*printfn)(const char *format, ...), 17 seL4_Word* mrs) 18{ 19 /* See section 5.2.3 of the manual. */ 20 printfn(" PC = %p\n" 21 " SP = %p\n" 22 " CPSR = %p\n" 23 " exception number = %p\n" 24 " exception code = %p\n", 25 (void*)mrs[0], (void*)mrs[1], (void*)mrs[2], (void*)mrs[3], 26 (void*)mrs[4]); 27} 28