Changeset 46ec2c06 in mainline for pci


Ignore:
Timestamp:
2006-05-11T16:08:50Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7981e3cc
Parents:
20a9b85
Message:

SYS_AS_AREA_DESTROY support for uspace.

Formatting fixes in libpci.

Location:
pci/libpci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pci/libpci/access.c

    r20a9b85 r46ec2c06  
    2626        int i;
    2727
     28        if (!a)
     29                return NULL;
     30               
    2831        bzero(a, sizeof(*a));
    2932        for (i = 0; i < PCI_ACCESS_MAX; i++)
     
    3841
    3942        if (!x)
    40                 a->error("Out of memory (allocation of %d bytes failed)",
    41                          size);
     43                a->error("Out of memory (allocation of %d bytes failed)", size);
    4244        return x;
    4345}
     
    219221{
    220222        if (pos & (len - 1))
    221                 d->access->error("Unaligned write: pos=%02x,len=%d", pos,
    222                                  len);
     223                d->access->error("Unaligned write: pos=%02x,len=%d", pos, len);
    223224        if (pos + len <= d->cache_len)
    224225                memcpy(d->cache + pos, buf, len);
     
    246247{
    247248        if (pos < d->cache_len) {
    248                 int l =
    249                     (pos + len >=
    250                      d->cache_len) ? (d->cache_len - pos) : len;
     249                int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len;
    251250                memcpy(d->cache + pos, buf, l);
    252251        }
     
    261260        }
    262261        if (flags & ~d->known_fields)
    263                 d->known_fields |=
    264                     d->methods->fill_info(d, flags & ~d->known_fields);
     262                d->known_fields |= d->methods->fill_info(d, flags & ~d->known_fields);
    265263        return d->known_fields;
    266264}
  • pci/libpci/i386-ports.c

    r20a9b85 r46ec2c06  
    8080        for (d.dev = 0; d.dev < 32; d.dev++) {
    8181                u16 class, vendor;
    82                 if (m->
    83                     read(&d, PCI_CLASS_DEVICE, (byte *) & class,
     82                if (m->read(&d, PCI_CLASS_DEVICE, (byte *) & class,
    8483                         sizeof(class))
    8584                    && (class == cpu_to_le16(PCI_CLASS_BRIDGE_HOST)
     
    179178{
    180179        /* This is ugly and tends to produce false positives. Beware. */
    181 
    182180        outb(0x00, 0xCFB);
    183181        outb(0x00, 0xCF8);
     
    227225
    228226        if (d->dev >= 16)
    229                 d->access->
    230                     error("conf2_write: only first 16 devices exist.");
     227                d->access->error("conf2_write: only first 16 devices exist.");
    231228        outb((d->func << 1) | 0xf0, 0xcf8);
    232229        outb(d->bus, 0xcfa);
Note: See TracChangeset for help on using the changeset viewer.