]> git.ipfire.org Git - thirdparty/grub.git/commit
i386/msr: Extract and improve MSR support detection code
authorDaniel Kiper <daniel.kiper@oracle.com>
Sun, 6 Oct 2024 14:14:44 +0000 (17:14 +0300)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 10 Oct 2024 11:09:06 +0000 (13:09 +0200)
commit1b1061409d8945868afac00d9308e9dd3289033d
tree00740d86de5d0fcf5f8f9fd6af4251092738c1cb
parent929fafdf5ec3bcbcb47337b187d7f2d48229e086
i386/msr: Extract and improve MSR support detection code

Currently rdmsr and wrmsr commands have own MSR support detection code.
This code is the same. So, it is duplicated. Additionally, this code
cannot be reused by others. Hence, extract this code to a function and
make it public. By the way, improve a code a bit.

Additionally, use GRUB_ERR_BAD_DEVICE instead of GRUB_ERR_BUG to signal
an error because errors encountered by this new routine are not bugs.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/i386/rdmsr.c
grub-core/commands/i386/wrmsr.c
include/grub/i386/msr.h