move appmemk function from KDEVICE to AM_FUNC