Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2008 12:47:45 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 152012 for review
Message-ID:  <200810271247.m9RCljno004112@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152012

Change 152012 by bz@bz_dumpster on 2008/10/27 12:47:24

	Make things _compile_ again.
	Lots of placeholders and bogus code.

Affected files ...

.. //depot/projects/s390/Makefile#15 edit
.. //depot/projects/s390/Makefile.inc1#24 edit
.. //depot/projects/s390/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c#2 edit
.. //depot/projects/s390/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c#2 edit
.. //depot/projects/s390/cddl/lib/libzpool/Makefile#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/freebsd.h#3 edit
.. //depot/projects/s390/contrib/gcc/config/s390/s390.h#6 edit
.. //depot/projects/s390/gnu/lib/libgomp/Makefile#2 edit
.. //depot/projects/s390/gnu/usr.bin/Makefile#10 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/ld/Makefile.s390#4 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/ld/Makefile.s390x#4 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/libbfd/Makefile#9 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/libbfd/Makefile.s390#3 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/libbfd/Makefile.s390x#3 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/libbfd/bfd.h#3 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/libbfd/s390/bfd.h#4 delete
.. //depot/projects/s390/gnu/usr.bin/binutils/libbfd/s390x/bfd.h#4 delete
.. //depot/projects/s390/gnu/usr.bin/binutils/libiberty/Makefile#5 edit
.. //depot/projects/s390/gnu/usr.bin/cc/cc_tools/Makefile#10 edit
.. //depot/projects/s390/gnu/usr.bin/gdb/arch/s390/Makefile#1 add
.. //depot/projects/s390/gnu/usr.bin/gdb/arch/s390/config.h#1 add
.. //depot/projects/s390/gnu/usr.bin/gdb/arch/s390/init.c#1 add
.. //depot/projects/s390/lib/bind/config.mk#4 edit
.. //depot/projects/s390/lib/libc/Makefile#12 edit
.. //depot/projects/s390/lib/libc/gen/tls.c#4 edit
.. //depot/projects/s390/lib/libc/gmon/gmon.c#9 edit
.. //depot/projects/s390/lib/libc/s390/Makefile.inc#3 edit
.. //depot/projects/s390/lib/libc/s390/Symbol.map#1 add
.. //depot/projects/s390/lib/libc/s390/_fpmath.h#3 edit
.. //depot/projects/s390/lib/libc/s390/gd_qnan.h#1 add
.. //depot/projects/s390/lib/libc/s390/stdlib/gdtoa.mk#2 delete
.. //depot/projects/s390/lib/libc/s390/sys/Makefile.inc#3 edit
.. //depot/projects/s390/lib/libc/s390x/gd_qnan.h#1 add
.. //depot/projects/s390/lib/libc/stdlib/malloc.c#12 edit
.. //depot/projects/s390/lib/libkvm/kvm_s390.c#2 edit
.. //depot/projects/s390/lib/libkvm/kvm_s390x.c#2 edit
.. //depot/projects/s390/lib/libthr/arch/s390/Makefile.inc#1 add
.. //depot/projects/s390/lib/libthr/arch/s390/include/pthread_md.h#1 add
.. //depot/projects/s390/lib/libthr/arch/s390/s390/pthread_md.c#1 add
.. //depot/projects/s390/lib/libthr/thread/thr_getschedparam.c#2 integrate
.. //depot/projects/s390/lib/libthread_db/arch/s390/libpthread_md.c#1 add
.. //depot/projects/s390/lib/msun/Makefile#8 edit
.. //depot/projects/s390/lib/msun/s390/Makefile.inc#2 edit
.. //depot/projects/s390/lib/msun/s390/e_fmod.S#2 edit
.. //depot/projects/s390/lib/msun/s390/e_fmodf.S#2 edit
.. //depot/projects/s390/lib/msun/s390/e_hypot.S#2 edit
.. //depot/projects/s390/lib/msun/s390/e_hypotf.S#2 edit
.. //depot/projects/s390/lib/msun/s390/e_remainder.S#2 edit
.. //depot/projects/s390/lib/msun/s390/e_remainderf.S#2 edit
.. //depot/projects/s390/lib/msun/s390/e_sqrt.S#2 edit
.. //depot/projects/s390/lib/msun/s390/e_sqrtf.S#2 edit
.. //depot/projects/s390/lib/msun/s390/fenv.c#1 add
.. //depot/projects/s390/lib/msun/s390/fenv.h#1 add
.. //depot/projects/s390/lib/msun/s390/s_floor.S#2 edit
.. //depot/projects/s390/lib/msun/s390/s_rint.S#2 edit
.. //depot/projects/s390/libexec/rtld-aout/shlib.c#3 edit
.. //depot/projects/s390/libexec/rtld-aout/shlib.h#2 edit
.. //depot/projects/s390/libexec/rtld-elf/s390/reloc.c#7 edit
.. //depot/projects/s390/libexec/rtld-elf/s390/rtld_machdep.h#4 edit
.. //depot/projects/s390/sbin/ldconfig/Makefile#3 edit
.. //depot/projects/s390/secure/lib/libcrypto/opensslconf-s390.h#3 edit
.. //depot/projects/s390/secure/lib/libcrypto/opensslconf-s390x.h#3 edit
.. //depot/projects/s390/share/mk/bsd.endian.mk#3 edit
.. //depot/projects/s390/sys/boot/Makefile#10 edit
.. //depot/projects/s390/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c#2 edit
.. //depot/projects/s390/sys/cddl/compat/opensolaris/sys/atomic.h#2 edit
.. //depot/projects/s390/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h#2 edit
.. //depot/projects/s390/sys/conf/Makefile.s390#5 edit
.. //depot/projects/s390/sys/conf/files.s390#6 edit
.. //depot/projects/s390/sys/conf/kern.mk#8 edit
.. //depot/projects/s390/sys/s390/conf/GENERIC#11 edit
.. //depot/projects/s390/sys/s390/include/_bus.h#1 add
.. //depot/projects/s390/sys/s390/include/_limits.h#2 edit
.. //depot/projects/s390/sys/s390/include/_types.h#4 edit
.. //depot/projects/s390/sys/s390/include/asm.h#2 edit
.. //depot/projects/s390/sys/s390/include/atomic.h#2 edit
.. //depot/projects/s390/sys/s390/include/bus.h#2 edit
.. //depot/projects/s390/sys/s390/include/cpu.h#3 edit
.. //depot/projects/s390/sys/s390/include/cpufunc.h#3 edit
.. //depot/projects/s390/sys/s390/include/float.h#3 edit
.. //depot/projects/s390/sys/s390/include/kdb.h#1 add
.. //depot/projects/s390/sys/s390/include/memdev.h#1 add
.. //depot/projects/s390/sys/s390/include/pcb.h#2 edit
.. //depot/projects/s390/sys/s390/include/pcpu.h#2 edit
.. //depot/projects/s390/sys/s390/include/pmap.h#4 edit
.. //depot/projects/s390/sys/s390/include/pmc_mdep.h#1 add
.. //depot/projects/s390/sys/s390/include/proc.h#2 edit
.. //depot/projects/s390/sys/s390/include/profile.h#2 edit
.. //depot/projects/s390/sys/s390/include/signal.h#5 edit
.. //depot/projects/s390/sys/s390/include/stdarg.h#2 edit
.. //depot/projects/s390/sys/s390/include/sysarch.h#3 edit
.. //depot/projects/s390/sys/s390/include/vmparam.h#2 edit
.. //depot/projects/s390/sys/s390/s390/clock.c#6 edit
.. //depot/projects/s390/sys/s390/s390/dump_machdep.c#4 edit
.. //depot/projects/s390/sys/s390/s390/elf_machdep.c#7 edit
.. //depot/projects/s390/sys/s390/s390/hmcsc.c#9 edit
.. //depot/projects/s390/sys/s390/s390/identcpu.c#7 edit
.. //depot/projects/s390/sys/s390/s390/machdep.c#12 edit
.. //depot/projects/s390/sys/s390/s390/mem.c#8 edit
.. //depot/projects/s390/sys/s390/s390/pmap.c#18 edit
.. //depot/projects/s390/sys/s390/s390/support.S#4 edit
.. //depot/projects/s390/sys/s390/s390/sys_machdep.c#5 edit
.. //depot/projects/s390/sys/s390/s390/trap.c#12 edit
.. //depot/projects/s390/sys/s390/s390/uio_machdep.c#1 add
.. //depot/projects/s390/sys/s390/s390/vm_machdep.c#11 edit
.. //depot/projects/s390/sys/s390x/include/_types.h#3 edit
.. //depot/projects/s390/sys/sys/priv.h#2 edit
.. //depot/projects/s390/usr.sbin/Makefile#18 edit

