fix multiple declaration of extern variables sched_threads and active_thread
fix extern declared variables should be defined in the including .c file not in the header
fix declared extern ASM call as C routine
fix the body of inline functions have to be in the header