Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 1996 05:37:19 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bugs@freebsd.org, hosokawa@mt.cs.keio.ac.jp
Subject:   Re: type of dk_flags (wd.c) should be longer
Message-ID:  <199610211937.FAA26416@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>In sys/i386/isa/wd.c:
>
>        short   dk_flags;       /* drive characteristics found */
>#define DKFL_SINGLE     0x00004 /* sector at a time mode */
>#define DKFL_ERROR      0x00008 /* processing a disk error */
>#define DKFL_LABELLING  0x00080 /* readdisklabel() in progress */
>#define DKFL_32BIT      0x00100 /* use 32-bit i/o mode */
>#define DKFL_MULTI      0x00200 /* use multi-i/o mode */
>#define DKFL_BADSCAN    0x00400 /* report all errors */
>
>It seems bit operation to dk_flags results in invalid behavior.  I
>think that the type of dk_flags should be longer (ex. long).

Erm, 0x400 fits in only 11 bits.  Perhaps dk_flags should be `int'
since accesses to shorts are slow.  It doesn't matter much, because
most accesses are optimized to byte accesses (and those that aren't
are pessimizations - (du->dk_flags & BIT) is optimized to a testb
inctruction, and (du->dk_flags |= BIT) is pessimized to an orw
instruction).

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610211937.FAA26416>