Integrate PIC support into context switching

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1900 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-06-17 23:38:05 +00:00
parent 2afd39df07
commit f876eb552a
13 changed files with 139 additions and 33 deletions
+2 -1
View File
@@ -43,6 +43,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <nxflat.h>
#include <nuttx/sched.h>
/****************************************************************************
* Pre-processor Definitions
@@ -65,7 +66,7 @@ struct binary_s
main_t entrypt; /* Entry point into a program module */
FAR void *ispace; /* Memory-mapped, I-space (.text) address */
FAR void *dspace; /* Address of the allocated .data/.bss space */
FAR struct dspace_s *dspace; /* Address of the allocated .data/.bss space */
size_t isize; /* Size of the I-space region (needed for munmap) */
size_t stacksize; /* Size of the stack in bytes (unallocated) */
};
+13 -11
View File
@@ -40,7 +40,9 @@
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nxflat.h>
#include <nuttx/sched.h>
/****************************************************************************
* Pre-processor Definitions
@@ -61,29 +63,29 @@ struct nxflat_loadinfo_s
* text section instance in the system for each module.
*/
uint32 ispace; /* Address where hdr/text is loaded */
uint32 entryoffs; /* Offset from ispace to entry point */
uint32 isize; /* Size of ispace. */
uint32 ispace; /* Address where hdr/text is loaded */
uint32 entryoffs; /* Offset from ispace to entry point */
uint32 isize; /* Size of ispace. */
/* Data Space (DSpace): This region contains all information that in referenced
* as data (other than the stack which is separately allocated). There will be
* a unique instance of DSpace (and stack) for each instance of a process.
*/
uint32 dspace; /* Address where data/bss/etc. is loaded */
uint32 datasize; /* Size of data segment in dspace */
uint32 bsssize; /* Size of bss segment in dspace */
uint32 stacksize; /* Size of stack (not allocated) */
uint32 dsize; /* Size of dspace (may be large than parts) */
struct dspace_s *dspace; /* Allocated D-Space (data/bss/etc) */
uint32 datasize; /* Size of data segment in dspace */
uint32 bsssize; /* Size of bss segment in dspace */
uint32 stacksize; /* Size of stack (not allocated) */
uint32 dsize; /* Size of dspace (may be large than parts) */
/* This is temporary memory where relocation records will be loaded. */
uint32 relocstart; /* Start of array of struct flat_reloc */
uint32 reloccount; /* Number of elements in reloc array */
uint32 relocstart; /* Start of array of struct flat_reloc */
uint32 reloccount; /* Number of elements in reloc array */
/* File descriptors */
int filfd; /* Descriptor for the file being loaded */
int filfd; /* Descriptor for the file being loaded */
const struct nxflat_hdr_s *header; /* A reference to the flat file header */
};
+13 -1
View File
@@ -161,6 +161,18 @@ typedef struct environ_s environ_t;
# define SIZEOF_ENVIRON_T(alloc) (sizeof(environ_t) + alloc - 1)
#endif
/* This structure describes a reference counted D-Space region */
struct dspace_s
{
uint32 crefs; /* This is the number of pthreads that shared the
* the same D-Space.
*/
ubyte region[1]; /* Beginning of the allocated region */
};
#define SIZEOF_DSPACE_S(n) (sizeof(struct dspace_s) - 1 + (n))
/* This is the task control block (TCB) */
struct _TCB
@@ -217,7 +229,7 @@ struct _TCB
/* External Module Support ****************************************************/
#ifdef CONFIG_PIC
FAR void *picbase; /* Allocated area for .bss and .data */
FAR struct dspace_s *dspace; /* Allocated area for .bss and .data */
#endif
/* POSIX Thread Specific Data *************************************************/