Differences ...

==== //depot/projects/s390/Makefile#15 (text+ko) ====

@@ -275,7 +275,7 @@
 # existing system is.
 #
 .if make(universe)
-TARGETS?=amd64 arm i386 ia64 pc98 powerpc sparc64 sun4v
+TARGETS?=amd64 arm i386 ia64 pc98 powerpc s390 s390x sparc64 sun4v
 
 universe: universe_prologue
 universe_prologue:

==== //depot/projects/s390/Makefile.inc1#24 (text+ko) ====

@@ -125,7 +125,7 @@
 TARGET?=	${MACHINE}
 TARGET_ARCH?=	${MACHINE_ARCH}
 
-KNOWN_ARCHES?=	amd64 arm i386 i386/pc98 ia64 mips powerpc sparc64 sparc64/sun4v
+KNOWN_ARCHES?=	amd64 arm i386 i386/pc98 ia64 mips powerpc s390 s390x sparc64 sparc64/sun4v
 .if ${TARGET} == ${TARGET_ARCH}
 _t=		${TARGET}
 .else

==== //depot/projects/s390/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c#2 (text+ko) ====

@@ -250,6 +250,12 @@
 			    dofr[j].dofr_offset + 4;
 			rel->r_info = ELF32_R_INFO(count + dep->de_global,
 			    R_SPARC_32);
+#elif defined(__s390__) && !defined(__s390x__)
+/* XXX */
+printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
+#elif defined(__s390x__)
+/* XXX */
+printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
 #else
 #error unknown ISA
 #endif
@@ -432,6 +438,10 @@
 			    dofr[j].dofr_offset;
 			rel->r_info = ELF64_R_INFO(count + dep->de_global,
 			    R_SPARC_64);
+#elif defined(__s390__) && !defined(__s390x__)
+/* XXX */
+#elif defined(__s390x__)
+/* XXX */
 #else
 #error unknown ISA
 #endif
