1. A method of switching from execution of a first data processing task to execution of a second data processing task, comprising: the first data processing task executing a call to a task switching function; the task switching function selecting a return address corresponding to the second data processing task; and the task switching function executing a return operation.