separate cpp and c code in portal.cpp and dmaManager.cpp (needed so that portal.c and dmaManager.c can be used in the kernel)