Add MSR and the related functions, Fix a bug
fix a malloc bug in fifo