move functions that don't depend on DmaManager from dmaManager.c to portal.c