@@ -530,6 +540,8 @@
 	elf_file.ehdr.e_machine = EM_MIPS;
 #elif defined(__powerpc__)
 	elf_file.ehdr.e_machine = EM_PPC;
+#elif defined(__s390__)
+	elf_file.ehdr.e_machine = EM_S390;
 #elif defined(__sparc)
 	elf_file.ehdr.e_machine = EM_SPARC;
 #elif defined(__i386) || defined(__amd64)
@@ -678,6 +690,8 @@
 	elf_file.ehdr.e_machine = EM_MIPS;
 #elif defined(__powerpc__)
 	elf_file.ehdr.e_machine = EM_PPC;
+#elif defined(__s390__)
+	elf_file.ehdr.e_machine = EM_S390;
 #elif defined(__sparc)
 	elf_file.ehdr.e_machine = EM_SPARCV9;
 #elif defined(__i386) || defined(__amd64)
@@ -831,6 +845,26 @@
 	return (0);
 }
 
+#elif defined(__s390__) && !defined(__s390x__)
+/* XXX */
+static int
+dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
+    uint32_t *off)
+{
+printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
+	return (0);
+}
+
+#elif defined(__s390x__)
+/* XXX */
+static int
+dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
+    uint32_t *off)
+{
+printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
+	return (0);
+}
+
 #elif defined(__sparc)
 
 #define	DT_OP_RET		0x81c7e008
@@ -1139,6 +1173,8 @@
 		emachine1 = emachine2 = EM_MIPS;
 #elif defined(__powerpc__)
 		emachine1 = emachine2 = EM_PPC64;
+#elif defined(__s390__)
+		emachine1 = emachine2 = EM_S390;
 #elif defined(__sparc)
 		emachine1 = emachine2 = EM_SPARCV9;
 #elif defined(__i386) || defined(__amd64)
@@ -1153,6 +1189,8 @@
 		emachine1 = emachine2 = EM_MIPS;
 #elif defined(__powerpc__)
 		emachine1 = emachine2 = EM_PPC;
+#elif defined(__s390__)
+		emachine1 = emachine2 = EM_S390;
 #elif defined(__sparc)
 		emachine1 = EM_SPARC;
 		emachine2 = EM_SPARC32PLUS;

==== //depot/projects/s390/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c#2 (text+ko) ====

@@ -306,7 +306,8 @@
 	case sizeof (double):
 		return (dt_printf(dtp, fp, format,
 		    *((double *)addr) / n));
-#if !defined(__arm__) && !defined(__powerpc__) && !defined(__mips__)
+#if !defined(__arm__) && !defined(__powerpc__) && !defined(__mips__) && \
+    (!defined(__s390__) || defined(__s390x__))
 	case sizeof (long double):
 		return (dt_printf(dtp, fp, format,
 		    *((long double *)addr) / ldn));

==== //depot/projects/s390/cddl/lib/libzpool/Makefile#2 (text+ko) ====

@@ -11,7 +11,7 @@
 # LIST_SRCS
 .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os
 # ATOMIC_SRCS
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" # XXX-BZ || ${MACHINE_ARCH} == "s390"
 .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
 ATOMIC_SRCS=	atomic.S
 .else

==== //depot/projects/s390/contrib/gcc/config/s390/freebsd.h#3 (text+ko) ====

@@ -20,8 +20,8 @@
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#ifndef _FREEBSD_H
-#define _FREEBSD_H
+#ifndef _CONFIG_S390_FREEBSD_H
+#define _CONFIG_S390_FREEBSD_H
 
 /* Target specific version string.  */
 
@@ -33,7 +33,6 @@
 #define TARGET_VERSION fprintf (stderr, " (FreeBSD for S/390)");
 #endif
 
-
 /* Target specific type definitions.  */
 
 /* ??? Do we really want long as size_t on 31-bit?  */
@@ -51,15 +50,11 @@
 #undef DEFAULT_SIGNED_CHAR
 #define DEFAULT_SIGNED_CHAR 1
 
+
 /* Target specific assembler settings.  */
 
-#ifdef DEFAULT_TARGET_64BIT
 #undef  ASM_SPEC
-#define ASM_SPEC "%{m31:-m31 -Aesa}"
-#else
-#undef  ASM_SPEC
-#define ASM_SPEC "%{m64:-m64 -Aesame}"
-#endif
+#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}"
 
 
 /* Target specific linker settings.  */
@@ -70,130 +65,44 @@
 #define MULTILIB_DEFAULTS { "m31" }
 #endif
 
-#define LINK_ARCH31_SPEC \
-  "-m elf_s390 \
-   %{p:%nconsider using '-pg' instead of '-p' with gprof(1) } \
-   %{Wl,*:%*} \
-   %{v:-V} \
-   %{assert*} %{R*} %{rpath*} %{defsym*} \
-   %{shared:-Bshareable %{h*} %{soname*}} \
-   %{!shared: \
-      %{!static: \
-	%{rdynamic:-export-dynamic} \
-	%{!dynamic-linker:-dynamic-linker /libexec/ld-elf.so.1}} \
-      %{static:-Bstatic}} \
-   %{symbolic:-Bsymbolic}"
+#undef  SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+  { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
+
+#undef EXTRA_SPECS
+#define	EXTRA_SPECS \
+	SUBTARGET_EXTRA_SPECS
 
