Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hal/ia32: Rename dr4 and dr5 to dr6 and dr7 #414

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Conversation

astalke
Copy link
Contributor

@astalke astalke commented Jul 11, 2023

Description

Debug registers DR4 and DR5 are reserved when debug extensions are
enabled (when the DE flag in control register CR4 is set) and attempts
to reference the DR4 and DR5 registers cause invalid-opcode exceptions
(#UD). When debug extensions are not enabled (the DE flag is clear),
these registers are aliased to debug registers DR6 and DR7

JIRA: RTOS-307

Motivation and Context

The change is required for the system to work on some hardware.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: ia32-generic-pc

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Copy link
Contributor

@gerard5 gerard5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to commit message the following e.g.:
Debug registers DR4 and DR5 are reserved when debug extensions are
enabled (when the DE flag in control register CR4 is set) and attempts
to reference the DR4 and DR5 registers cause invalid-opcode exceptions
(#UD). When debug extensions are not enabled (the DE flag is clear),
these registers are aliased to debug registers DR6 and DR7

Or even better as comment in the code, in exceptions.h (may be short as in the PR description).

Debug registers DR4 and DR5 are reserved when debug extensions are
enabled (when the DE flag in control register CR4 is set) and attempts
to reference the DR4 and DR5 registers cause invalid-opcode exceptions
(#UD). When debug extensions are not enabled (the DE flag is clear),
these registers are aliased to debug registers DR6 and DR7

JIRA: RTOS-307
@astalke
Copy link
Contributor Author

astalke commented Jul 11, 2023

Add to commit message the following e.g.: Debug registers DR4 and DR5 are reserved when debug extensions are enabled (when the DE flag in control register CR4 is set) and attempts to reference the DR4 and DR5 registers cause invalid-opcode exceptions (#UD). When debug extensions are not enabled (the DE flag is clear), these registers are aliased to debug registers DR6 and DR7

Or even better as comment in the code, in exceptions.h

Done

@astalke astalke requested a review from gerard5 July 11, 2023 11:43
Copy link
Contributor

@gerard5 gerard5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@agkaminski agkaminski merged commit 93a1bf1 into master Jul 11, 2023
24 checks passed
@agkaminski agkaminski deleted the astalke/RTOS-307 branch July 11, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants