Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156653210
D50903.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50903.diff
View Options
diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c
--- a/sys/arm64/arm64/exec_machdep.c
+++ b/sys/arm64/arm64/exec_machdep.c
@@ -191,17 +191,27 @@
fill_dbregs(struct thread *td, struct dbreg *regs)
{
struct debug_monitor_state *monitor;
+ uint64_t dfr0;
int i;
uint8_t debug_ver, nbkpts, nwtpts;
memset(regs, 0, sizeof(*regs));
- extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_DebugVer_SHIFT,
- &debug_ver);
- extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_BRPs_SHIFT,
- &nbkpts);
- extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_WRPs_SHIFT,
- &nwtpts);
+ /*
+ * Read these the Debug Feature Register 0 to get info we need.
+ * It will be identical on FreeBSD and Linux, so there is no need
+ * to check which the target is.
+ */
+ if (!get_user_reg(ID_AA64DFR0_EL1, &dfr0, true)) {
+ debug_ver = ID_AA64DFR0_DebugVer_8;
+ nbkpts = 0;
+ nwtpts = 0;
+ } else {
+ debug_ver = ID_AA64DFR0_DebugVer_VAL(dfr0) >>
+ ID_AA64DFR0_DebugVer_SHIFT;
+ nbkpts = ID_AA64DFR0_BRPs_VAL(dfr0) >> ID_AA64DFR0_BRPs_SHIFT;
+ nwtpts = ID_AA64DFR0_WRPs_VAL(dfr0) >> ID_AA64DFR0_WRPs_SHIFT;
+ }
/*
* The BRPs field contains the number of breakpoints - 1. Armv8-A
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 10:28 AM (5 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33126736
Default Alt Text
D50903.diff (1 KB)
Attached To
Mode
D50903: arm64: Switch to get_user_reg in fill_dbregs
Attached
Detach File
Event Timeline
Log In to Comment