emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100749: Simplify start_of_data, st


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100749: Simplify start_of_data, start_of_text and related code.
Date: Wed, 07 Jul 2010 20:03:52 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100749
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Wed 2010-07-07 20:03:52 -0700
message:
  Simplify start_of_data, start_of_text and related code.
  * 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.
modified:
  admin/CPP-DEFINES
  src/ChangeLog
  src/m/alpha.h
  src/m/ia64.h
  src/m/ibmrs6000.h
  src/m/intel386.h
  src/m/iris4d.h
  src/m/m68k.h
  src/m/macppc.h
  src/m/mips.h
  src/mem-limits.h
  src/s/darwin.h
  src/s/hpux10-20.h
  src/s/msdos.h
  src/sysdep.c
  src/unexaix.c
  src/unexalpha.c
  src/unexec.c
  src/vm-limit.c
=== modified file 'admin/CPP-DEFINES'
--- a/admin/CPP-DEFINES 2010-07-07 22:18:28 +0000
+++ b/admin/CPP-DEFINES 2010-07-08 03:03:52 +0000
@@ -186,7 +186,6 @@
 HAVE_SYS_TIME_H
 HAVE_TCATTR
 HAVE_TERMIOS_H
-HAVE_TEXT_START
 HAVE_TIMEVAL
 HAVE_TM_ZONE
 HAVE_TZSET
@@ -262,7 +261,6 @@
 TAB3
 TABDLY
 TERM
-TEXT_START
 THIS_IS_CONFIGURE
 TIME_WITH_SYS_TIME
 TIOCSIGSEND

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-07-07 22:18:28 +0000
+++ b/src/ChangeLog     2010-07-08 03:03:52 +0000
@@ -1,3 +1,34 @@
+2010-07-08  Dan Nicolaescu  <address@hidden>
+
+       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  <address@hidden>
 
        * alloc.c (overrun_check_malloc, overrun_check_realloc)

=== modified file 'src/m/alpha.h'
--- a/src/m/alpha.h     2010-06-30 02:48:54 +0000
+++ b/src/m/alpha.h     2010-07-08 03:03:52 +0000
@@ -53,14 +53,9 @@
 #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__ */

=== modified file 'src/m/ia64.h'
--- a/src/m/ia64.h      2010-06-03 05:29:02 +0000
+++ b/src/m/ia64.h      2010-07-08 03:03:52 +0000
@@ -58,7 +58,5 @@
 #endif /* not _MALLOC_INTERNAL */
 #endif /* REL_ALLOC */
 
-#define HAVE_TEXT_START
-
 /* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66
    (do not change this comment) */

=== modified file 'src/m/ibmrs6000.h'
--- a/src/m/ibmrs6000.h 2010-05-12 02:37:59 +0000
+++ b/src/m/ibmrs6000.h 2010-07-08 03:03:52 +0000
@@ -22,7 +22,6 @@
 /* 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

=== modified file 'src/m/intel386.h'
--- a/src/m/intel386.h  2010-05-12 02:37:59 +0000
+++ b/src/m/intel386.h  2010-07-08 03:03:52 +0000
@@ -23,10 +23,6 @@
    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 ()

=== modified file 'src/m/iris4d.h'
--- a/src/m/iris4d.h    2010-05-12 02:37:59 +0000
+++ b/src/m/iris4d.h    2010-07-08 03:03:52 +0000
@@ -30,8 +30,6 @@
    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).  */

=== modified file 'src/m/m68k.h'
--- a/src/m/m68k.h      2010-05-12 02:37:59 +0000
+++ b/src/m/m68k.h      2010-07-08 03:03:52 +0000
@@ -41,7 +41,6 @@
 #endif
 
 #define NO_REMAP
-#define TEXT_START 0
 #endif
 
 /* arch-tag: 4eadd161-b4e8-4b82-82a1-e4ce7f42969d

=== modified file 'src/m/macppc.h'
--- a/src/m/macppc.h    2010-05-19 02:42:04 +0000
+++ b/src/m/macppc.h    2010-07-08 03:03:52 +0000
@@ -28,10 +28,6 @@
 /* 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

=== modified file 'src/m/mips.h'
--- a/src/m/mips.h      2010-05-12 02:37:59 +0000
+++ b/src/m/mips.h      2010-07-08 03:03:52 +0000
@@ -31,8 +31,5 @@
    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) */

=== modified file 'src/mem-limits.h'
--- a/src/mem-limits.h  2010-07-05 04:52:39 +0000
+++ b/src/mem-limits.h  2010-07-08 03:03:52 +0000
@@ -25,17 +25,6 @@
 /* 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>
@@ -54,7 +43,6 @@
 #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.  */
@@ -77,26 +65,5 @@
 #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) */

=== modified file 'src/s/darwin.h'
--- a/src/s/darwin.h    2010-06-30 02:48:54 +0000
+++ b/src/s/darwin.h    2010-07-08 03:03:52 +0000
@@ -117,9 +117,6 @@
 /* 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

=== modified file 'src/s/hpux10-20.h'
--- a/src/s/hpux10-20.h 2010-06-06 08:57:39 +0000
+++ b/src/s/hpux10-20.h 2010-07-08 03:03:52 +0000
@@ -131,7 +131,6 @@
 #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

=== modified file 'src/s/msdos.h'
--- a/src/s/msdos.h     2010-07-07 22:18:28 +0000
+++ b/src/s/msdos.h     2010-07-08 03:03:52 +0000
@@ -75,7 +75,6 @@
 #define _longjmp longjmp
 
 #define DATA_START  (&etext + 1)
-#define TEXT_START  &start
 
 #define _NAIVE_DOS_REGS
 

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2010-07-07 22:18:28 +0000
+++ b/src/sysdep.c      2010-07-08 03:03:52 +0000
@@ -79,9 +79,6 @@
 #include "dosfns.h"
 #include "msdos.h"
 #include <sys/param.h>
-
-extern int etext;
-extern unsigned start __asm__ ("start");
 #endif
 
 #include <sys/file.h>
@@ -1511,83 +1508,6 @@
 }
 #endif /* HAVE_PTYS */
 
-#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) */
-
 /* init_system_name sets up the string for the Lisp function
    system-name to return. */
 
@@ -1912,7 +1832,6 @@
   /* 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)
     {

=== modified file 'src/unexaix.c'
--- a/src/unexaix.c     2010-04-02 03:10:33 +0000
+++ b/src/unexaix.c     2010-07-08 03:03:52 +0000
@@ -71,7 +71,7 @@
 #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;
@@ -669,5 +669,18 @@
   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) */

=== modified file 'src/unexalpha.c'
--- a/src/unexalpha.c   2010-07-07 22:18:28 +0000
+++ b/src/unexalpha.c   2010-07-08 03:03:52 +0000
@@ -79,8 +79,10 @@
 #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 *);
 

=== modified file 'src/unexec.c'
--- a/src/unexec.c      2010-07-07 22:18:28 +0000
+++ b/src/unexec.c      2010-07-08 03:03:52 +0000
@@ -687,6 +687,21 @@
   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
  *

=== modified file 'src/vm-limit.c'
--- a/src/vm-limit.c    2010-07-05 16:29:35 +0000
+++ b/src/vm-limit.c    2010-07-08 03:03:52 +0000
@@ -244,6 +244,46 @@
     (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
 }
 
+#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) */
+
 /* Enable memory usage warnings.
    START says where the end of pure storage is.
    WARNFUN specifies the function to call to issue a warning.  */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]