* src/mem-limits.h: Remove !emacs and _LIBC conditional code.
(start_of_data): Merge into start_of_data function.
* src/sysdep.c (start_of_text): Remove. Move simplified versions of
it in the only users: src/unexaix.c and unexec.c.
(read_input_waiting): Remove local declaration of quit_char.
(start, etext): Remove declarations.
(start_of_data): Merge with the version in mem-limits.h and move
to vm-limits.c.
* src/vm-limit.c (start_of_data): Merged and simplified version of the
code formerly in mem-limits.h and sysdep.c.
* src/unexec.c (start): New declaration, moved from sysdep.c.
(start_of_text): Simplified version of the code formerly in sysdep.c.
* unexaix.c (start_of_text): Simplified version of the code
formerly in sysdep.c.
* src/m/alpha.h (HAVE_TEXT_START): Remove.
(TEXT_START): Move ...
* src/unexalpha.c (TEXT_START): ... here.
* src/s/hpux10-20.h (TEXT_START): Remove.
* src/s/darwin.h (TEXT_START):
* src/m/mips.h (TEXT_START):
* src/m/macppc.h (HAVE_TEXT_START):
* src/m/m68k.h (TEXT_START):
* src/m/iris4d.h (TEXT_START):
* src/m/intel386.h (TEXT_START):
* src/m/ibmrs6000.h (TEXT_START):
* src/m/ia64.h (HAVE_TEXT_START):
* src/s/msdos.h (TEXT_START): Likewise.
HAVE_SYS_TIME_H
HAVE_TCATTR
HAVE_TERMIOS_H
-HAVE_TEXT_START
HAVE_TIMEVAL
HAVE_TM_ZONE
HAVE_TZSET
TAB3
TABDLY
TERM
-TEXT_START
THIS_IS_CONFIGURE
TIME_WITH_SYS_TIME
TIOCSIGSEND
+2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Simplify cstart_of_data, start_of_code and related code.
+ * mem-limits.h: Remove !emacs and _LIBC conditional code.
+ (start_of_data): Merge into start_of_data function.
+ * sysdep.c (start_of_text): Remove. Move simplified versions of
+ it in the only users: unexaix.c and unexec.c.
+ (read_input_waiting): Remove local declaration of quit_char.
+ (start, etext): Remove declarations.
+ (start_of_data): Merge with the version in mem-limits.h and move
+ to vm-limits.c.
+ * vm-limit.c (start_of_data): Merged and simplified version of the
+ code formerly in mem-limits.h and sysdep.c.
+ * unexec.c (start): New declaration, moved from sysdep.c.
+ (start_of_text): Simplified version of the code formerly in sysdep.c.
+ * unexaix.c (start_of_text): Simplified version of the code
+ formerly in sysdep.c.
+ * m/alpha.h (HAVE_TEXT_START): Remove.
+ (TEXT_START): Move ...
+ * unexalpha.c (TEXT_START): ... here.
+ * s/hpux10-20.h (TEXT_START): Remove.
+ * s/darwin.h (TEXT_START):
+ * m/mips.h (TEXT_START):
+ * m/macppc.h (HAVE_TEXT_START):
+ * m/m68k.h (TEXT_START):
+ * m/iris4d.h (TEXT_START):
+ * m/intel386.h (TEXT_START):
+ * m/ibmrs6000.h (TEXT_START):
+ * m/ia64.h (HAVE_TEXT_START):
+ * s/msdos.h (TEXT_START): Likewise.
+
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* alloc.c (overrun_check_malloc, overrun_check_realloc)
#define DATA_START 0x140000000
#endif
-#if (defined (__NetBSD__) || defined (__OpenBSD__))
-#define HAVE_TEXT_START
-#endif
-
#else /* not __ELF__ */
/* Describe layout of the address space in an executing process. */
-#define TEXT_START 0x120000000
#define DATA_START 0x140000000
#endif /* __ELF__ */
#endif /* not _MALLOC_INTERNAL */
#endif /* REL_ALLOC */
-#define HAVE_TEXT_START
-
/* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66
(do not change this comment) */
/* The data segment in this machine always starts at address 0x20000000.
An address of data cannot be stored correctly in a Lisp object;
we always lose the high bits. We must tell XPNTR to add them back. */
-#define TEXT_START 0x10000000
#define DATA_START 0x20000000
#define WORDS_BIG_ENDIAN
#define DATA_SEG_BITS 0x20000000
is the most significant byte. */
#undef WORDS_BIG_ENDIAN
-#ifdef USG
-#define TEXT_START 0
-#endif /* USG */
-
#ifdef WINDOWSNT
#define VIRT_ADDR_VARIES
#define DATA_START get_data_start ()
This flag only matters if you use USE_LISP_UNION_TYPE. */
#define EXPLICIT_SIGN_EXTEND
-#define TEXT_START 0x400000
-
/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which
were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for
the value field of a LISP_OBJECT). */
#endif
#define NO_REMAP
-#define TEXT_START 0
#endif
/* arch-tag: 4eadd161-b4e8-4b82-82a1-e4ce7f42969d
/* Convert that into an integer that is 100 for a load average of 1.0 */
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-#if (defined (__NetBSD__) || defined (__OpenBSD__)) && defined (__ELF__)
-#define HAVE_TEXT_START
-#endif
-
#ifdef _ARCH_PPC64
#ifndef _LP64
#define _LP64
This flag only matters if you use USE_LISP_UNION_TYPE. */
#define EXPLICIT_SIGN_EXTEND
-/* Describe layout of the address space in an executing process. */
-#define TEXT_START 0x00400000
-
/* arch-tag: 8fd020ee-78a7-4d87-96ce-6129f52f7bee
(do not change this comment) */
/* Some systems need this before <sys/resource.h>. */
#include <sys/types.h>
-#ifdef _LIBC
-
-#include <sys/resource.h>
-#define BSD4_2 /* Tell code below to use getrlimit. */
-
-/* Old Linux startup code won't define __data_start. */
-extern int etext, __data_start; weak_extern (__data_start)
-#define start_of_data() (&__data_start ?: &etext)
-
-#else /* not _LIBC */
-
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/time.h>
# include <sys/resource.h>
#include <sys/resource.h>
#endif /* BSD4_2 */
-#ifdef emacs
/* The important properties of this type are that 1) it's a pointer, and
2) arithmetic on it should work as if the size of the object pointed
to has a size of 1. */
#define EXCEEDS_LISP_PTR(ptr) ((EMACS_UINT) (ptr) >> VALBITS)
#endif
-#ifdef DATA_START
-#define start_of_data() ((char *)DATA_START)
-#endif
-
-#ifdef BSD_SYSTEM
-#ifndef DATA_SEG_BITS
-#ifndef DATA_START
-extern char etext;
-#define start_of_data() &etext
-#endif
-#endif
-#endif
-
-#else /* not emacs */
-extern char etext;
-#define start_of_data() &etext
-#endif /* not emacs */
-
-#endif /* not _LIBC */
-
-
/* arch-tag: fe39244e-e54f-4208-b7aa-02556f7841c5
(do not change this comment) */
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
-/* start_of_text isn't actually used, so make it compile without error. */
-#define TEXT_START (0)
-
/* Definitions for how to compile & link. */
#ifdef HAVE_NS
#define SYSTEM_PURESIZE_EXTRA 200000
#define DATA_SEG_BITS 0x40000000
#define DATA_START 0x40000000
-#define TEXT_START 0x00000000
/* Data type of load average, as read out of kmem. */
#define LOAD_AVE_TYPE double
#define _longjmp longjmp
#define DATA_START (&etext + 1)
-#define TEXT_START &start
#define _NAIVE_DOS_REGS
#include "dosfns.h"
#include "msdos.h"
#include <sys/param.h>
-
-extern int etext;
-extern unsigned start __asm__ ("start");
#endif
#include <sys/file.h>
}
#endif /* HAVE_PTYS */
\f
-#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC)
-/* Some systems that cannot dump also cannot implement these. */
-
-/*
- * Return the address of the start of the text segment prior to
- * doing an unexec. After unexec the return value is undefined.
- * See crt0.c for further explanation and _start.
- *
- */
-
-#if !(defined (__NetBSD__) && defined (__ELF__))
-#ifndef HAVE_TEXT_START
-char *
-start_of_text (void)
-{
-#ifdef TEXT_START
- return ((char *) TEXT_START);
-#else
- extern int _start ();
- return ((char *) _start);
-#endif /* TEXT_START */
-}
-#endif /* not HAVE_TEXT_START */
-#endif
-
-/*
- * Return the address of the start of the data segment prior to
- * doing an unexec. After unexec the return value is undefined.
- * See crt0.c for further information and definition of data_start.
- *
- * Apparently, on BSD systems this is etext at startup. On
- * USG systems (swapping) this is highly mmu dependent and
- * is also dependent on whether or not the program is running
- * with shared text. Generally there is a (possibly large)
- * gap between end of text and start of data with shared text.
- *
- * On Uniplus+ systems with shared text, data starts at a
- * fixed address. Each port (from a given oem) is generally
- * different, and the specific value of the start of data can
- * be obtained via the UniPlus+ specific "uvar" system call,
- * however the method outlined in crt0.c seems to be more portable.
- *
- * Probably what will have to happen when a USG unexec is available,
- * at least on UniPlus, is temacs will have to be made unshared so
- * that text and data are contiguous. Then once loadup is complete,
- * unexec will produce a shared executable where the data can be
- * at the normal shared text boundary and the startofdata variable
- * will be patched by unexec to the correct value.
- *
- */
-
-#ifndef start_of_data
-char *
-start_of_data (void)
-{
-#ifdef DATA_START
- return ((char *) DATA_START);
-#else
-#ifdef ORDINARY_LINK
- /*
- * This is a hack. Since we're not linking crt0.c or pre_crt0.c,
- * data_start isn't defined. We take the address of environ, which
- * is known to live at or near the start of the system crt0.c, and
- * we don't sweat the handful of bytes that might lose.
- */
- extern char **environ;
-
- return ((char *) &environ);
-#else
- extern int data_start;
- return ((char *) &data_start);
-#endif /* ORDINARY_LINK */
-#endif /* DATA_START */
-}
-#endif /* start_of_data */
-#endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */
-\f
/* init_system_name sets up the string for the Lisp function
system-name to return. */
/* XXX This needs to be updated for multi-tty support. Is there
anybody who needs to emulate select these days? */
int nread, i;
- extern int quit_char;
if (read_socket_hook)
{
#include <unistd.h>
#include <fcntl.h>
-extern char *start_of_text (void); /* Start of text */
+char *start_of_text (void); /* Start of text */
extern char *start_of_data (void); /* Start of initialized data */
extern int _data;
return 0;
}
+/*
+ * Return the address of the start of the text segment prior to
+ * doing an unexec. After unexec the return value is undefined.
+ * See crt0.c for further explanation and _start.
+ *
+ */
+
+char *
+start_of_text (void)
+{
+ return ((char *) 0x10000000);
+}
+
/* arch-tag: 0783857a-7c2d-456f-a426-58b722d69fd0
(do not change this comment) */
#define _RDATA ".rdata"
#define _SDATA ".sdata"
#define _SBSS ".sbss"
+#define TEXT_START 0x120000000
#endif /* __NetBSD__ || __OpenBSD__ */
+
static void fatal_unexec (char *, char *);
static void mark_x (char *);
return 0;
}
+extern unsigned start __asm__ ("start");
+
+/*
+ * Return the address of the start of the text segment prior to
+ * doing an unexec. After unexec the return value is undefined.
+ * See crt0.c for further explanation and _start.
+ *
+ */
+
+char *
+start_of_text (void)
+{
+ return ((char *) &start);
+}
+
/* ****************************************************************
* unexec
*
(*warn_function) ("Warning: memory in use exceeds lisp pointer size");
}
\f
+#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC)
+/* Some systems that cannot dump also cannot implement these. */
+
+/*
+ * Return the address of the start of the data segment prior to
+ * doing an unexec. After unexec the return value is undefined.
+ * See crt0.c for further information and definition of data_start.
+ *
+ * Apparently, on BSD systems this is etext at startup. On
+ * USG systems (swapping) this is highly mmu dependent and
+ * is also dependent on whether or not the program is running
+ * with shared text. Generally there is a (possibly large)
+ * gap between end of text and start of data with shared text.
+ *
+ */
+
+POINTER
+start_of_data (void)
+{
+#ifdef BSD_SYSTEM
+ extern char etext;
+ return (POINTER)(&etext);
+#elif defined DATA_START
+ return ((POINTER) DATA_START);
+#elif defined ORDINARY_LINK
+ /*
+ * This is a hack. Since we're not linking crt0.c or pre_crt0.c,
+ * data_start isn't defined. We take the address of environ, which
+ * is known to live at or near the start of the system crt0.c, and
+ * we don't sweat the handful of bytes that might lose.
+ */
+ extern char **environ;
+ return ((POINTER) &environ);
+#else
+ extern int data_start;
+ return ((POINTER) &data_start);
+#endif
+}
+#endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */
+\f
/* Enable memory usage warnings.
START says where the end of pure storage is.
WARNFUN specifies the function to call to issue a warning. */