^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * PA-RISC KGDB support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2019 Sven Schnelle <svens@stackframe.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef __PARISC_KGDB_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define __PARISC_KGDB_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define BREAK_INSTR_SIZE 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define PARISC_KGDB_COMPILED_BREAK_INSN 0x3ffc01f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define PARISC_KGDB_BREAK_INSN 0x3ffa01f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define NUMREGBYTES sizeof(struct parisc_gdb_regs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define BUFMAX 4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define CACHE_FLUSH_IS_SAFE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #ifndef __ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) static inline void arch_kgdb_breakpoint(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) asm(".word %0" : : "i"(PARISC_KGDB_COMPILED_BREAK_INSN) : "memory");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct parisc_gdb_regs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) unsigned long gpr[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) unsigned long sar;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) unsigned long iaoq_f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) unsigned long iasq_f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) unsigned long iaoq_b;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) unsigned long iasq_b;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unsigned long eiem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) unsigned long iir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) unsigned long isr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) unsigned long ior;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unsigned long ipsw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) unsigned long __unused0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned long sr4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) unsigned long sr0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) unsigned long sr1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) unsigned long sr2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) unsigned long sr3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) unsigned long sr5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) unsigned long sr6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) unsigned long sr7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) unsigned long cr0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) unsigned long pid1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) unsigned long pid2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) unsigned long scrccr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) unsigned long pid3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) unsigned long pid4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) unsigned long cr24;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) unsigned long cr25;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) unsigned long cr26;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) unsigned long cr27;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) unsigned long cr28;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) unsigned long cr29;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) unsigned long cr30;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) u64 fr[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #endif