On Thu, May 27, 2021 at 09:25:01AM -0300, Heitor Alves de Siqueira wrote: > We should disable NMIs when accessing CMOS ports during state restore, > like it's done during state backup in call32_prep(). > > Signed-off-by: Heitor Alves de Siqueira <hal...@canonical.com> > --- > src/stacks.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/stacks.c b/src/stacks.c > index 2fe1bfbd64fd..e315066d52e8 100644 > --- a/src/stacks.c > +++ b/src/stacks.c > @@ -107,7 +107,7 @@ call32_post(void) > // Restore cmos index register > u8 cmosindex = GET_LOW(Call16Data.cmosindex); > if (!(cmosindex & NMI_DISABLE_BIT)) { > - outb(cmosindex, PORT_CMOS_INDEX); > + outb(cmosindex | NMI_DISABLE_BIT, PORT_CMOS_INDEX); > inb(PORT_CMOS_DATA); > }
The purpose of this code is to restore the NMI_DISABLE_BIT to what it was prior to call32_prep(). If something calls the bios without the NMI_DISABLE_BIT set, it's this code that makes sure SeaBIOS returns to that calling code with NMI_DISABLE_BIT also not set. If you've run into some bug, I think it would help if you could further describe that bug. Cheers, -Kevin _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org