Commit 519a8ecd authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/tools/lm32-loader.c: fix comments (no change)

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 9e31590c
......@@ -84,20 +84,19 @@ void copy_lm32(uint32_t *buf, int buf_nwords, uint32_t base_addr)
printf("OK.\n");
}
/* being a lazy bastard, I fork a process to avoid free, munmap etc */
int load_lm32_child(char *fname)
{
uint32_t *buf;
FILE *f;
int fdmem;
/* /dev/mem for mmap of both gpio and spi1 */
if ((fdmem = open("/dev/mem", O_RDWR | O_SYNC)) < 0) {
fprintf(stderr, "%s: /dev/mem: %s\n", __func__,
strerror(errno));
exit(1);
}
/* map a whole page (4kB, but we called getpagesize to know it) */
base_fpga = mmap(0, SIZE_FPGA, PROT_READ | PROT_WRITE,
MAP_SHARED, fdmem,
BASE_FPGA);
......@@ -128,8 +127,6 @@ int load_lm32_child(char *fname)
copy_lm32(buf, (size + 3) / 4, 0);
rst_lm32(0);
// mbn_stats(mb_handle);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment