summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-06 19:21:02 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-06 19:21:02 +0000
commit1131240d0208e88db7443d57c195360584929c66 (patch)
treeace69903599a4ed253cbd01b563b52052b8dd76b /util
parent72caa5f8920604e9af8cebf5d786a1ee880e7b51 (diff)
util/nvmutil: made a comment a bit clearer
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index f6fd591d..6b2528f5 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -449,11 +449,14 @@ set_mac_nib(int mac_pos, int nib)
h = (h & 0xE) | 2; /* local, unicast */
/*
- * The word is stored big-endian in the file.
- * Logically in C, it is stored little-endian,
- * because of how we load in read_gbe(), so
- * we store the MAC address in reverse order
- * per 2-byte word (there are 3 of these).
+ * Words other than the MAC address are stored little
+ * endian in the file, and we handle that when reading.
+ * However, MAC address words are stored big-endian
+ * in that file, so we write each 2-byte word logically
+ * in little-endian order, which on little-endian would
+ * be stored big-endian in memory, and vice versa.
+ *
+ * Later code using the MAC string will handle this.
*/
shift = (byte & 1) << 3; /* left or right byte? */
shift |= (nib ^ 1) << 2; /* left or right nib? */