httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bixby, Mark (TCSD-MISL-Cupertino)" <mark.bi...@hp.com>
Subject [PATCH] 1.3.29 MPE port update, piped logs, and strdup
Date Sat, 13 Mar 2004 01:48:07 GMT
Hi dev@httpd.apache.org,

I'd like to get some MPE-related tweaks into the coming 1.3.30.  Can somebody with patch commit
authority please ack me if these are OK?

1) New MPE-specific platform doc web page (in attachment but omitted below).

2) The piped logs process was never terminating on MPE because the pipe wasn't being closed
after the maintenance restart SIGTERM signal was sent.  My patch closes the pipe here (note
-- I did not make this MPE-specific since another SIGTERM case does close the pipe for all
platforms).  See below or in the attachment.

3) MPE lacks ftruncate() as expected by rotatelogs, so I have added it to os/mpeix along with
some support code.  See below or in the attachment.  Let me know if the license/copyright
verbiage at the top of longpointer.h needs to be revised and I will contact the author of
that code.

4) MPE lacks strdup(), and so ab's use of strdup() was a problem.  I have added strdup() to
ab similar to what was done in logresolve (i.e. #ifdef NEED_STRDUP).  See below or in the
attachment.

Thanks...

- Mark B.
HP MISL MPE/iX R&D Lab

diff -ruN apache_1.3.29/src/main/http_log.c apache_1.3.29_mpe/src/main/http_log.c
--- apache_1.3.29/src/main/http_log.c	Mon Feb  3 09:13:21 2003
+++ apache_1.3.29_mpe/src/main/http_log.c	Fri Mar 12 16:51:49 2004
@@ -662,6 +662,8 @@
 	if (pl->pid != -1) {
 	    kill(pl->pid, SIGTERM);
 	}
+	close(pl->fds[0]);
+	close(pl->fds[1]);
 	break;
 
     case OC_REASON_UNREGISTER:
diff -ruN apache_1.3.29/src/os/mpeix/Makefile.tmpl apache_1.3.29_mpe/src/os/mpeix/Makefile.tmpl
--- apache_1.3.29/src/os/mpeix/Makefile.tmpl	Thu Sep 28 06:32:41 2000
+++ apache_1.3.29_mpe/src/os/mpeix/Makefile.tmpl	Wed Mar 10 16:50:42 2004
@@ -3,7 +3,7 @@
 INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
 LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
 
-LIBOBJS=	os.o os-inline.o dlopen.o gettimeofday.o
+LIBOBJS=	os.o os-inline.o dlopen.o ftruncate.o gettimeofday.o
 OBJS=	$(LIBOBJS)
 
 LIB=	libos.a
@@ -40,6 +40,7 @@
 
 # DO NOT REMOVE
 dlopen.o: dlopen.c
+ftruncate.o: ftruncate.c longpointer.h
 gettimeofday.o: gettimeofday.c
 os-inline.o: os-inline.c $(INCDIR)/ap_config.h \
  $(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h \
diff -ruN apache_1.3.29/src/os/mpeix/ftruncate.c apache_1.3.29_mpe/src/os/mpeix/ftruncate.c
--- apache_1.3.29/src/os/mpeix/ftruncate.c	Wed Dec 31 16:00:00 1969
+++ apache_1.3.29_mpe/src/os/mpeix/ftruncate.c	Wed Mar 10 16:52:21 2004
@@ -0,0 +1,34 @@
+/*
+ * ftruncate - set file size, BSD Style
+ *
+ * shortens or enlarges the file as neeeded
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <mpe.h>
+#include "longpointer.h"
+
+extern void FCONTROL(short, short, T_LONGPOINTER);
+extern void PRINTFILEINFO(int);
+
+int ftruncate(int fd, long wantsize) {
+
+int ccode_return,dummy=0;
+
+if (lseek(fd, wantsize, SEEK_SET) < 0) {
+        return (-1);
+}
+
+FCONTROL(_mpe_fileno(fd),6,longaddr(&dummy)); /* Write new EOF */
+if ((ccode_return=ccode()) != CCE) {
+        fprintf(stderr,"MPE ftruncate failed, ccode=%d, wantsize=%ld\n",ccode_return,wantsize);
+        PRINTFILEINFO(_mpe_fileno(fd));
+	errno = ESYSERR;
+	return (-1);
+}
+
+return (0);
+}
diff -ruN apache_1.3.29/src/os/mpeix/longpointer.h apache_1.3.29_mpe/src/os/mpeix/longpointer.h
--- apache_1.3.29/src/os/mpeix/longpointer.h	Wed Dec 31 16:00:00 1969
+++ apache_1.3.29_mpe/src/os/mpeix/longpointer.h	Fri Mar 12 10:42:03 2004
@@ -0,0 +1,643 @@
+#ifndef __LONGPOINTER_INCLUDED
+#define __LONGPOINTER_INCLUDED
+
+/*
+ * gcc long pointer support code for HPPA.
+ * Copyright 1998, 2001 DIS International, Ltd.
+ *
+ * This code is free software; you may redistribute it and/or modify
+ * it under the same terms as Apache itself.  (Relicensed for Apache in
+ * in March 2004 by Mark Klein of DIS).
+ *
+ * THIS SOFTWARE IS PROVIDED BY DIS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL DIS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stddef.h>
+#ifdef __cplusplus
+}
+#endif
+
+typedef struct 
+  {
+    unsigned long sid;
+    unsigned long offset;
+  } T_LONGPOINTER;
+
+#ifndef __cplusplus
+
+int getsid(void *source)
+  {
+  int val;
+  /*
+   * Given the short pointer, determine it's space ID.
+   */
+
+  /*
+   * The colons separate output from input parameters. In this case,
+   * the output of the instruction (output indicated by the "=" in the
+   * constraint) is to a memory location (indicated by the "m"). The
+   * input constraint indicates that the source to the instruction
+   * is a register reference (indicated by the "r").
+   * The general format is:
+   *   asm("<instruction template>" : <output> : <input> : <clobbers>);
+   *     where <output> and <input> are:
+   *       "<constraint>" (<token>)
+   *     <instruction template> is the PA-RISC instruction in template fmt.
+   *     <clobbers> indicates those registers clobbered by the instruction
+   *     and provides hints to the optimizer. 
+   *     
+   * Refer to the gcc documentation or http://www.dis.com/gnu/gcc_toc.html
+   */
+  __asm__ __volatile__ (
+      "   comiclr,= 0,%1,%%r28\n"
+      "\t   ldsid (%%r0,%1),%%r28\n"
+      "\t stw %%r28, %0"
+  			: "=m" (val)	// Output to val
+			: "r" (source)	// Source must be gen reg
+			: "%r28");	// Clobbers %r28
+  return (val);
+  };
+
+T_LONGPOINTER longaddr(void *source)	
+  {
+  T_LONGPOINTER lptr;
+  /*
+   * Return the long pointer for the address in sr5 space.
+   */
+
+  __asm__ __volatile__ (
+      "  comiclr,= 0,%2,%%r28\n"
+      "\t    ldsid (%%r0,%2),%%r28\n"
+      "\t  stw %%r28, %0\n"
+      "\t  stw %2, %1"
+  			: "=m" (lptr.sid),
+			  "=m" (lptr.offset)	// Store to lptr
+			: "r" (source) 		// Source must be gen reg
+			: "%r28");	// Clobbers %r28
+  return (lptr);
+  };
+
+T_LONGPOINTER addtopointer(T_LONGPOINTER source,// %r26 == source offset
+						// %r25 == source space
+			int		len)	// %r24 == length in bytes
+  {
+  /*
+   * Increment a longpointer.
+   */
+
+  __asm__ __volatile__ (
+      "  copy %0,%%r28\n"			// copy space to r28
+      "\t  add %1,%2,%%r29"			// Increment the pointer
+       			:			// No output
+			: "r" (source.sid), // Source address
+			  "r" (source.offset),
+			  "r" (len)		// Length
+			: "%r28",		// Clobbers
+			  "%r29");
+  };
+
+void longmove(int len,			// %r26 == byte length
+	      T_LONGPOINTER source,	// %r23 == source space, %r24 == off
+	      T_LONGPOINTER target)	// sp-#56 == target space, sp-#52== off
+  {
+  /*
+   * Move data between two buffers in long pointer space.
+   */
+
+  __asm__ __volatile__ (
+      "  .import $$lr_unk_unk_long,MILLICODE\n"
+      "\t  mtsp %0,%%sr1\n"			// copy source space to sr1
+      "\t  copy %1,%%r26\n"			// load source offset to r26
+      "\t  copy %4,%%r24\n"			// load length to r24
+      "\t  copy %3,%%r25\n"			// load target offset to r25
+      "\t  bl $$lr_unk_unk_long,%%r31\n"	// start branch to millicode
+      "\t  mtsp %2,%%sr2"			// copy target space to sr2
+  			: 			// No output
+			: "r" (source.sid),	// Source address
+			  "r" (source.offset),	
+			  "r" (target.sid),	// Target address
+			  "r" (target.offset),
+			  "r" (len)		// Byte length
+			: "%r1",		// Clobbers
+			  "%r24",
+			  "%r25",
+			  "%r26",
+			  "%r31");
+  };
+          
+int longpeek(T_LONGPOINTER source)	
+  {
+  /*
+   * Fetch the int in long pointer space.
+   */
+  unsigned int val;
+
+  __asm__ __volatile__ (
+      "  mtsp %1, %%sr1\n"
+      "\t  copy %2, %%r28\n"
+      "\t  ldw 0(%%sr1, %%r28), %%r28\n"
+      "\t  stw %%r28, %0"
+      			: "=m" (val)		// Output val
+			: "r" (source.sid),	// Source space ID
+			  "r" (source.offset)	// Source offset
+			: "%r28");		// Clobbers %r28
+
+  return (val);
+  };
+
+void longpoke(T_LONGPOINTER target,	// %r25 == sid, %r26 == offset
+  	  unsigned int val)		// %r24 == value
+  {
+  /*
+   * Store the val into long pointer space.
+   */
+  __asm__ __volatile__ (
+      "  mtsp %0,%%sr1\n"
+      "\t  copy %1, %%r28\n"
+      "\t  stw %2, 0(%%sr1, %%r28)"	
+       			:			// No output
+      			: "r" (target.sid),	// Target space ID
+			  "r" (target.offset),	// Target offset
+			  "r" (val)		// Value to store
+			: "%r28"		// Clobbers %r28
+			);			// Copy space to %sr1
+  };
+
+void move_fast(int len,			// %r26 == byte length
+               void *source,		// %r25 == source addr
+               void *target)		// %r24 == target addr
+  {
+  /*
+   * Move using short pointers.
+   */
+  __asm__ __volatile__ (
+      "  .import $$lr_unk_unk,MILLICODE\n"
+      "\t  copy %1, %%r26\n"			// Move source addr into pos
+      "\t  copy %2, %%r25\n"			// Move target addr into pos
+      "\t  bl $$lr_unk_unk,%%r31\n"		// Start branch to millicode
+      "\t  copy %0, %%r24"			// Move length into position
+  			: 			// No output
+			: "r" (len),	 	// Byte length
+			  "r" (source),		// Source address
+			  "r" (target)		// Target address
+			: "%r24",		// Clobbers
+			  "%r25",
+			  "%r26",
+			  "%r31");
+  };
+
+#endif
+
+#ifdef __cplusplus
+
+using namespace std;
+
+#define RECORD(__base, __offset) ((size_t) &((__base *)0)->__offset)
+
+template <typename Type> 
+T_LONGPOINTER addr (Type& source)
+{
+  T_LONGPOINTER lptr;
+  __asm__ __volatile__ (
+      "   comiclr,= 0, %2, %%r28\n"
+      "\t      ldsid (%%sr0,%2), %%r28\n"
+      "\t   stw %%r28, %0\n"
+      "\t   stw %2, %1"
+        : "=m" (lptr.sid),
+	  "=m" (lptr.offset)
+	: "r" (source)
+	: "%r28");
+  return lptr;
+}
+
+template<typename Type>
+Type addtopointer (	Type&		__source,
+			size_t		__offset)
+{
+  return (Type)((unsigned) __source + __offset);
+}
+
+/*
+ * Increment a long pointer (enabled for large files).
+ *
+ */
+__inline__ T_LONGPOINTER addtopointer (T_LONGPOINTER __source, size_t __offset)
+{
+  register union 
+  {
+    unsigned long long	__value;
+    T_LONGPOINTER	__lptr;
+  } __u;
+
+  __u.__lptr		= __source;
+  __u.__value		+= __offset;
+
+  return __u.__lptr;
+}
+
+/*
+ * Build a long pointer.
+ *
+ */
+T_LONGPOINTER buildpointer (int __sid, size_t __offset)
+{
+  T_LONGPOINTER	__lptr;
+
+  __lptr.sid	= __sid;
+  __lptr.offset	= __offset;
+
+  return __lptr;
+}
+
+/*
+ * Fill a buffer with a constant using short pointers.
+ */
+template<typename Type>
+void fast_fill ( 	Type&		__source,
+			char		__fill,
+			size_t		__len)
+{
+  __asm__ __volatile__ (
+    "   .import $$fill_unk_unk,MILLICODE\n"
+    "\t   zdep %1, 31, 8, %%r26\n"
+    "\t   dep  %1, 23, 8, %%r26\n"
+    "\t   dep  %1, 15, 8, %%r26\n"
+    "\t   dep  %1,  7, 8, %%r26\n"
+    "\t   copy %0, %%r25\n"
+    "\t   bl $$fill_unk_unk, %%r31\n"
+    "\t   copy %2, %%r24"
+      :
+      : "r" (__source),
+        "r" (__fill),
+	"r" (__len)
+      : "%r24",
+	"%r25",
+	"%r26",
+	"%r31",
+	"memory");
+}
+
+/*
+ * Fill a buffer in long pointer space with the constant.
+ */
+template<> 
+void fast_fill<T_LONGPOINTER> (	
+				T_LONGPOINTER&	__source, 
+				char		__fill,
+				size_t 		__len) 
+{
+  __asm__ __volatile__ (
+    "   .import $$fill_unk_unk_long,MILLICODE\n"
+    "\t   zdep %2, 31, 8, %%r26\n"
+    "\t   dep  %2, 23, 8, %%r26\n"
+    "\t   dep  %2, 15, 8, %%r26\n"
+    "\t   dep  %2,  7, 8, %%r26\n"
+    "\t   copy %1, %%r25\n"
+    "\t   copy %3, %%r24\n"
+    "\t   bl $$fill_unk_unk_long, %%r31\n"
+    "\t   mtsp %0, %%sr1"
+      :
+      : "r" (__source.sid),
+        "r" (__source.offset),
+	"r" (__fill),
+	"r" (__len)
+      : "%r1",
+        "%r24",
+	"%r25",
+	"%r26",
+	"%r31",
+	"memory");
+}
+
+/*
+ * Move data between two addresses.
+ */
+template<typename Type1, typename Type2>
+void move_fast (		size_t		__len,
+				Type1&		__source,
+				Type2&		__target)
+{
+  __asm__ __volatile__ (
+    "   .import $$lr_unk_unk,MILLICODE\n"
+    "\t   copy %1, %%r26\n"
+    "\t   copy %2, %%r25\n"
+    "\t   bl $$lr_unk_unk, %%r31\n"
+    "\t   copy %0, %%r24"
+      :
+      : "r" (__len),
+        "r" (__source),
+	"r" (__target)
+      : "%r24",
+	"%r25",
+	"%r26",
+	"%r31",
+	"memory");
+}
+
+/*
+ * Move data between two addresses with specific offsets.
+ * CAUTION! Pascal determines the offsets relative to the base of
+ * the structure being moved. For example, given:
+ *
+ *   var arr1 : packed array [1..15] of char;
+ *       arr2 : packed array [-3..5] of char;
+ *   move_fast (9, arr1, 3, arr2, -3);
+ *
+ * will move the third element from arr1 to arr2, beginning at the first
+ * element of arr2.
+ *
+ * The equivalent in C would be:
+ *
+ *   char arr1[15];  // 0..14
+ *   char arr2[9];   // 0..8
+ *   for (int i=0;i<9;i++) arr2[i] = arr1[i+2];
+ *
+ * For this implementation the offsets are zero based in all cases.
+ */
+template<typename Type1, typename Type2>
+void move_fast (		size_t		__len,
+				Type1&		__source,
+				size_t		__source_offset,
+				Type2&		__target,
+				size_t		__target_offset)
+{
+  __asm__ __volatile__ (
+    "   .import $$lr_unk_unk,MILLICODE\n"
+    "\t   add %1, %2, %%r26\n"
+    "\t   add %3, %4, %%r25\n"
+    "\t   bl $$lr_unk_unk, %%r31\n"
+    "\t   copy %0, %%r24"
+      :
+      : "r" (__len),
+        "r" (__source),
+	"r" (__source_offset),
+	"r" (__target),
+	"r" (__target_offset)
+      : "%r24",
+	"%r25",
+	"%r26",
+	"%r31",
+	"memory");
+}
+
+/*
+ * move_l_to_r variant of move_fast.
+ */
+template<typename Type1, typename Type2>
+void move_l_to_r (		size_t		__len,
+				Type1&		__source,
+				size_t		__source_offset,
+				Type2&		__target,
+				size_t		__target_offset)
+{
+  move_fast (__len, __source, 0, __target, 0);
+}
+/*
+ * Move data between two addresses (as long pointers).
+ */
+template<> 
+void move_fast<T_LONGPOINTER> (	
+				size_t 		__len, 
+				T_LONGPOINTER&	__source, 
+				T_LONGPOINTER&	__target)
+{
+  __asm__ __volatile__ (
+    "   .import $$lr_unk_unk_long,MILLICODE\n"
+    "\t   mtsp %0, %%sr1\n"
+    "\t   copy %1, %%r26\n"
+    "\t   copy %4, %%r24\n"
+    "\t   copy %3, %%r25\n"
+    "\t   bl $$lr_unk_unk_long, %%r31\n"
+    "\t   mtsp %2, %%sr2"
+      :
+      : "r" (__source.sid),
+        "r" (__source.offset),
+	"r" (__target.sid),
+	"r" (__target.offset),
+	"r" (__len)
+      : "%r1",
+        "%r24",
+	"%r25",
+	"%r26",
+	"%r31",
+	"memory");
+}
+
+
+template<typename Type>
+class LONGPOINTER {
+
+  public:
+
+    typedef LONGPOINTER<Type>	GLOBALANYPTR;
+
+  private:
+    T_LONGPOINTER	baseptr;
+    T_LONGPOINTER	lptr;
+
+  public:
+
+  __inline__ T_LONGPOINTER operator=(T_LONGPOINTER source)
+  {
+    baseptr	= source;
+    lptr 	= source;
+  }
+
+  /*
+   * Increment a long pointer.
+   *
+   */
+  __inline__ void __addtopointer (int __offset)
+  {
+    lptr	= ::addtopointer(lptr, __offset);
+  }
+
+  /*
+   * Get a value from long pointer space.
+   * The __offset is the byte offset into the record pointed to by
+   * LONGPOINTER and the __value is a local pointer to which the value
+   * will be returned.
+   */
+  template <typename DataType>
+  void __getval(size_t __offset, DataType* __value)
+  {
+    register union {
+      DataType	__value;
+      struct {
+        long	__l1;
+        long	__l2;
+	long	__l3;
+	long	__l4;
+      } __l;
+    } __u;
+
+    /*
+     * Set up the registers for the space and offset.
+     */
+    __asm__ __volatile__ (
+      "   ldw %0, %%r1\n"
+      "\t   ldw %1, %%r31\n"
+      "\t   mtsp %%r1,%%sr2\n"
+      "\t   add %2,%%r31,%%r31"
+	: 
+	: "m" (lptr.sid),
+	  "m" (lptr.offset),
+	  "r" (__offset)
+	: "%r1",
+	  "%r31");
+
+    switch (sizeof (DataType))
+    {
+      case 1:
+        __asm__ __volatile__ (
+          "   ldb 0(%%sr2, %%r31), %0"
+	    : "=r" (__u.__value));
+	break;
+
+     case 2:
+        __asm__ __volatile__ (
+          "   ldh 0(%%sr2, %%r31), %0"
+            : "=r" (__u.__value));
+	break;
+
+     case 4:
+        __asm__ __volatile__ (
+          "   ldw 0(%%sr2, %%r31), %0"
+            : "=r" (__u.__value));
+	break;
+
+     case 8:
+        __asm__ __volatile__ (
+          "   ldw 0(%%sr2, %%r31), %0\n"
+          "\t   ldw 4(%%sr2, %%r31), %1"
+            : "=r" (__u.__l.__l1),
+	      "=r" (__u.__l.__l2));
+	break;
+
+     case 16:
+        __asm__ __volatile__ (
+          "   ldw %0,  0(%%sr2, %%r31)\n"
+          "\t   ldw %1,  4(%%sr2, %%r31)\n"
+          "\t   ldw %2,  8(%%sr2, %%r31)\n"
+          "\t   ldw %3, 12(%%sr2, %%r31)"
+            : "=r" (__u.__l.__l1),
+	      "=r" (__u.__l.__l2),
+	      "=r" (__u.__l.__l3),
+	      "=r" (__u.__l.__l4));
+	break;
+    }
+    *__value = __u.__value;
+  }
+
+  /*
+   * Reset the current long pointer to its base address.
+   */
+  __inline__ void __resetpointer(void)
+  {
+    lptr	= baseptr;
+  }
+  /*
+   * Store a value into long pointer space.
+   * The __offset is the byte offset into the record pointed to by
+   * LONGPOINTER and the __value is the value to be stored.
+   */
+  template <typename DataType>
+  void __setval(size_t __offset, DataType __value)
+  {
+    register union {
+      DataType	__value;
+      struct {
+        long	__l1;
+        long	__l2;
+	long	__l3;
+	long	__l4;
+      } __l;
+    } __u;
+
+
+    __u.__value	= __value;
+    /*
+     * Set up the registers for the space and offset.
+     */
+    __asm__ __volatile__ (
+      "   ldw %0, %%r1\n"
+      "\t   ldw %1, %%r31\n"
+      "\t   mtsp %%r1,%%sr2\n"
+      "\t   add %2,%%r31,%%r31"
+	: 
+	: "m" (lptr.sid),
+	  "m" (lptr.offset),
+	  "r" (__offset)
+	: "%r1",
+	  "%r31");
+
+    switch (sizeof (DataType))
+    {
+      case 1:
+        __asm__ __volatile__ (
+          "   stb %0, 0(%%sr2, %%r31)"
+	    :
+            : "r" (__value));
+	break;
+
+     case 2:
+        __asm__ __volatile__ (
+          "   sth %0, 0(%%sr2, %%r31)"
+	    :
+            : "r" (__value));
+	break;
+
+     case 4:
+        __asm__ __volatile__ (
+          "   stw %0, 0(%%sr2, %%r31)"
+	    :
+            : "r" (__value));
+	break;
+
+     case 8:
+        __asm__ __volatile__ (
+          "   stw %0, 0(%%sr2, %%r31)\n"
+          "\t   stw %1, 4(%%sr2, %%r31)"
+	    :
+            : "r" (__u.__l.__l1),
+	      "r" (__u.__l.__l2));
+	break;
+
+     case 16:
+        __asm__ __volatile__ (
+          "   stw %0,  0(%%sr2, %%r31)\n"
+          "\t   stw %1,  4(%%sr2, %%r31)\n"
+          "\t   stw %2,  8(%%sr2, %%r31)\n"
+          "\t   stw %3, 12(%%sr2, %%r31)"
+	    :
+            : "r" (__u.__l.__l1),
+	      "r" (__u.__l.__l2),
+	      "r" (__u.__l.__l3),
+	      "r" (__u.__l.__l4));
+	break;
+
+    }
+  }
+
+  void show()
+  {
+    printf ("Longpointer: $%x.%08x\n", lptr.sid, lptr.offset);
+  }
+};
+#endif
+#endif
diff -ruN apache_1.3.29/src/support/ab.c apache_1.3.29_mpe/src/support/ab.c
--- apache_1.3.29/src/support/ab.c	Thu Jul 31 13:30:26 2003
+++ apache_1.3.29_mpe/src/support/ab.c	Fri Mar  5 11:26:20 2004
@@ -317,6 +317,19 @@
 static int s_write(struct connection * c, char *buff, int len);
 #endif
 
+#if defined(NEED_STRDUP)
+char *strdup (const char *str)
+{
+    char *dup; 
+  
+    if (!(dup = (char *) malloc(strlen(str) + 1))) 
+        return NULL; 
+    dup = strcpy(dup, str); 
+  
+    return dup;
+}
+#endif
+
 /* --------------------------------------------------------- */
 
 /* simple little function to perror and exit */


Mime
View raw message