aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-07 20:03:52 -0700
committerDan Nicolaescu2010-07-07 20:03:52 -0700
commit313d9eb21863418cb91328c3d5ef0c2d356fc483 (patch)
tree87aa5f39b43cc9c308839047bc83345d518f5d0a /src/sysdep.c
parentd734dbbd24fca96383d2583c36d2a805181cf306 (diff)
downloademacs-313d9eb21863418cb91328c3d5ef0c2d356fc483.tar.gz
emacs-313d9eb21863418cb91328c3d5ef0c2d356fc483.zip
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.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index cfa0efa7e87..ecdb7fcc21b 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -79,9 +79,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
79#include "dosfns.h" 79#include "dosfns.h"
80#include "msdos.h" 80#include "msdos.h"
81#include <sys/param.h> 81#include <sys/param.h>
82
83extern int etext;
84extern unsigned start __asm__ ("start");
85#endif 82#endif
86 83
87#include <sys/file.h> 84#include <sys/file.h>
@@ -1511,83 +1508,6 @@ setup_pty (int fd)
1511} 1508}
1512#endif /* HAVE_PTYS */ 1509#endif /* HAVE_PTYS */
1513 1510
1514#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC)
1515/* Some systems that cannot dump also cannot implement these. */
1516
1517/*
1518 * Return the address of the start of the text segment prior to
1519 * doing an unexec. After unexec the return value is undefined.
1520 * See crt0.c for further explanation and _start.
1521 *
1522 */
1523
1524#if !(defined (__NetBSD__) && defined (__ELF__))
1525#ifndef HAVE_TEXT_START
1526char *
1527start_of_text (void)
1528{
1529#ifdef TEXT_START
1530 return ((char *) TEXT_START);
1531#else
1532 extern int _start ();
1533 return ((char *) _start);
1534#endif /* TEXT_START */
1535}
1536#endif /* not HAVE_TEXT_START */
1537#endif
1538
1539/*
1540 * Return the address of the start of the data segment prior to
1541 * doing an unexec. After unexec the return value is undefined.
1542 * See crt0.c for further information and definition of data_start.
1543 *
1544 * Apparently, on BSD systems this is etext at startup. On
1545 * USG systems (swapping) this is highly mmu dependent and
1546 * is also dependent on whether or not the program is running
1547 * with shared text. Generally there is a (possibly large)
1548 * gap between end of text and start of data with shared text.
1549 *
1550 * On Uniplus+ systems with shared text, data starts at a
1551 * fixed address. Each port (from a given oem) is generally
1552 * different, and the specific value of the start of data can
1553 * be obtained via the UniPlus+ specific "uvar" system call,
1554 * however the method outlined in crt0.c seems to be more portable.
1555 *
1556 * Probably what will have to happen when a USG unexec is available,
1557 * at least on UniPlus, is temacs will have to be made unshared so
1558 * that text and data are contiguous. Then once loadup is complete,
1559 * unexec will produce a shared executable where the data can be
1560 * at the normal shared text boundary and the startofdata variable
1561 * will be patched by unexec to the correct value.
1562 *
1563 */
1564
1565#ifndef start_of_data
1566char *
1567start_of_data (void)
1568{
1569#ifdef DATA_START
1570 return ((char *) DATA_START);
1571#else
1572#ifdef ORDINARY_LINK
1573 /*
1574 * This is a hack. Since we're not linking crt0.c or pre_crt0.c,
1575 * data_start isn't defined. We take the address of environ, which
1576 * is known to live at or near the start of the system crt0.c, and
1577 * we don't sweat the handful of bytes that might lose.
1578 */
1579 extern char **environ;
1580
1581 return ((char *) &environ);
1582#else
1583 extern int data_start;
1584 return ((char *) &data_start);
1585#endif /* ORDINARY_LINK */
1586#endif /* DATA_START */
1587}
1588#endif /* start_of_data */
1589#endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */
1590
1591/* init_system_name sets up the string for the Lisp function 1511/* init_system_name sets up the string for the Lisp function
1592 system-name to return. */ 1512 system-name to return. */
1593 1513
@@ -1912,7 +1832,6 @@ read_input_waiting (void)
1912 /* XXX This needs to be updated for multi-tty support. Is there 1832 /* XXX This needs to be updated for multi-tty support. Is there
1913 anybody who needs to emulate select these days? */ 1833 anybody who needs to emulate select these days? */
1914 int nread, i; 1834 int nread, i;
1915 extern int quit_char;
1916 1835
1917 if (read_socket_hook) 1836 if (read_socket_hook)
1918 { 1837 {