From bd287517b6b4d8ab4f24edd5d9c4e8e9e43b58a3 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 4 Mar 1996 20:41:28 +0000 Subject: [PATCH] Changes to allow microcode to be compiled by the Linux ELF gcc. --- v7/src/microcode/s/linux.h | 20 +++--------- v7/src/microcode/uxtop.c | 64 ++------------------------------------ 2 files changed, 7 insertions(+), 77 deletions(-) diff --git a/v7/src/microcode/s/linux.h b/v7/src/microcode/s/linux.h index 8b21543ad..97f6e33a6 100644 --- a/v7/src/microcode/s/linux.h +++ b/v7/src/microcode/s/linux.h @@ -1,9 +1,9 @@ /* -*-C-*- System file for Linux -$Id: linux.h,v 1.6 1995/10/06 06:45:24 cph Exp $ +$Id: linux.h,v 1.7 1996/03/04 20:38:54 cph Exp $ -Copyright (c) 1995 Massachusetts Institute of Technology +Copyright (c) 1995-96 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -35,8 +35,6 @@ MIT in each case. */ #define LIBX11_MACHINE -L/usr/X11/lib -#define LIBS_TERMCAP -ltermcap - #define LIB_DEBUG #define ALTERNATE_M4 s/ultrix.m4 @@ -55,20 +53,12 @@ MIT in each case. */ patch, because one of these days a.out won't be supported, but hopefully by then we'll know how to fix this correctly. */ -#if 0 #ifdef __ELF__ -#define C_SWITCH_SYSTEM -D_LINUX_ELF #define M4_SWITCH_SYSTEM -P "define(LINUX_ELF,1)" +#define LD_SWITCH_SYSTEM -T s/linuxelf.lds +#define LIBS_TERMCAP -lncurses #else -#define C_SWITCH_SYSTEM #define M4_SWITCH_SYSTEM -#endif -#endif - -#ifdef __ELF__ -#define C_SWITCH_SYSTEM -b i486-linuxaout -#define LD_SWITCH_SYSTEM -b i486-linuxaout -#else -#define C_SWITCH_SYSTEM #define LD_SWITCH_SYSTEM +#define LIBS_TERMCAP -ltermcap #endif diff --git a/v7/src/microcode/uxtop.c b/v7/src/microcode/uxtop.c index b553230fc..4ece1f0cb 100644 --- a/v7/src/microcode/uxtop.c +++ b/v7/src/microcode/uxtop.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: uxtop.c,v 1.17 1995/10/05 03:34:14 cph Exp $ +$Id: uxtop.c,v 1.18 1996/03/04 20:41:28 cph Exp $ -Copyright (c) 1990-95 Massachusetts Institute of Technology +Copyright (c) 1990-96 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -41,12 +41,6 @@ MIT in each case. */ #include "config.h" #include "extern.h" -#ifdef _LINUX_ELF -#include -#include -static void EXFUN (initialize_linux_elf_segments, (void)); -#endif - extern void EXFUN (UX_initialize_channels, (void)); extern void EXFUN (UX_initialize_ctty, (int interactive)); extern void EXFUN (UX_initialize_directory_reader, (void)); @@ -117,9 +111,6 @@ DEFUN_VOID (OS_initialize) #ifdef _SUNOS vadvise (VA_ANOM); /* Anomolous paging, don't try to guess. */ #endif -#ifdef _LINUX_ELF - initialize_linux_elf_segments (); -#endif } void @@ -431,54 +422,3 @@ OS_syserr_names (unsigned int * length, unsigned char *** names) (*length) = ((sizeof (syserr_names_table)) / (sizeof (char *))); (*names) = ((unsigned char **) syserr_names_table); } - -/* Special hacking for Linux ELF memory management. */ - -#ifdef _LINUX_ELF - -extern unsigned short Scheme_Code_Segment_Selector; -extern unsigned short Scheme_Data_Segment_Selector; -extern unsigned short Scheme_Stack_Segment_Selector; - -static _syscall3 (int, modify_ldt, int, func, void *, buffer, unsigned long, nbytes) - -static void -DEFUN_VOID (initialize_linux_elf_segments) -{ - struct modify_ldt_ldt_s mldt; - - (mldt . entry_number) = 1; - (mldt . base_addr) = LINUX_ELF_DATA_SEGMENT_START; - (mldt . limit) = LINUX_ELF_DATA_SEGMENT_LIMIT; - (mldt . seg_32bit) = 1; - (mldt . contents) = MODIFY_LDT_CONTENTS_CODE; - (mldt . read_exec_only) = 1; - (mldt . limit_in_pages) = 1; - (mldt . seg_not_present) = 0; - if ((modify_ldt (1, (&mldt), (sizeof (mldt)))) != 0) - { - outf_fatal ("\n%s: unable to allocate code segment descriptor\n", - scheme_program_name); - Microcode_Termination (TERM_EXIT); - } - Scheme_Code_Segment_Selector = (((mldt . entry_number) << 3) | 0x7); - - (mldt . entry_number) = 2; - (mldt . base_addr) = LINUX_ELF_DATA_SEGMENT_START; - (mldt . limit) = LINUX_ELF_DATA_SEGMENT_LIMIT; - (mldt . seg_32bit) = 1; - (mldt . contents) = MODIFY_LDT_CONTENTS_DATA; - (mldt . read_exec_only) = 0; - (mldt . limit_in_pages) = 1; - (mldt . seg_not_present) = 0; - if ((modify_ldt (1, (&mldt), (sizeof (mldt)))) != 0) - { - outf_fatal ("\n%s: unable to allocate data segment descriptor\n", - scheme_program_name); - Microcode_Termination (TERM_EXIT); - } - Scheme_Data_Segment_Selector = (((mldt . entry_number) << 3) | 0x7); - Scheme_Stack_Segment_Selector = Scheme_Data_Segment_Selector; -} - -#endif /* _LINUX_ELF */ -- 2.25.1