-#define LINK_ARCH64_SPEC \
-  "-m elf64_s390 \
+#undef  LINK_SPEC
+#define LINK_SPEC \
+  "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
    %{shared:-shared} \
    %{!shared: \
       %{static:-static} \
       %{!static: \
 	%{rdynamic:-export-dynamic} \
-	%{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}}}"
+	%{!dynamic-linker: \
+          %{m31:-dynamic-linker %(fbsd_dynamic_linker) } \
+          %{m64:-dynamic-linker %(fbsd_dynamic_linker) }}} \
+    %{static:-Bstatic}}"
 
-#ifdef DEFAULT_TARGET_64BIT
-#undef  LINK_SPEC
-#define LINK_SPEC "%{m31:%(link_arch31)} %{!m31:%(link_arch64)}"
-#else
-#undef  LINK_SPEC
-#define LINK_SPEC "%{m64:%(link_arch64)} %{!m64:%(link_arch31)}"
-#endif
+#define	MD_UNWIND_SUPPORT "config/s390/freebsd-unwind.h"
 
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
-/* This macro defines names of additional specifications to put in the specs
-   that can be used in various specifications like CC1_SPEC.  Its definition
-   is an initializer with a subgrouping for each command option.  */
+#ifdef TARGET_LIBC_PROVIDES_SSP
+/* s390 glibc provides __stack_chk_guard in 0x14(tp),
+   s390x glibc provides it at 0x28(tp).  */
+#define TARGET_THREAD_SSP_OFFSET        (TARGET_64BIT ? 0x28 : 0x14)
+#endif
 
-#define EXTRA_SPECS \
-  { "link_arch31",	LINK_ARCH31_SPEC },	\
-  { "link_arch64",	LINK_ARCH64_SPEC },	\
+/* Define if long doubles should be mangled as 'g'.  */
+#define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
 
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START "#"
-
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
-
-/* Do code reading to identify a signal frame, and set the frame
-   state data appropriately.  See unwind-dw2.c for the structs.  */
-
-#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS)		\
-  do {									\
-    unsigned char *pc_ = (CONTEXT)->ra;					\
-    long new_cfa_;							\
-    int i_;								\
-									\
-    typedef struct 							\
-      {									\
-        unsigned long psw_mask;						\
-        unsigned long psw_addr;						\
-        unsigned long gprs[16];						\
-        unsigned int  acrs[16];						\
-        unsigned int  fpc;						\
-        unsigned int  __pad;						\
-        double        fprs[16];						\
-      } __attribute__ ((__aligned__ (8))) sigregs_;			\
-									\
-    sigregs_ *regs_;							\
-									\
-    /* svc $__NR_sigreturn or svc $__NR_rt_sigreturn  */		\
-    if (pc_[0] != 0x0a || (pc_[1] != 119 && pc_[1] != 173))		\
-      break;								\
-									\
-    /* New-style RT frame:  						\
-	retcode + alignment (8 bytes)					\
-	siginfo (128 bytes)						\
-	ucontext (contains sigregs)  */					\
-    if ((CONTEXT)->ra == (CONTEXT)->cfa)				\
-      {									\
-	struct ucontext_						\
-	  {								\
-	    unsigned long     uc_flags;					\
-	    struct ucontext_ *uc_link;					\
-	    unsigned long     uc_stack[3];				\
-	    sigregs_          uc_mcontext;				\
-	  } *uc_ = (CONTEXT)->cfa + 8 + 128;				\
-									\
-	regs_ = &uc_->uc_mcontext;					\
-      }									\
-									\
-    /* Old-style RT frame and all non-RT frames:			\
-	old signal mask (8 bytes)					\
-	pointer to sigregs  */						\
-    else								\
-      {									\
-	regs_ = *(sigregs_ **)((CONTEXT)->cfa + 8);			\
-      }									\
-      									\
-    new_cfa_ = regs_->gprs[15] + 16*sizeof(long) + 32;			\
-    (FS)->cfa_how = CFA_REG_OFFSET;					\
-    (FS)->cfa_reg = 15;							\
-    (FS)->cfa_offset = 							\
-      new_cfa_ - (long) (CONTEXT)->cfa + 16*sizeof(long) + 32;		\
-									\
-    for (i_ = 0; i_ < 16; i_++)						\
-      {									\
-	(FS)->regs.reg[i_].how = REG_SAVED_OFFSET;			\
-	(FS)->regs.reg[i_].loc.offset = 				\
-	  (long)&regs_->gprs[i_] - new_cfa_;				\
-      }									\
-    for (i_ = 0; i_ < 16; i_++)						\
-      {									\
-	(FS)->regs.reg[16+i_].how = REG_SAVED_OFFSET;			\
-	(FS)->regs.reg[16+i_].loc.offset = 				\
-	  (long)&regs_->fprs[i_] - new_cfa_;				\
-      }									\
-									\
-    /* Load return addr from PSW into dummy register 32.  */		\
-    (FS)->regs.reg[32].how = REG_SAVED_OFFSET;				\
-    (FS)->regs.reg[32].loc.offset = (long)&regs_->psw_addr - new_cfa_;	\
-    (FS)->retaddr_column = 32;						\
-									\
-    goto SUCCESS;							\
-  } while (0)
+/* Override the default comment-starter of "/APP" from unix.h.  */
+#undef  ASM_APP_ON
+#define ASM_APP_ON	"#APP\n"
+#undef  ASM_APP_OFF
+#define ASM_APP_OFF	"#NO_APP\n"
 
 #endif

