added function declarations for drive functions
added thread-local variable macro to xm.h