aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/pci
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:23 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:23 -0700
commit2987130d1052046f1c498ed03c213fe265c7b636 (patch)
tree79da2661dde93e6775f98456075dd9777e32c0f0 /com32/lib/pci
parent8dd5319ae7d9186efd44b328766c969786559751 (diff)
downloadsyslinux.git-2987130d1052046f1c498ed03c213fe265c7b636.tar.gz
syslinux.git-2987130d1052046f1c498ed03c213fe265c7b636.tar.xz
syslinux.git-2987130d1052046f1c498ed03c213fe265c7b636.zip
Run Nindent on com32/lib/pci/cfgtype.c
Automatically reformat com32/lib/pci/cfgtype.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib/pci')
-rw-r--r--com32/lib/pci/cfgtype.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/com32/lib/pci/cfgtype.c b/com32/lib/pci/cfgtype.c
index 97215d42..896f7e5e 100644
--- a/com32/lib/pci/cfgtype.c
+++ b/com32/lib/pci/cfgtype.c
@@ -6,84 +6,84 @@ enum pci_config_type __pci_cfg_type;
static int type1_ok(void)
{
- uint32_t oldcf8, newcf8;
+ uint32_t oldcf8, newcf8;
- /* Test for Configuration Method #1 */
+ /* Test for Configuration Method #1 */
- /* Note: XFree86 writes ~0 and expects to read back 0x80fffffc. Linux
- does this less severe test; go with Linux. */
+ /* Note: XFree86 writes ~0 and expects to read back 0x80fffffc. Linux
+ does this less severe test; go with Linux. */
- cli();
- outb(1, 0xcfb); /* For old Intel chipsets */
- oldcf8 = inl(0xcf8);
- outl(0x80000000, 0xcf8);
- newcf8 = inl(0xcf8);
- outl(oldcf8, 0xcf8);
- sti();
+ cli();
+ outb(1, 0xcfb); /* For old Intel chipsets */
+ oldcf8 = inl(0xcf8);
+ outl(0x80000000, 0xcf8);
+ newcf8 = inl(0xcf8);
+ outl(oldcf8, 0xcf8);
+ sti();
- return newcf8 == 0x80000000;
+ return newcf8 == 0x80000000;
}
static int type2_ok(void)
{
- uint8_t oldcf8, oldcfa;
- uint8_t cf8, cfa;
+ uint8_t oldcf8, oldcfa;
+ uint8_t cf8, cfa;
- /* Test for Configuration Method #2 */
+ /* Test for Configuration Method #2 */
- /* CM#2 is hard to probe for, but let's do our best... */
+ /* CM#2 is hard to probe for, but let's do our best... */
- cli();
- outb(0, 0xcfb); /* For old Intel chipsets */
- oldcf8 = inb(0xcf8);
- outb(0, 0xcf8);
- oldcfa = inb(0xcfa);
- outb(0, 0xcfa);
+ cli();
+ outb(0, 0xcfb); /* For old Intel chipsets */
+ oldcf8 = inb(0xcf8);
+ outb(0, 0xcf8);
+ oldcfa = inb(0xcfa);
+ outb(0, 0xcfa);
- cf8 = inb(0xcf8);
- cfa = inb(0xcfa);
+ cf8 = inb(0xcf8);
+ cfa = inb(0xcfa);
- outb(oldcf8, 0xcf8);
- outb(oldcfa, 0xcfa);
- sti();
+ outb(oldcf8, 0xcf8);
+ outb(oldcfa, 0xcfa);
+ sti();
- return cf8 == 0 && cfa == 0;
+ return cf8 == 0 && cfa == 0;
}
int pci_set_config_type(enum pci_config_type type)
{
- static const com32sys_t ireg = {
- .eax.l = 0xb101,
- .edi.l = 0,
- .eflags.l = EFLAGS_CF,
- };
- com32sys_t oreg;
-
- if ( type == PCI_CFG_AUTO ) {
- type = PCI_CFG_NONE;
-
- /* Try to detect PCI BIOS */
- __intcall(0x1a, &ireg, &oreg);
-
- if ( !(oreg.eflags.l & EFLAGS_CF) &&
- oreg.eax.b[1] == 0 && oreg.edx.l == 0x20494250 ) {
- /* PCI BIOS present. Use direct access if we know how to do it. */
-
- if ( (oreg.eax.b[0] & 1) && type1_ok() )
- type = PCI_CFG_TYPE1;
- else if ( (oreg.eax.b[0] & 2) && type2_ok() )
- type = PCI_CFG_TYPE2;
- else
- type = PCI_CFG_BIOS; /* Use BIOS calls as fallback */
-
- } else if ( type1_ok() ) {
- type = PCI_CFG_TYPE1;
- } else if ( type2_ok() ) {
- type = PCI_CFG_TYPE2;
- } else {
- type = PCI_CFG_NONE; /* Badness... */
+ static const com32sys_t ireg = {
+ .eax.l = 0xb101,
+ .edi.l = 0,
+ .eflags.l = EFLAGS_CF,
+ };
+ com32sys_t oreg;
+
+ if (type == PCI_CFG_AUTO) {
+ type = PCI_CFG_NONE;
+
+ /* Try to detect PCI BIOS */
+ __intcall(0x1a, &ireg, &oreg);
+
+ if (!(oreg.eflags.l & EFLAGS_CF) &&
+ oreg.eax.b[1] == 0 && oreg.edx.l == 0x20494250) {
+ /* PCI BIOS present. Use direct access if we know how to do it. */
+
+ if ((oreg.eax.b[0] & 1) && type1_ok())
+ type = PCI_CFG_TYPE1;
+ else if ((oreg.eax.b[0] & 2) && type2_ok())
+ type = PCI_CFG_TYPE2;
+ else
+ type = PCI_CFG_BIOS; /* Use BIOS calls as fallback */
+
+ } else if (type1_ok()) {
+ type = PCI_CFG_TYPE1;
+ } else if (type2_ok()) {
+ type = PCI_CFG_TYPE2;
+ } else {
+ type = PCI_CFG_NONE; /* Badness... */
+ }
}
- }
- return (__pci_cfg_type = type);
+ return (__pci_cfg_type = type);
}