#include "pub_core_ume.h"
-#ifndef AT_DCACHEBSIZE
-#define AT_DCACHEBSIZE 19
-#endif /* AT_DCACHEBSIZE */
-
-#ifndef AT_ICACHEBSIZE
-#define AT_ICACHEBSIZE 20
-#endif /* AT_ICACHEBSIZE */
-
-#ifndef AT_UCACHEBSIZE
-#define AT_UCACHEBSIZE 21
-#endif /* AT_UCACHEBSIZE */
-
-#ifndef AT_SYSINFO
-#define AT_SYSINFO 32
-#endif /* AT_SYSINFO */
-
-#ifndef AT_SYSINFO_EHDR
-#define AT_SYSINFO_EHDR 33
-#endif /* AT_SYSINFO_EHDR */
-
-#ifndef AT_SECURE
-#define AT_SECURE 23 /* secure mode boolean */
-#endif /* AT_SECURE */
-
-/* Number of file descriptors that Valgrind tries to reserve for
- it's own use - just a small constant. */
-#define N_RESERVED_FDS (10)
-
-
/*====================================================================*/
/*=== Counters, for profiling purposes only ===*/
/*====================================================================*/
/*====================================================================*/
-/*=== Environment and stack setup ===*/
+/*=== Setting up the client's environment ===*/
/*====================================================================*/
/* Prepare the client's environment. This is basically a copy of our
}
+/*====================================================================*/
+/*=== Setting up the client's stack ===*/
+/*====================================================================*/
+
+#ifndef AT_DCACHEBSIZE
+#define AT_DCACHEBSIZE 19
+#endif /* AT_DCACHEBSIZE */
+
+#ifndef AT_ICACHEBSIZE
+#define AT_ICACHEBSIZE 20
+#endif /* AT_ICACHEBSIZE */
+
+#ifndef AT_UCACHEBSIZE
+#define AT_UCACHEBSIZE 21
+#endif /* AT_UCACHEBSIZE */
+
+#ifndef AT_SYSINFO
+#define AT_SYSINFO 32
+#endif /* AT_SYSINFO */
+
+#ifndef AT_SYSINFO_EHDR
+#define AT_SYSINFO_EHDR 33
+#endif /* AT_SYSINFO_EHDR */
+
+#ifndef AT_SECURE
+#define AT_SECURE 23 /* secure mode boolean */
+#endif /* AT_SECURE */
+
/* Add a string onto the string table, and return its address */
static char *copy_str(char **tab, const char *str)
{
return orig;
}
-/*
+
+/* ----------------------------------------------------------------
+
This sets up the client's initial stack, containing the args,
environment and aux vector.
VG_(cache_line_size_ppc32) // ppc32 only -- cache line size
VG_(have_altivec_ppc32) // ppc32 only -- is Altivec supported?
-*/
+
+ ---------------------------------------------------------------- */
static
Addr setup_client_stack( void* init_sp,
/*=== File descriptor setup ===*/
/*====================================================================*/
+/* Number of file descriptors that Valgrind tries to reserve for
+ it's own use - just a small constant. */
+#define N_RESERVED_FDS (10)
+
static void setup_file_descriptors(void)
{
struct vki_rlimit rl;
All code is copied verbatim from kernel source files, except that:
- VKI_/vki_ prefixes are added
- - a few extra constants are defined (eg. VKI_MAP_NOSYMS); these are
- marked 'internal'
- some extra explanatory comments are included; they are all within
"[[ ]]"
- for some types, we only care about the size; for a few of them (big
#define VKI_SEEK_CUR 1
#define VKI_SEEK_END 2
-// [[Our own additional mmap flags]]
-#define VKI_MAP_NOSYMS 0x40000000 // internal: disable symbol loading
-#define VKI_MAP_CLIENT 0x80000000 // internal: distinguish client mappings
-
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/net.h
//----------------------------------------------------------------------