Move binfmt.h, nxflat.h, elf.h, and symtab.h to include/nuttx/binfmt/

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5252 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-10-24 20:19:44 +00:00
parent fd01281b68
commit b8f437ef4b
36 changed files with 69 additions and 66 deletions
+3
View File
@@ -3511,3 +3511,6 @@
* binfmt/elf.c, binfmt/libelf, include/elf.h, include/nuttx/elf.h: Add
basic framework for loadable ELF module support. The initial check-
in is non-functional and is simply the framework for ELF support.
* include/nuttx/binfmt.h, nxflat.h, elf.h, and symtab.h: Moved to
include/nuttx/binfmt/.
+6 -6
View File
@@ -554,19 +554,19 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
<ul>
<li>
The interface to the binary loader is described in the header file
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt.h?view=log">
<code>include/nuttx/binfmt.h</code></a>.
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt/binfmt.h?view=log">
<code>include/nuttx/binfmt/binfmt.h</code></a>.
A brief summary of the APIs prototyped in that header file are listed below.
</li>
<li>
NXFLAT APIs needed to register NXFLAT as a binary loader appear in the header file
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/nxflat.h?view=log">
<code>include/nuttx/nxflat.h</code></a>.
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt/nxflat.h?view=log">
<code>include/nuttx/binfmt/nxflat.h</code></a>.
</li>
<li>
The format of an NXFLAT object itself is described in the header file:
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/nxflat.h?view=log">
<code>include/nuttx/nxflat.h</code></a>.
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt/nxflat.h?view=log">
<code>include/nuttx/binfmt/nxflat.h</code></a>.
</li>
</ul>
+1 -1
View File
@@ -43,7 +43,7 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#include "binfmt_internal.h"
+1 -1
View File
@@ -44,7 +44,7 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#include "binfmt_internal.h"
+1 -1
View File
@@ -47,7 +47,7 @@
#include <errno.h>
#include <nuttx/arch.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#include "os_internal.h"
#include "binfmt_internal.h"
+1 -1
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#ifndef CONFIG_BINFMT_DISABLE
+1 -1
View File
@@ -42,7 +42,7 @@
#include <nuttx/config.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -43,7 +43,7 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#include "binfmt_internal.h"
+1 -1
View File
@@ -44,7 +44,7 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#include "binfmt_internal.h"
+1 -1
View File
@@ -45,7 +45,7 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#include "binfmt_internal.h"
+1 -1
View File
@@ -44,7 +44,7 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/binfmt.h>
#include <nuttx/binfmt/binfmt.h>
#include "binfmt_internal.h"
+2 -2
View File
@@ -47,8 +47,8 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/binfmt.h>
#include <nuttx/elf.h>
#include <nuttx/binfmt/binfmt.h>
#include <nuttx/binfmt/elf.h>
#ifdef CONFIG_ELF
+2 -2
View File
@@ -47,8 +47,8 @@
#include <debug.h>
#include <arpa/inet.h>
#include <nuttx/elf.h>
#include <nuttx/symtab.h>
#include <nuttx/binfmt/elf.h>
#include <nuttx/binfmt/symtab.h>
/****************************************************************************
* Pre-processor Definitions
+3 -5
View File
@@ -48,7 +48,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/elf.h>
#include <nuttx/binfmt/elf.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -118,16 +118,14 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
/* Read the ELF header from offset 0 */
ret = elf_read(loadinfo, (char*)&loadinfo->header,
sizeof(struct elf_hdr_s), 0);
ret = elf_read(loadinfo, (char*)&loadinfo->header, sizeof(Elf32_Ehdr), 0);
if (ret < 0)
{
bdbg("Failed to read ELF header: %d\n", ret);
return ret;
}
elf_dumpbuffer("ELF header", (FAR const uint8_t*)&loadinfo->header,
sizeof(struct elf_hdr_s));
elf_dumpbuffer("ELF header", (FAR const uint8_t*)&loadinfo->header, sizeof(Elf32_Ehdr));
/* Verify the ELF header */
+1 -1
View File
@@ -48,7 +48,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/elf.h>
#include <nuttx/binfmt/elf.h>
/****************************************************************************
* Pre-Processor Definitions
+1 -1
View File
@@ -48,7 +48,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/elf.h>
#include <nuttx/binfmt/elf.h>
/****************************************************************************
* Pre-Processor Definitions
+1 -1
View File
@@ -42,7 +42,7 @@
#include <unistd.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/elf.h>
#include <nuttx/binfmt/elf.h>
/****************************************************************************
* Pre-Processor Definitions
+1 -1
View File
@@ -43,7 +43,7 @@
#include <stdlib.h>
#include <debug.h>
#include <nuttx/elf.h>
#include <nuttx/binfmt/elf.h>
/****************************************************************************
* Pre-Processor Definitions
+2 -2
View File
@@ -43,7 +43,7 @@
#include <debug.h>
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/elf.h>
#include <nuttx/binfmt/elf.h>
/****************************************************************************
* Pre-processor Definitions
@@ -74,7 +74,7 @@
*
****************************************************************************/
int elf_verifyheader(const struct elf_hdr_s *header)
int elf_verifyheader(const Elf32_Ehdr *header)
{
if (!header)
{
+2 -2
View File
@@ -47,8 +47,8 @@
#include <debug.h>
#include <arpa/inet.h>
#include <nuttx/nxflat.h>
#include <nuttx/symtab.h>
#include <nuttx/binfmt/nxflat.h>
#include <nuttx/binfmt/symtab.h>
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -48,7 +48,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/nxflat.h>
#include <nuttx/binfmt/nxflat.h>
/****************************************************************************
* Pre-Processor Definitions
+1 -1
View File
@@ -48,7 +48,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/nxflat.h>
#include <nuttx/binfmt/nxflat.h>
/****************************************************************************
* Pre-Processor Definitions
+1 -1
View File
@@ -48,7 +48,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/nxflat.h>
#include <nuttx/binfmt/nxflat.h>
/****************************************************************************
* Pre-Processor Definitions
+2 -1
View File
@@ -42,7 +42,8 @@
#include <unistd.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/nxflat.h>
#include <nuttx/binfmt/nxflat.h>
/****************************************************************************
* Pre-Processor Definitions
+1 -1
View File
@@ -43,7 +43,7 @@
#include <stdlib.h>
#include <debug.h>
#include <nuttx/nxflat.h>
#include <nuttx/binfmt/nxflat.h>
/****************************************************************************
* Pre-Processor Definitions
+2 -1
View File
@@ -42,8 +42,9 @@
#include <string.h>
#include <debug.h>
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/nxflat.h>
#include <nuttx/binfmt/nxflat.h>
/****************************************************************************
* Pre-processor Definitions
+2 -2
View File
@@ -47,8 +47,8 @@
#include <errno.h>
#include <arpa/inet.h>
#include <nuttx/binfmt.h>
#include <nuttx/nxflat.h>
#include <nuttx/binfmt/binfmt.h>
#include <nuttx/binfmt/nxflat.h>
#ifdef CONFIG_NXFLAT
+1 -1
View File
@@ -44,7 +44,7 @@
#include <assert.h>
#include <errno.h>
#include <nuttx/symtab.h>
#include <nuttx/binfmt/symtab.h>
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <assert.h>
#include <errno.h>
#include <nuttx/symtab.h>
#include <nuttx/binfmt/symtab.h>
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <assert.h>
#include <errno.h>
#include <nuttx/symtab.h>
#include <nuttx/binfmt/symtab.h>
/****************************************************************************
* Pre-processor Definitions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <assert.h>
#include <errno.h>
#include <nuttx/symtab.h>
#include <nuttx/binfmt/symtab.h>
/****************************************************************************
* Pre-processor Definitions
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/binfmt.h
* include/nuttx/binfmt/binfmt.h
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_BINFMT_H
#define __INCLUDE_NUTTX_BINFMT_H
#ifndef __INCLUDE_NUTTX_BINFMT_BINFMT_H
#define __INCLUDE_NUTTX_BINFMT_BINFMT_H
/****************************************************************************
* Included Files
@@ -205,5 +205,5 @@ EXTERN int exec(FAR const char *filename, FAR const char **argv,
}
#endif
#endif /* __INCLUDE_NUTTX_BINFMT_H */
#endif /* __INCLUDE_NUTTX_BINFMT_BINFMT_H */
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/elf.h
* include/nuttx/binfmt/elf.h
*
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_ELF_H
#define __INCLUDE_NUTTX_ELF_H
#ifndef __INCLUDE_NUTTX_BINFMT_ELF_H
#define __INCLUDE_NUTTX_BINFMT_ELF_H
/****************************************************************************
* Included Files
@@ -89,9 +89,9 @@ struct elf_loadinfo_s
int filfd; /* Descriptor for the file being loaded */
/* This is a copy of the ELF header (still in network order) */
/* This is a copy of the ELF header */
FAR struct elf_hdr_s header;
Elf32_Ehdr header;
};
/****************************************************************************
@@ -123,7 +123,7 @@ extern "C" {
*
****************************************************************************/
EXTERN int elf_verifyheader(FAR const struct elf_hdr_s *header);
EXTERN int elf_verifyheader(FAR const Elf32_Ehdr *header);
/****************************************************************************
* Name: elf_init
@@ -256,4 +256,4 @@ EXTERN void elf_uninitialize(void);
}
#endif
#endif /* __INCLUDE_NUTTX_ELF_H */
#endif /* __INCLUDE_NUTTX_BINFMT_ELF_H */
@@ -1,5 +1,5 @@
/****************************************************************************
* include/nuttx/nxflat.h
* include/nuttx/binfmt/nxflat.h
*
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_NXFLAT_H
#define __INCLUDE_NUTTX_NXFLAT_H
#ifndef __INCLUDE_NUTTX_BINFMT_NXFLAT_H
#define __INCLUDE_NUTTX_BINFMT_NXFLAT_H
/****************************************************************************
* Included Files
@@ -261,4 +261,4 @@ EXTERN void nxflat_uninitialize(void);
}
#endif
#endif /* __INCLUDE_NUTTX_NXFLAT_H */
#endif /* __INCLUDE_NUTTX_BINFMT_NXFLAT_H */
@@ -1,5 +1,5 @@
/****************************************************************************
* include/nuttx/symtab.h
* include/nuttx/binfmt/symtab.h
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_SYMTAB_H
#define __INCLUDE_NUTTX_SYMTAB_H
#ifndef __INCLUDE_NUTTX_BINFMT_SYMTAB_H
#define __INCLUDE_NUTTX_BINFMT_SYMTAB_H
/****************************************************************************
* Included Files
@@ -159,5 +159,5 @@ symtab_findorderedbyvalue(FAR const struct symtab_s *symtab,
}
#endif
#endif /* __INCLUDE_NUTTX_SYMTAB_H */
#endif /* __INCLUDE_NUTTX_BINFMT_SYMTAB_H */
+1 -1
View File
@@ -222,7 +222,7 @@ int main(int argc, char **argv, char **envp)
fprintf(outstream, "/* %s: Auto-generated symbol table. Do not edit */\n\n", symtab);
fprintf(outstream, "#include <nuttx/config.h>\n");
fprintf(outstream, "#include <nuttx/symtab.h>\n\n");
fprintf(outstream, "#include <nuttx/binfmt/symtab.h>\n\n");
/* Output all of the require header files */