Changeset 992b47ea in mainline


Ignore:
Timestamp:
2011-10-28T10:49:00Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cb94e69b
Parents:
1d53a78
Message:

pci: Move hw_resources to pci_fun_t structure.

Maximum number of resources is static no need to malloc the space.

Location:
uspace/drv/bus/pci/pciintel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/pci/pciintel/pci.c

    r1d53a78 r992b47ea  
    766766bool pci_alloc_resource_list(pci_fun_t *fun)
    767767{
    768         fun->hw_resources.resources =
    769             (hw_resource_t *) malloc(PCI_MAX_HW_RES * sizeof(hw_resource_t));
    770         return fun->hw_resources.resources != NULL;
     768        fun->hw_resources.resources = fun->resources;
     769        return true;
    771770}
    772771
    773772void pci_clean_resource_list(pci_fun_t *fun)
    774773{
    775         if (fun->hw_resources.resources != NULL) {
    776                 free(fun->hw_resources.resources);
    777                 fun->hw_resources.resources = NULL;
    778         }
     774        fun->hw_resources.resources = NULL;
    779775}
    780776
  • uspace/drv/bus/pci/pciintel/pci.h

    r1d53a78 r992b47ea  
    6565        uint8_t revision;
    6666        hw_resource_list_t hw_resources;
     67        hw_resource_t resources[PCI_MAX_HW_RES];
    6768} pci_fun_t;
    6869
Note: See TracChangeset for help on using the changeset viewer.