HomeFreeBSD

jedec_dimm(4): Refactor offset adjustment and page0 reset

Description

jedec_dimm(4): Refactor offset adjustment and page0 reset

Offsets greater than 255 bytes reside on page1 of the SPD device.
Accessing them requires switching to page1, and adjusting the absolute
offset to be relative to the start of page1. After the access, the page
must be set back to page0. These operations are performed in several
places, so break them out into their own functions.

Also, replace a pair of default cases, which should be impossible due to
earlier checks, with __assert_unreachable().

Reviewed by: imp
MFC after: 1 week
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D39842

(cherry picked from commit 15d69c840d860a8c0decb063f768ad695427a0d4)

Details

Provenance
rpokalaAuthored on Apr 27 2023, 5:03 AM
Reviewer
imp
Differential Revision
D39842: jedec_dimm(4): Refactor offset adjustment and page0 reset
Parents
rG861fdb46300b: jedec_dimm(4): Add manufacturing year and week.
Branches
Unknown
Tags
Unknown