==== //depot/projects/s390/contrib/gcc/config/s390/s390.h#6 (text+ko) ====


==== //depot/projects/s390/gnu/lib/libgomp/Makefile#2 (text+ko) ====

@@ -24,7 +24,8 @@
 
 # Target-specific OpenMP configuration
 .if ${MACHINE_ARCH} == arm || ${MACHINE_ARCH} == i386 || \
-    ${MACHINE_ARCH} == mips || ${MACHINE_ARCH} == powerpc
+    ${MACHINE_ARCH} == mips || ${MACHINE_ARCH} == powerpc || \
+    ${MACHINE_ARCH} == s390
 OMP_LOCK_ALIGN	=	4
 OMP_LOCK_KIND=		4
 OMP_LOCK_SIZE=		4

==== //depot/projects/s390/gnu/usr.bin/Makefile#10 (text+ko) ====

@@ -23,7 +23,8 @@
 	sort \
 	${_texinfo}
 
-.if ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "s390" || \
+    ${MACHINE_ARCH} == "s390x"
 MK_GDB=no	# not yet
 .endif
 

==== //depot/projects/s390/gnu/usr.bin/binutils/ld/Makefile.s390#4 (text+ko) ====

@@ -1,29 +1,12 @@
 # $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile.s390,v 1.0 2002/05/17 03:10:33 tzukanov Exp $
 
-TARGET_TUPLE?=	s390-unknown-freebsd
+NATIVE_EMULATION=	elf_s390
 
-.if ${TARGET_ARCH} == "s390"
-NATIVE_EMULATION=	elf_s390
-HOST=	${TARGET_TUPLE}
-CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
-CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
-_s390_path=	\"${TOOLS_PREFIX}/lib\":\"${TOOLS_PREFIX}/usr/lib\"
-.else
-_s390_path=	\"/usr/cross/s390-freebsd/usr/lib\"
-.endif
-EMS+=		${NATIVE_EMULATION}
-LDSCRIPTS+=	${NATIVE_EMULATION}.x	\
-		${NATIVE_EMULATION}.xbn	\
-		${NATIVE_EMULATION}.xn	\
-		${NATIVE_EMULATION}.xr	\
-		${NATIVE_EMULATION}.xs	\
-		${NATIVE_EMULATION}.xu	\
-		${NATIVE_EMULATION}.xsc
 SRCS+=		e${NATIVE_EMULATION}.c
 CLEANFILES+=	e${NATIVE_EMULATION}.c
-
 e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \
     scripttempl/elf.sc genscripts.sh stringify.sed
-	sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_s390_path} \
+	sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \
+	    ${TOOLS_PREFIX}/usr \
 	    ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
-	    ${NATIVE_EMULATION} ""  ${NATIVE_EMULATION} ${TARGET_TUPLE}
+	    ${NATIVE_EMULATION} ""  no ${NATIVE_EMULATION} ${TARGET_TUPLE}

==== //depot/projects/s390/gnu/usr.bin/binutils/ld/Makefile.s390x#4 (text+ko) ====

@@ -1,29 +1,12 @@
 # $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile.s390x,v 1.0 2002/05/17 03:10:33 tzukanov Exp $
 
-TARGET_TUPLE?=	s390x-unknown-freebsd
+NATIVE_EMULATION=	elf64_s390
 
-.if ${TARGET_ARCH} == "s390x"
-NATIVE_EMULATION=	elf64_s390
-HOST=	${TARGET_TUPLE}
-CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
-CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
-_s390x_path=	\"${TOOLS_PREFIX}/lib\":\"${TOOLS_PREFIX}/usr/lib\"
-.else
-_s390x_path=	\"/usr/cross/s390x-freebsd/usr/lib\"
-.endif
-EMS+=		${NATIVE_EMULATION}
-LDSCRIPTS+=	${NATIVE_EMULATION}.x	\
-		${NATIVE_EMULATION}.xbn	\
-		${NATIVE_EMULATION}.xn	\
-		${NATIVE_EMULATION}.xr	\
-		${NATIVE_EMULATION}.xs	\
-		${NATIVE_EMULATION}.xu	\
-		${NATIVE_EMULATION}.xsc
 SRCS+=		e${NATIVE_EMULATION}.c
 CLEANFILES+=	e${NATIVE_EMULATION}.c
-
 e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \
     scripttempl/elf.sc genscripts.sh stringify.sed
-	sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_s390x_path} \
+	sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \
+	    ${TOOLS_PREFIX}/usr \
 	    ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
-	    ${NATIVE_EMULATION} ""  ${NATIVE_EMULATION} ${TARGET_TUPLE}
+	    ${NATIVE_EMULATION} ""  no ${NATIVE_EMULATION} ${TARGET_TUPLE}

==== //depot/projects/s390/gnu/usr.bin/binutils/libbfd/Makefile#9 (text+ko) ====


==== //depot/projects/s390/gnu/usr.bin/binutils/libbfd/Makefile.s390#3 (text+ko) ====

@@ -13,7 +13,4 @@
 .if ${TARGET_ARCH} == "s390"
 CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
 .endif
