Hi,
This patch series redesigns the existing pciinit.c code and introduces linked list operations. Changes are more about structures definitions rather than functionality. There are no more arrays of bases and counts in new implementation. The new implementation is based on dynamic allocation of pci_region_entry structures. Each pci_region_entry structure could be a PCI bar or a downstream PCI region (bridge). Each entry has a set of attributes: type (IO, MEM, PREFMEM), is64bit, size, base address, PCI device owner, and a pointer to the pci_bus it belongs to. Also this series introduces list head operations which could be quite handy not only for pciinit.c code but for post memory manager and thread operations.
The patch series includes 3 patches.
1. Introduce List operations 2. Add pci_region_entry and linked lists operations in place while still using the array system to do the allocations. 3. Switch to lists operations 4. Delete old code. (3 & 4 are split for better readability) 5. Get rid of size element from bus->r structure, now we use entry->size for the same purpose 6. Make use of list operations in pmm.c and stack.c
src/pciinit.c | 270 ++++++++++++++++++++++++++------------------------------- src/pmm.c | 29 ++---- src/stacks.c | 8 +-- src/util.h | 32 +++++++ 4 files changed, 165 insertions(+), 174 deletions(-)
P/s It is basically the same functionality as in previous version. I just split commit in more pieces to make the changes to be as obvious as possible.