Implement x86 dtrace_invop_(un)init() in C.
There is no reason for these routines to be written in assembly. In the ports of DTrace to other platforms, they are already written in C. No functional change intended. MFC after: 1 week Sponsored by: Netflix
This commit is contained in:
parent
07bf14bb72
commit
9093dd9a66
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352627
@ -149,22 +149,6 @@ bp_ret:
|
||||
|
||||
END(dtrace_invop_start)
|
||||
|
||||
/*
|
||||
void dtrace_invop_init(void)
|
||||
*/
|
||||
ENTRY(dtrace_invop_init)
|
||||
movq $dtrace_invop_start, dtrace_invop_jump_addr(%rip)
|
||||
ret
|
||||
END(dtrace_invop_init)
|
||||
|
||||
/*
|
||||
void dtrace_invop_uninit(void)
|
||||
*/
|
||||
ENTRY(dtrace_invop_uninit)
|
||||
movq $0, dtrace_invop_jump_addr(%rip)
|
||||
ret
|
||||
END(dtrace_invop_uninit)
|
||||
|
||||
/*
|
||||
greg_t dtrace_getfp(void)
|
||||
*/
|
||||
|
@ -48,8 +48,12 @@
|
||||
#include <vm/pmap.h>
|
||||
|
||||
extern void dtrace_getnanotime(struct timespec *tsp);
|
||||
extern int (*dtrace_invop_jump_addr)(struct trapframe *);
|
||||
|
||||
int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
|
||||
int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
|
||||
int dtrace_invop_start(struct trapframe *frame);
|
||||
void dtrace_invop_init(void);
|
||||
void dtrace_invop_uninit(void);
|
||||
|
||||
typedef struct dtrace_invop_hdlr {
|
||||
int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t);
|
||||
@ -109,6 +113,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t))
|
||||
kmem_free(hdlr, 0);
|
||||
}
|
||||
|
||||
void
|
||||
dtrace_invop_init(void)
|
||||
{
|
||||
|
||||
dtrace_invop_jump_addr = dtrace_invop_start;
|
||||
}
|
||||
|
||||
void
|
||||
dtrace_invop_uninit(void)
|
||||
{
|
||||
|
||||
dtrace_invop_jump_addr = NULL;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit))
|
||||
|
@ -134,22 +134,6 @@ invop_nop:
|
||||
|
||||
END(dtrace_invop_start)
|
||||
|
||||
/*
|
||||
void dtrace_invop_init(void)
|
||||
*/
|
||||
ENTRY(dtrace_invop_init)
|
||||
movl $dtrace_invop_start, dtrace_invop_jump_addr
|
||||
ret
|
||||
END(dtrace_invop_init)
|
||||
|
||||
/*
|
||||
void dtrace_invop_uninit(void)
|
||||
*/
|
||||
ENTRY(dtrace_invop_uninit)
|
||||
movl $0, dtrace_invop_jump_addr
|
||||
ret
|
||||
END(dtrace_invop_uninit)
|
||||
|
||||
/*
|
||||
greg_t dtrace_getfp(void)
|
||||
*/
|
||||
|
@ -51,8 +51,12 @@
|
||||
extern uintptr_t kernelbase;
|
||||
|
||||
extern void dtrace_getnanotime(struct timespec *tsp);
|
||||
extern int (*dtrace_invop_jump_addr)(struct trapframe *);
|
||||
|
||||
int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
|
||||
int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
|
||||
int dtrace_invop_start(struct trapframe *frame);
|
||||
void dtrace_invop_init(void);
|
||||
void dtrace_invop_uninit(void);
|
||||
|
||||
typedef struct dtrace_invop_hdlr {
|
||||
int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t);
|
||||
@ -112,6 +116,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t))
|
||||
kmem_free(hdlr, 0);
|
||||
}
|
||||
|
||||
void
|
||||
dtrace_invop_init(void)
|
||||
{
|
||||
|
||||
dtrace_invop_jump_addr = dtrace_invop_start;
|
||||
}
|
||||
|
||||
void
|
||||
dtrace_invop_uninit(void)
|
||||
{
|
||||
|
||||
dtrace_invop_jump_addr = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user