Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | b8605a1 | 2011-10-03 19:26:37 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2011 The Chromium OS Authors. |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
Simon Glass | b8605a1 | 2011-10-03 19:26:37 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
Heinrich Schuchardt | b46f30a | 2020-11-12 00:29:56 +0100 | [diff] [blame] | 9 | #include <efi_loader.h> |
Simon Glass | c30b7ad | 2019-11-14 12:57:41 -0700 | [diff] [blame] | 10 | #include <irq_func.h> |
Heinrich Schuchardt | b46f30a | 2020-11-12 00:29:56 +0100 | [diff] [blame] | 11 | #include <os.h> |
| 12 | #include <asm-generic/signal.h> |
| 13 | #include <asm/u-boot-sandbox.h> |
| 14 | |
| 15 | DECLARE_GLOBAL_DATA_PTR; |
Simon Glass | b8605a1 | 2011-10-03 19:26:37 +0000 | [diff] [blame] | 16 | |
| 17 | int interrupt_init(void) |
| 18 | { |
| 19 | return 0; |
| 20 | } |
| 21 | |
| 22 | void enable_interrupts(void) |
| 23 | { |
| 24 | return; |
| 25 | } |
| 26 | int disable_interrupts(void) |
| 27 | { |
| 28 | return 0; |
| 29 | } |
Heinrich Schuchardt | b46f30a | 2020-11-12 00:29:56 +0100 | [diff] [blame] | 30 | |
| 31 | void os_signal_action(int sig, unsigned long pc) |
| 32 | { |
| 33 | efi_restore_gd(); |
| 34 | |
| 35 | switch (sig) { |
| 36 | case SIGILL: |
| 37 | printf("\nIllegal instruction\n"); |
| 38 | break; |
| 39 | case SIGBUS: |
| 40 | printf("\nBus error\n"); |
| 41 | break; |
| 42 | case SIGSEGV: |
| 43 | printf("\nSegmentation violation\n"); |
| 44 | break; |
| 45 | default: |
| 46 | break; |
| 47 | } |
| 48 | printf("pc = 0x%lx, ", pc); |
| 49 | printf("pc_reloc = 0x%lx\n\n", pc - gd->reloc_off); |
| 50 | efi_print_image_infos((void *)pc); |
| 51 | |
| 52 | if (IS_ENABLED(CONFIG_SANDBOX_CRASH_RESET)) { |
| 53 | printf("resetting ...\n\n"); |
| 54 | sandbox_reset(); |
| 55 | } else { |
| 56 | sandbox_exit(); |
| 57 | } |
| 58 | } |