add some comments and clean code in cpu_port.c