Cortex: new function to control entropy and cpu wakeups + logic fix