Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2349 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
8e813e8811
commit
99b0163fba
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <sched.h>
|
||||
|
@ -38,8 +38,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
@ -88,13 +89,13 @@
|
||||
|
||||
int exec_module(FAR const struct binary_s *bin, int priority)
|
||||
{
|
||||
FAR _TCB *tcb;
|
||||
FAR _TCB *tcb;
|
||||
#ifndef CONFIG_CUSTOM_STACK
|
||||
FAR uint32 *stack;
|
||||
FAR uint32_t *stack;
|
||||
#endif
|
||||
pid_t pid;
|
||||
int err;
|
||||
int ret;
|
||||
pid_t pid;
|
||||
int err;
|
||||
int ret;
|
||||
|
||||
/* Sanity checking */
|
||||
|
||||
@ -120,7 +121,7 @@ int exec_module(FAR const struct binary_s *bin, int priority)
|
||||
/* Allocate the stack for the new task */
|
||||
|
||||
#ifndef CONFIG_CUSTOM_STACK
|
||||
stack = (FAR uint32*)malloc(bin->stacksize);
|
||||
stack = (FAR uint32_t*)malloc(bin->stacksize);
|
||||
if (!tcb)
|
||||
{
|
||||
err = ENOMEM;
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <sched.h>
|
||||
|
@ -38,9 +38,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <sched.h>
|
||||
|
@ -38,8 +38,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <nxflat.h>
|
||||
#include <errno.h>
|
||||
@ -96,18 +96,18 @@
|
||||
****************************************************************************/
|
||||
|
||||
static inline int nxflat_bindrel32i(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
uint32 offset)
|
||||
uint32_t offset)
|
||||
{
|
||||
uint32 *addr;
|
||||
uint32_t *addr;
|
||||
|
||||
bvdbg("NXFLAT_RELOC_TYPE_REL32I Offset: %08x I-Space: %p\n",
|
||||
offset, loadinfo->ispace + sizeof(struct nxflat_hdr_s));
|
||||
|
||||
if (offset < loadinfo->dsize)
|
||||
{
|
||||
addr = (uint32*)(offset + loadinfo->dspace->region);
|
||||
addr = (uint32_t*)(offset + loadinfo->dspace->region);
|
||||
bvdbg(" Before: %08x\n", *addr);
|
||||
*addr += (uint32)(loadinfo->ispace + sizeof(struct nxflat_hdr_s));
|
||||
*addr += (uint32_t)(loadinfo->ispace + sizeof(struct nxflat_hdr_s));
|
||||
bvdbg(" After: %08x\n", *addr);
|
||||
return OK;
|
||||
}
|
||||
@ -135,18 +135,18 @@ static inline int nxflat_bindrel32i(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
****************************************************************************/
|
||||
|
||||
static inline int nxflat_bindrel32d(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
uint32 offset)
|
||||
uint32_t offset)
|
||||
{
|
||||
uint32 *addr;
|
||||
uint32_t *addr;
|
||||
|
||||
bvdbg("NXFLAT_RELOC_TYPE_REL32D Offset: %08x D-Space: %p\n",
|
||||
offset, loadinfo->dspace->region);
|
||||
|
||||
if (offset < loadinfo->dsize)
|
||||
{
|
||||
addr = (uint32*)(offset + loadinfo->dspace->region);
|
||||
addr = (uint32_t*)(offset + loadinfo->dspace->region);
|
||||
bvdbg(" Before: %08x\n", *addr);
|
||||
*addr += (uint32)(loadinfo->dspace->region);
|
||||
*addr += (uint32_t)(loadinfo->dspace->region);
|
||||
bvdbg(" After: %08x\n", *addr);
|
||||
return OK;
|
||||
}
|
||||
@ -177,18 +177,18 @@ static inline int nxflat_bindrel32d(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
|
||||
#ifdef NXFLAT_RELOC_TYPE_REL32ID
|
||||
static inline int nxflat_bindrel32id(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
uint32 offset)
|
||||
uint32_t offset)
|
||||
{
|
||||
uint32 *addr;
|
||||
uint32_t *addr;
|
||||
|
||||
bvdbg("NXFLAT_RELOC_TYPE_REL32D Offset: %08x D-Space: %p\n",
|
||||
offset, loadinfo->dspace->region);
|
||||
|
||||
if (offset < loadinfo->dsize)
|
||||
{
|
||||
addr = (uint32*)(offset + loadinfo->dspace->region);
|
||||
addr = (uint32_t*)(offset + loadinfo->dspace->region);
|
||||
bvdbg(" Before: %08x\n", *addr);
|
||||
*addr += ((uint32)loadinfo->ispace - (uint32)(loadinfo->dspace->region));
|
||||
*addr += ((uint32_t)loadinfo->ispace - (uint32_t)(loadinfo->dspace->region));
|
||||
bvdbg(" After: %08x\n", *addr);
|
||||
return OK;
|
||||
}
|
||||
@ -219,11 +219,11 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
|
||||
FAR struct nxflat_reloc_s *relocs;
|
||||
FAR struct nxflat_reloc_s reloc;
|
||||
FAR struct nxflat_hdr_s *hdr;
|
||||
uint32 offset;
|
||||
uint16 nrelocs;
|
||||
int ret;
|
||||
int result;
|
||||
int i;
|
||||
uint32_t offset;
|
||||
uint16_t nrelocs;
|
||||
int ret;
|
||||
int result;
|
||||
int i;
|
||||
|
||||
/* The NXFLAT header is the first thing at the beginning of the ISpace. */
|
||||
|
||||
@ -326,7 +326,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
|
||||
if (ret == OK && nrelocs > 0)
|
||||
{
|
||||
relocs = (FAR struct nxflat_reloc_s*)(offset - loadinfo->isize + loadinfo->dspace->region);
|
||||
nxflat_dumpbuffer("GOT", (FAR const ubyte*)relocs, nrelocs * sizeof(struct nxflat_reloc_s));
|
||||
nxflat_dumpbuffer("GOT", (FAR const uint8_t*)relocs, nrelocs * sizeof(struct nxflat_reloc_s));
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
@ -353,10 +353,10 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
FAR struct nxflat_hdr_s *hdr;
|
||||
FAR const struct symtab_s *symbol;
|
||||
|
||||
char *symname;
|
||||
uint32 offset;
|
||||
uint16 nimports;
|
||||
int i;
|
||||
char *symname;
|
||||
uint32_t offset;
|
||||
uint16_t nimports;
|
||||
int i;
|
||||
|
||||
/* The NXFLAT header is the first thing at the beginning of the ISpace. */
|
||||
|
||||
@ -426,7 +426,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
|
||||
/* And put this into the module's import structure. */
|
||||
|
||||
imports[i].i_funcaddress = (uint32)symbol->sym_value;
|
||||
imports[i].i_funcaddress = (uint32_t)symbol->sym_value;
|
||||
|
||||
bvdbg("Bound import[%d] (%08p) to export '%s' (%08x)\n",
|
||||
i, &imports[i], symname, imports[i].i_funcaddress);
|
||||
@ -438,7 +438,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
|
||||
#ifdef CONFIG_NXFLAT_DUMPBUFFER
|
||||
if (nimports > 0)
|
||||
{
|
||||
nxflat_dumpbuffer("Imports", (FAR const ubyte*)imports, nimports * sizeof(struct nxflat_import_s));
|
||||
nxflat_dumpbuffer("Imports", (FAR const uint8_t*)imports, nimports * sizeof(struct nxflat_import_s));
|
||||
}
|
||||
#endif
|
||||
return OK;
|
||||
|
@ -38,9 +38,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <nxflat.h>
|
||||
@ -95,11 +95,11 @@
|
||||
|
||||
int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo)
|
||||
{
|
||||
uint32 datastart;
|
||||
uint32 dataend;
|
||||
uint32 bssstart;
|
||||
uint32 bssend;
|
||||
int ret;
|
||||
uint32_t datastart;
|
||||
uint32_t dataend;
|
||||
uint32_t bssstart;
|
||||
uint32_t bssend;
|
||||
int ret;
|
||||
|
||||
bvdbg("filename: %s loadinfo: %p\n", filename, loadinfo);
|
||||
|
||||
@ -125,7 +125,7 @@ int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo)
|
||||
bdbg("Failed to read NXFLAT header: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
nxflat_dumpbuffer("NXFLAT header", (FAR const ubyte*)&loadinfo->header,
|
||||
nxflat_dumpbuffer("NXFLAT header", (FAR const uint8_t*)&loadinfo->header,
|
||||
sizeof(struct nxflat_hdr_s));
|
||||
|
||||
/* Verify the NXFLAT header */
|
||||
|
@ -38,9 +38,10 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <nxflat.h>
|
||||
#include <debug.h>
|
||||
@ -105,11 +106,11 @@ static const char *g_reloctype[] =
|
||||
|
||||
int nxflat_load(struct nxflat_loadinfo_s *loadinfo)
|
||||
{
|
||||
off_t doffset; /* Offset to .data in the NXFLAT file */
|
||||
uint32 dreadsize; /* Total number of bytes of .data to be read */
|
||||
uint32 relocsize; /* Memory needed to hold relocations */
|
||||
uint32 extrasize; /* MAX(BSS size, relocsize) */
|
||||
int ret = OK;
|
||||
off_t doffset; /* Offset to .data in the NXFLAT file */
|
||||
uint32_t dreadsize; /* Total number of bytes of .data to be read */
|
||||
uint32_t relocsize; /* Memory needed to hold relocations */
|
||||
uint32_t extrasize; /* MAX(BSS size, relocsize) */
|
||||
int ret = OK;
|
||||
|
||||
/* 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
|
||||
@ -159,9 +160,9 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo)
|
||||
* resides as long as it is fully initialized and ready to execute.
|
||||
*/
|
||||
|
||||
loadinfo->ispace = (uint32)mmap(NULL, loadinfo->isize, PROT_READ,
|
||||
loadinfo->ispace = (uint32_t)mmap(NULL, loadinfo->isize, PROT_READ,
|
||||
MAP_SHARED|MAP_FILE, loadinfo->filfd, 0);
|
||||
if (loadinfo->ispace == (uint32)MAP_FAILED)
|
||||
if (loadinfo->ispace == (uint32_t)MAP_FAILED)
|
||||
{
|
||||
bdbg("Failed to map NXFLAT ISpace: %d\n", errno);
|
||||
return -errno;
|
||||
|
@ -38,8 +38,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <nxflat.h>
|
||||
@ -72,14 +73,14 @@
|
||||
#if defined(NXFLAT_DUMP_READDATA)
|
||||
static inline void nxflat_dumpreaddata(char *buffer, int buflen)
|
||||
{
|
||||
uint32 *buf32 = (uint32*)buffer;
|
||||
uint32 *buf32 = (uint32_t*)buffer;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
for (i = 0; i < buflen; i += 32)
|
||||
{
|
||||
DUMPER("%04x:", i);
|
||||
for (j = 0; j < 32; j += sizeof(uint32))
|
||||
for (j = 0; j < 32; j += sizeof(uint32_t))
|
||||
{
|
||||
DUMPER(" %08x", *buf32++);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
@ -38,9 +38,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
@ -38,8 +38,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <nxflat.h>
|
||||
#include <debug.h>
|
||||
@ -188,7 +189,7 @@ static int nxflat_loadbinary(struct binary_s *binp)
|
||||
binp->isize = loadinfo.isize;
|
||||
binp->stacksize = loadinfo.stacksize;
|
||||
|
||||
nxflat_dumpbuffer("Entry code", (FAR const ubyte*)binp->entrypt,
|
||||
nxflat_dumpbuffer("Entry code", (FAR const uint8_t*)binp->entrypt,
|
||||
MIN(binp->isize - loadinfo.entryoffs,512));
|
||||
|
||||
nxflat_uninit(&loadinfo);
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <assert.h>
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <assert.h>
|
||||
|
Loading…
Reference in New Issue
Block a user