Bug 205424 - i386/boot: use macros from <machine/psl.h> to represent eflags's bits
Summary: i386/boot: use macros from <machine/psl.h> to represent eflags's bits
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: John Baldwin
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-12-19 06:53 UTC by Alexander Kuleshov
Modified: 2016-01-21 17:33 UTC (History)
3 users (show)

See Also:


Attachments
i386/boot: use macros from <machine/psl.h> to represent eflags's bits (13.70 KB, patch)
2015-12-19 06:53 UTC, Alexander Kuleshov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kuleshov 2015-12-19 06:53:16 UTC
Created attachment 164376 [details]
i386/boot: use macros from <machine/psl.h> to represent  eflags's bits

Hello,

Some i386/boot's source code contains some checks of the EFLAGS's bits. In
the same time the <machine/psl.h> header file provides macros which
represents these bits. Let's use human readable names instead of
numbers.

Additionally indentation fixed and empty lines removed.
Comment 1 John Baldwin freebsd_committer freebsd_triage 2015-12-21 22:32:24 UTC
The patch appears to have a lot of unrelated whitespace diffs.  Most of the i386 boot code already uses PSL_* constants via the nested include of <machine/psl.h> in btxv86.h.  In general the boot code uses V86_CY() to check the carry flag and it looks like a few places just weren't updated to use that.

I've uploaded a change that I think fixes all the stragglers.  I haven't built it yet to test though.

https://github.com/bsdjhb/freebsd/compare/boot_i386_eflags.diff
Comment 2 John Baldwin freebsd_committer freebsd_triage 2015-12-24 06:18:07 UTC
I've verified the patch builds ok and the md5 sums of the affected object files are identical (so no functional change).
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-12-24 06:23:01 UTC
A commit references this bug:

Author: jhb
Date: Thu Dec 24 06:22:42 UTC 2015
New revision: 292682
URL: https://svnweb.freebsd.org/changeset/base/292682

Log:
  Fix remaining direct tests of the carry flag in the v86 %eflags via a
  magic number to use V86_CY() instead.  These should have been fixed as
  part of the cleanup in r226746 but were missed.

  The md5 sums of the object files were unchanged, so there should be no
  functional change.

  PR:		205424
  Submitted by:	Alexander Kuleshov <kuleshovmail@gmail.com>
  MFC after:	1 week

Changes:
  head/sys/boot/i386/zfsboot/zfsboot.c
  head/sys/boot/pc98/boot2/boot2.c
  head/sys/boot/pc98/libpc98/biosdisk.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-01-21 01:26:09 UTC
A commit references this bug:

Author: jhb
Date: Thu Jan 21 01:25:28 UTC 2016
New revision: 294480
URL: https://svnweb.freebsd.org/changeset/base/294480

Log:
  MFC 292682:
  Fix remaining direct tests of the carry flag in the v86 %eflags via a
  magic number to use V86_CY() instead.  These should have been fixed as
  part of the cleanup in r226746 but were missed.

  The md5 sums of the object files were unchanged, so there should be no
  functional change.

  PR:		205424
  Submitted by:	Alexander Kuleshov <kuleshovmail@gmail.com>

Changes:
_U  stable/10/
  stable/10/sys/boot/i386/zfsboot/zfsboot.c
  stable/10/sys/boot/pc98/boot2/boot2.c
  stable/10/sys/boot/pc98/libpc98/biosdisk.c