Skip to main content

Fast micro:bian context switch with floating point

Supervisor

Suitable for

MSc in Advanced Computer Science
Mathematics and Computer Science, Part C
Computer Science and Philosophy, Part C
Computer Science, Part C
Computer Science, Part B

Abstract

At present, the context-switch code in micro:bian does not save and restore the floating point registers on chips that have them. That means client programs cannot use the floating point unit, or more accurately, that at most one thread can use it. ARM provide a method, documented [somewhere] that allows for lazy saving of the floating-point registers. At the least, the kernel should save the floating point state for a process only if it has used the floating point unit; but better than that, it's possible to exploit the hardware to save the floating point state only if some other process wants to use floating point. This makes for efficient treatment of interrupts: if the device driver process doesn't use floating point, then there is not need to save the floating point registers when control passes from a background process to the driver, or to restore them when control returns to the background process.