1
0
Fork 0
forked from nuttx/nuttx-update

binfmt/libnxflat/libnxflat_load.c: Appease nxstyle

This commit is contained in:
YAMAMOTO Takashi 2020-11-25 20:14:21 +09:00 committed by Xiang Xiao
parent cde04a6523
commit b9538bf885

View file

@ -100,9 +100,9 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo)
/* Calculate the extra space we need to allocate. This extra space will be /* Calculate the extra space we need to allocate. This extra space will be
* the size of the BSS section. This extra space will also be used * the size of the BSS section. This extra space will also be used
* temporarily to hold relocation information. So the allocated size of this * temporarily to hold relocation information. So the allocated size of
* region will either be the size of .data + size of.bss section OR, the * this region will either be the size of .data + size of.bss section OR,
* size of .data + the relocation entries, whichever is larger * the size of .data + the relocation entries, whichever is larger
* *
* This is the amount of memory that we have to have to hold the * This is the amount of memory that we have to have to hold the
* relocations. * relocations.
@ -142,19 +142,21 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo)
*/ */
/* The following call will give as a pointer to the mapped file ISpace. /* The following call will give as a pointer to the mapped file ISpace.
* This may be in ROM, RAM, Flash, ... We don't really care where the memory * This may be in ROM, RAM, Flash, ... We don't really care where the
* resides as long as it is fully initialized and ready to execute. * memory resides as long as it is fully initialized and ready to execute.
*/ */
loadinfo->ispace = (uint32_t)mmap(NULL, loadinfo->isize, PROT_READ, loadinfo->ispace = (uint32_t)mmap(NULL, loadinfo->isize, PROT_READ,
MAP_SHARED | MAP_FILE, loadinfo->filfd, 0); MAP_SHARED | MAP_FILE, loadinfo->filfd,
0);
if (loadinfo->ispace == (uint32_t)MAP_FAILED) if (loadinfo->ispace == (uint32_t)MAP_FAILED)
{ {
berr("Failed to map NXFLAT ISpace: %d\n", errno); berr("Failed to map NXFLAT ISpace: %d\n", errno);
return -errno; return -errno;
} }
binfo("Mapped ISpace (%d bytes) at %08x\n", loadinfo->isize, loadinfo->ispace); binfo("Mapped ISpace (%d bytes) at %08x\n",
loadinfo->isize, loadinfo->ispace);
/* The following call allocate D-Space memory and will provide a pointer /* The following call allocate D-Space memory and will provide a pointer
* to the allocated (but still uninitialized) D-Space memory. * to the allocated (but still uninitialized) D-Space memory.