Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/include/cpufunc.h
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <machine/armreg.h> | #include <machine/armreg.h> | ||||
static __inline void | static __inline void | ||||
breakpoint(void) | breakpoint(void) | ||||
{ | { | ||||
__asm(".word 0xe7ffffff"); | __asm("udf 0xffff"); | ||||
} | } | ||||
struct cpu_functions { | struct cpu_functions { | ||||
/* CPU functions */ | /* CPU functions */ | ||||
#if __ARM_ARCH < 6 | #if __ARM_ARCH < 6 | ||||
void (*cf_cpwait) (void); | void (*cf_cpwait) (void); | ||||
▲ Show 20 Lines • Show All 423 Lines • ▼ Show 20 Lines | |||||
extern int arm_pcache_unified; | extern int arm_pcache_unified; | ||||
extern int arm_dcache_align; | extern int arm_dcache_align; | ||||
extern int arm_dcache_align_mask; | extern int arm_dcache_align_mask; | ||||
extern u_int arm_cache_level; | extern u_int arm_cache_level; | ||||
extern u_int arm_cache_loc; | extern u_int arm_cache_loc; | ||||
extern u_int arm_cache_type[14]; | extern u_int arm_cache_type[14]; | ||||
#else /* !_KERNEL */ | |||||
static __inline void | |||||
breakpoint(void) | |||||
{ | |||||
/* | |||||
* This matches the instruction used by GDB for software | |||||
* breakpoints. | |||||
*/ | |||||
__asm("udf 0xfdee"); | |||||
} | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* _MACHINE_CPUFUNC_H_ */ | #endif /* _MACHINE_CPUFUNC_H_ */ | ||||
/* End of cpufunc.h */ | /* End of cpufunc.h */ | ||||
andrew: What instruction is this? You might also be able to use the `.inst` directive here. | |||||
Not Done Inline ActionsThis matches GDB5_BREAKPOINT from sys/arm/include/trap.h and it is what GDB uses as the default breakpoint instructions for non-thumb arm: https://github.com/bsdjhb/gdb/blob/master/gdb/arm-tdep.c#L7761 The in-kernel breakpoint() uses .word with the value of KERNEL_BREAKPOINT and I just used that as my template. jhb: This matches GDB5_BREAKPOINT from sys/arm/include/trap.h and it is what GDB uses as the default… | |||||
Not Done Inline ActionsIt seems to be udf 0xfdee. udf is an instruction that raises the undefined instruction exception. andrew: It seems to be `udf 0xfdee`. `udf` is an instruction that raises the undefined instruction… | |||||
Not Done Inline ActionsPerhaps a comment with that reference? emaste: Perhaps a comment with that reference? |
What instruction is this? You might also be able to use the .inst directive here.