-CLEANFILES+=	elf32-target.h
 
-elf32-target.h: elfxx-target.h
-	sed -e s/NN/32/g ${.ALLSRC} > ${.TARGET}

==== //depot/projects/s390/gnu/usr.bin/binutils/libbfd/Makefile.s390x#3 (text+ko) ====

@@ -17,10 +17,4 @@
 .if ${TARGET_ARCH} == "s390x"
 CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
 .endif
-CLEANFILES+=	elf32-target.h elf64-target.h
-
-elf32-target.h: elfxx-target.h
-	sed -e s/NN/32/g ${.ALLSRC} > ${.TARGET}
 
-elf64-target.h: elfxx-target.h
-	sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET}

==== //depot/projects/s390/gnu/usr.bin/binutils/libbfd/bfd.h#3 (text+ko) ====

@@ -57,11 +57,13 @@
 #define BFD_ARCH_SIZE 64
 
 
-#if defined(__i386__) || defined(__powerpc__) || defined(__arm__)
+#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) || \
+	(defined(__s390__) && !defined(__s390x__))
 #define BFD_HOST_64BIT_LONG 0
 #define BFD_HOST_64_BIT long long
 #define BFD_HOST_U_64_BIT unsigned long long
-#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__ia64__)
+#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || \
+	defined(__ia64__) || defined(__s390x__)
 #define BFD_HOST_64BIT_LONG 1
 #define BFD_HOST_64_BIT long
 #define BFD_HOST_U_64_BIT unsigned long

==== //depot/projects/s390/gnu/usr.bin/binutils/libiberty/Makefile#5 (text+ko) ====


==== //depot/projects/s390/gnu/usr.bin/cc/cc_tools/Makefile#10 (text+ko) ====

@@ -59,6 +59,9 @@
 .if ${TARGET_ARCH} == "arm"
 TARGET_INC+=	${GCC_CPU}/arm.h
 .endif
+.if ${TARGET_ARCH} == "s390"
+TARGET_INC+=	${GCC_CPU}/s390.h
+.endif
 .if ${TARGET_ARCH} == "s390x"
 TARGET_INC+=	${GCC_CPU}/s390x.h
 .endif

==== //depot/projects/s390/lib/bind/config.mk#4 (text+ko) ====

@@ -45,7 +45,8 @@
 CFLAGS+=	-DUSE_MD5
 
 # Endianness
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" || \
+    ${MACHINE_ARCH} == "s390" || ${MACHINE_ARCH} == "s390x"
 CFLAGS+=	-DWORDS_BIGENDIAN
 .endif
 

==== //depot/projects/s390/lib/libc/Makefile#12 (text+ko) ====


==== //depot/projects/s390/lib/libc/gen/tls.c#4 (text+ko) ====

@@ -43,10 +43,8 @@
 __weak_reference(__libc_free_tls, _rtld_free_tls);
 
 #ifdef __i386__
-
 __weak_reference(___libc_tls_get_addr, ___tls_get_addr);
 __attribute__((__regparm__(1))) void * ___libc_tls_get_addr(void *);
-
 #endif
 
 void * __libc_tls_get_addr(void *);
@@ -60,7 +58,8 @@
 #if defined(__ia64__) || defined(__amd64__)
 #define TLS_TCB_ALIGN 16
 #elif defined(__powerpc__) || defined(__i386__) || defined(__arm__) || \
-    defined(__sparc64__) || defined(__mips__)
+    defined(__sparc64__) || defined(__mips__) || defined(__s390__) || \
+    defined(__s390x__)
 #define TLS_TCB_ALIGN sizeof(void *)
 #else
 #error TLS_TCB_ALIGN undefined for target architecture
@@ -70,10 +69,20 @@
 #define TLS_VARIANT_I
 #endif
 #if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \
-    defined(__arm__) || defined(__mips__)
+    defined(__arm__) || defined(__mips__) || defined(__s390__) || \
+    defined(__s390x__)
 #define TLS_VARIANT_II
 #endif
 
+#if defined(__s390__)
+void *
+__tls_get_offset(size_t offset __unused)
+{
+
+	return (0);	/* XXX-BZ dump core here? */
+}
+#endif
+
 #ifndef PIC
 
 #define round(size, align) \

==== //depot/projects/s390/lib/libc/gmon/gmon.c#9 (text+ko) ====

@@ -49,8 +49,8 @@
 
 #include "libc_private.h"
 
-#if defined(__i386__) || defined(__sparc64__) || defined(__amd64__) || defined(__powerpc__) \
-    defined(__s390__)
+#if defined(__i386__) || defined(__sparc64__) || defined(__amd64__) || \
+     defined(__powerpc__) || defined(__s390__)
 extern char *minbrk __asm (".minbrk");
 #else
 extern char *minbrk __asm ("minbrk");

==== //depot/projects/s390/lib/libc/s390/Makefile.inc#3 (text+ko) ====

@@ -3,3 +3,9 @@
 # Temporary kludge.
 #
 NO_QUAD=1
+
+# Long double is quad precision
+GDTOASRCS+=strtorQ.c
+MDSRCS+=machdep_ldisQ.c
+
+SYM_MAPS+=${.CURDIR}/s390/Symbol.map

==== //depot/projects/s390/lib/libc/s390/_fpmath.h#3 (text+ko) ====

