Export a breakpoint() function to userland for riscv.
As a result, enable tests using breakpoint() on riscv. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D15191
This commit is contained in:
parent
f2a2dfa729
commit
ca75fa17ee
@ -37,10 +37,6 @@
|
||||
#ifndef _MACHINE_CPUFUNC_H_
|
||||
#define _MACHINE_CPUFUNC_H_
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#include <machine/riscvreg.h>
|
||||
|
||||
static __inline void
|
||||
breakpoint(void)
|
||||
{
|
||||
@ -48,6 +44,10 @@ breakpoint(void)
|
||||
__asm("ebreak");
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#include <machine/riscvreg.h>
|
||||
|
||||
static __inline register_t
|
||||
intr_disable(void)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");
|
||||
* Architectures with a user-visible breakpoint().
|
||||
*/
|
||||
#if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \
|
||||
defined(__sparc64__)
|
||||
defined(__riscv) || defined(__sparc64__)
|
||||
#define HAVE_BREAKPOINT
|
||||
#endif
|
||||
|
||||
@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$");
|
||||
#define SKIP_BREAK(reg)
|
||||
#elif defined(__mips__)
|
||||
#define SKIP_BREAK(reg) ((reg)->r_regs[PC] += 4)
|
||||
#elif defined(__riscv)
|
||||
#define SKIP_BREAK(reg) ((reg)->sepc += 4)
|
||||
#elif defined(__sparc64__)
|
||||
#define SKIP_BREAK(reg) do { \
|
||||
(reg)->r_tpc = (reg)->r_tnpc + 4; \
|
||||
|
Loading…
Reference in New Issue
Block a user