Expose breakpoint() to userland from <machine/cpufunc.h> on MIPS.

Enable ptrace() tests using breakpoint on MIPS as well.

Tested on:	mips64
MFC after:	1 month
This commit is contained in:
John Baldwin 2018-04-24 05:26:28 +00:00
parent 403e331d54
commit bd061c3998
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332907
2 changed files with 10 additions and 7 deletions

View File

@ -108,6 +108,12 @@ mips_wbflush(void)
#endif
}
static __inline void
breakpoint(void)
{
__asm __volatile ("break");
}
#ifdef _KERNEL
/*
* XXX
@ -365,12 +371,6 @@ get_intr_mask(void)
return (mips_rd_status() & MIPS_SR_INT_MASK);
}
static __inline void
breakpoint(void)
{
__asm __volatile ("break");
}
#if defined(__GNUC__) && !defined(__mips_o32)
#define mips3_ld(a) (*(const volatile uint64_t *)(a))
#define mips3_sd(a, v) (*(volatile uint64_t *)(a) = (v))

View File

@ -54,7 +54,8 @@ __FBSDID("$FreeBSD$");
/*
* Architectures with a user-visible breakpoint().
*/
#if defined(__amd64__) || defined(__i386__) || defined(__sparc64__)
#if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \
defined(__sparc64__)
#define HAVE_BREAKPOINT
#endif
@ -64,6 +65,8 @@ __FBSDID("$FreeBSD$");
#ifdef HAVE_BREAKPOINT
#if defined(__amd64__) || defined(__i386__)
#define SKIP_BREAK(reg)
#elif defined(__mips__)
#define SKIP_BREAK(reg) ((reg)->r_regs[PC] += 4)
#elif defined(__sparc64__)
#define SKIP_BREAK(reg) do { \
(reg)->r_tpc = (reg)->r_tnpc + 4; \