@@ -27,23 +27,56 @@
  * $FreeBSD: src/lib/libc/s390/_fpmath.h,v 1.0 2003/02/08 20:37:54 tzukanov Exp $
  */
 
+#if 0
+/* XXX see comment in lib/msun/s390/Makkefile.inc */
 union IEEEl2bits {
 	long double	e;
 	struct {
-		unsigned int	sign	:1;
-		unsigned int	exp	:15;
-		unsigned long	manh	:48;
-		unsigned long	manl	:64;
+		unsigned int		sign	:1;
+		unsigned int		exp	:15;
+		unsigned long long	manh	:48;
+		unsigned long long	manl	:64;
 	} bits;
+	struct {
+		unsigned int		expsign	:16;
+		unsigned long long	manh	:48;
+		unsigned long long	manl	:64;
+	} xbits;
 };
 
 #define	mask_nbit_l(u)	((void)0)
 #define	LDBL_IMPLICIT_NBIT
+#define	LDBL_NBIT	0
 
+#define	LDBL_MANH_SIZE	48
+#define	LDBL_MANL_SIZE	64
+
 #define	LDBL_TO_ARRAY32(u, a) do {			\
 	(a)[0] = (uint32_t)(u).bits.manl;		\
-	(a)[1] = (uint32_t)((u).bits.manl >> 32);	\
+	(a)[1] = (uint32_t)((u).bits.manl >> 32);      	\
 	(a)[2] = (uint32_t)(u).bits.manh;		\
 	(a)[3] = (uint32_t)((u).bits.manh >> 32);	\
-} while (0)
+} while(0)
+#endif
+
+union IEEEl2bits {
+	long double	e;
+	struct {
+		unsigned int		sign	:1;
+		unsigned int		exp	:11;
+		unsigned int		manh	:20;
+		unsigned int		manl	:32;
+	} bits;
+};
+
+#define	mask_nbit_l(u)	((void)0)
+#define	LDBL_IMPLICIT_NBIT
+#define	LDBL_NBIT	0
+
+#define	LDBL_MANH_SIZE	20
+#define	LDBL_MANL_SIZE	32
 
+#define	LDBL_TO_ARRAY32(u, a) do {			\
+	(a)[0] = (uint32_t)(u).bits.manl;		\
+	(a)[1] = (uint32_t)(u).bits.manh;		\
+} while(0)

==== //depot/projects/s390/lib/libc/s390/sys/Makefile.inc#3 (text+ko) ====

@@ -5,10 +5,13 @@
 MDASM=	brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S
 
 # Don't generate default code for these syscalls:
-NOASM=	break.o exit.o ftruncate.o getdomainname.o getlogin.o \
-	lseek.o mlockall.o mmap.o munlockall.o openbsd_poll.o pread.o \
-	pwrite.o setdomainname.o sstk.o truncate.o uname.o yield.o
+NOASM=	break.o exit.o getdomainname.o ftruncate.o getlogin.o \
+	lseek.o mmap.o openbsd_poll.o pread.o \
+	pwrite.o setdomainname.o truncate.o
 
 PSEUDO=	_getlogin.o _exit.o
+.if !defined(WITHOUT_SYSCALL_COMPAT)
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
 
 MAN+=	s390_sysinfo.2

==== //depot/projects/s390/lib/libc/stdlib/malloc.c#12 (text+ko) ====

@@ -255,8 +255,8 @@
 #  define SIZEOF_PTR_2POW	2
 #endif
 #ifdef __s390__
-#  define QUANTUM_2POW_MIN	4
-#  define SIZEOF_PTR		8
+#  define QUANTUM_2POW		4
+#  define SIZEOF_PTR_2POW	2
 #  define NO_TLS
 #endif
 

==== //depot/projects/s390/lib/libkvm/kvm_s390.c#2 (text+ko) ====

@@ -68,7 +68,7 @@
 }
 
 int
-_kvm_kvatop(kvm_t *kd, u_long va, u_long *pa)
+_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
 {
 	_kvm_err(kd, 0, "%s not yet implemented", __func__);
 

==== //depot/projects/s390/lib/libkvm/kvm_s390x.c#2 (text+ko) ====

@@ -68,7 +68,7 @@
 }
 
 int
-_kvm_kvatop(kvm_t *kd, u_long va, u_long *pa)
+_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
 {
 	_kvm_err(kd, 0, "%s not yet implemented", __func__);
 

==== //depot/projects/s390/lib/libthr/thread/thr_getschedparam.c#2 (text+ko) ====

@@ -29,10 +29,16 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libthr/thread/thr_getschedparam.c,v 1.1 2003/04/01 03:46:28 jeff Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_getschedparam.c,v 1.9 2006/09/21 04:21:30 davidxu Exp $
  */
+
+#include "namespace.h"
+#include <sys/types.h>
+#include <sys/rtprio.h>
 #include <errno.h>
 #include <pthread.h>
+#include "un-namespace.h"
+
 #include "thr_private.h"
 
 __weak_reference(_pthread_getschedparam, pthread_getschedparam);
@@ -41,19 +47,31 @@
 _pthread_getschedparam(pthread_t pthread, int *policy, 
 	struct sched_param *param)
 {
+	struct pthread *curthread = _get_curthread();
 	int ret;
 
-	if ((param == NULL) || (policy == NULL))
-		/* Return an invalid argument error: */
-		ret = EINVAL;
+	if (policy == NULL || param == NULL)
+		return (EINVAL);
 
-	/* Find the thread in the list of active threads: */
-	else if ((ret = _find_thread(pthread)) == 0) {
-		/* Return the threads base priority and scheduling policy: */
-		param->sched_priority =
-		    PTHREAD_BASE_PRIORITY(pthread->base_priority);
+	if (pthread == curthread) {
+		/*
+		 * Avoid searching the thread list when it is the current
+		 * thread.
+		 */
+		THR_LOCK(curthread);
+		*policy = curthread->attr.sched_policy;
+		param->sched_priority = curthread->attr.prio;
+		THR_UNLOCK(curthread);
+		ret = 0;
+	}
+	/* Find the thread in the list of active threads. */
+	else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0))
+	    == 0) {
+		THR_THREAD_LOCK(curthread, pthread);
 		*policy = pthread->attr.sched_policy;
+		param->sched_priority = pthread->attr.prio;
+		THR_THREAD_UNLOCK(curthread, pthread);
+		_thr_ref_delete(curthread, pthread);
 	}
