mm/lib: add write_file & read_file functions

mm tests often read and write memory-related files, so adding 2
functions: write_file and read_file to mmlib.

Usage:

  void write_file(char *filename, char *buf);
    @param: filename - full path of file to be written
    @param: buf - a buffer string to be written to file

  void read_file(char *filename, char *retbuf);
    @param: filename - full path of file to be read
    @param (as return): retbuf - stores fetched buffer string from file

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
2 files changed