Fixed mem* funcs and pci device discovery