-
-	return(ret);
+	return (ret);
 }

==== //depot/projects/s390/lib/msun/Makefile#8 (text+ko) ====

@@ -19,14 +19,6 @@
 .endif
 
 .include "${ARCH_SUBDIR}/Makefile.inc"
-# Broken:
-# ARCH_SRCS+=	s_log1p.S
-#.elif ${MACHINE_ARCH} == "s390"
-#ARCH=	s390
-#ARCH_SRCS = e_fmodf.S e_fmod.S e_hypotf.S e_hypot.S \
-#	    e_remainderf.S e_remainder.S e_sqrtf.S e_sqrt.S \
-#	    s_ceilf.S s_ceil.S s_copysignf.S s_copysign.S s_fabsf.S s_fabs.S \
-#	    s_finitef.S s_finite.S s_floorf.S s_floor.S s_rintf.S s_rint.S
 
 .PATH:	${.CURDIR}/${ARCH_SUBDIR}
 

==== //depot/projects/s390/lib/msun/s390/Makefile.inc#2 (text+ko) ====

@@ -1,4 +1,13 @@
 # $FreeBSD$
 
+ARCH_SRCS = e_fmodf.S e_fmod.S e_hypotf.S e_hypot.S \
+	    e_remainderf.S e_remainder.S e_sqrtf.S e_sqrt.S \
+	    s_ceilf.S s_ceil.S s_copysignf.S s_copysign.S s_fabsf.S s_fabs.S \
+	    s_finitef.S s_finite.S s_floorf.S s_floor.S s_rintf.S s_rint.S
+
 LDBL_PREC = 53		# dz9ar008 19-5
+# should be 113 as I assume FLT(short), DBL(double), LDBL(extended),
+# and so did machine/float.h; if we find a solution to the framework
+# for 113 on a 32 bit machine.. ; also lib/libc/s390/_f*.h
 
+SYM_MAPS += ${.CURDIR}/s390/Symbol.map

==== //depot/projects/s390/lib/msun/s390/e_fmod.S#2 (text+ko) ====

@@ -10,5 +10,5 @@
 #include <machine/asm.h>
 
 /* double fmod(double, double) */
-ENTRY(__ieee754_fmod)
+ENTRY(fmod)
 	br	%r14

==== //depot/projects/s390/lib/msun/s390/e_fmodf.S#2 (text+ko) ====

@@ -10,5 +10,5 @@
 #include <machine/asm.h>
 
 /* float fmodf(float, float) */
-ENTRY(__ieee754_fmodf)
+ENTRY(fmodf)
 	br	%r14

==== //depot/projects/s390/lib/msun/s390/e_hypot.S#2 (text+ko) ====

@@ -10,8 +10,8 @@
 #include <machine/asm.h>
 
 /* double hypot(double, double) */
-ENTRY(__ieee754_hypot)
-	ldbr	%f1,	%f2
+ENTRY(hypot)
+	lxdbr	%f1,	%f2
 	mxdbr	%f1,	%f1
 	mxdbr	%f0,	%f0
 	axbr	%f0,	%f1

==== //depot/projects/s390/lib/msun/s390/e_hypotf.S#2 (text+ko) ====

@@ -10,7 +10,7 @@
 #include <machine/asm.h>
 
 /* float hypot(float, float) */
-ENTRY(__ieee754_hypotf)
+ENTRY(hypotf)
 	mdebr	%f0,	%f0
 	mdebr	%f2,	%f2
 	adbr	%f0,	%f2

==== //depot/projects/s390/lib/msun/s390/e_remainder.S#2 (text+ko) ====

@@ -10,6 +10,6 @@
 #include <machine/asm.h>
 
 /* double remainder(double, double) */
-ENTRY(__ieee754_remainder)
+ENTRY(remainder)
 	sqdbr	%f0,	%f0
 	br	%r14

==== //depot/projects/s390/lib/msun/s390/e_remainderf.S#2 (text+ko) ====

@@ -10,6 +10,6 @@
 #include <machine/asm.h>
 
 /* float remainderf(float, float) */
-ENTRY(__ieee754_remainderf)
+ENTRY(remainderf)
 	sqdbr	%f0,	%f0
 	br	%r14

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810271247.m9RCljno004112>