xdr_proc_t really is different on linux26_i386
[openafs.git] / src / rx / xdr.h
index f9b7ac2..2936e29 100644 (file)
@@ -63,7 +63,9 @@
 #define mem_free(ptr, bsize)   free(ptr)
 #endif
 
-#if defined(AFS_AMD64_LINUX24_ENV) || (defined(KERNEL) && !defined(UKERNEL))
+#if defined(AFS_AMD64_LINUX24_ENV) || defined(AFS_DARWIN_ENV)
+#define xdr_alloc afs_xdr_alloc
+#define xdr_free afs_xdr_free
 #define xdr_void afs_xdr_void
 #define xdr_int afs_xdr_int
 #define xdr_u_int afs_xdr_u_int
@@ -88,6 +90,7 @@
 #define xdr_vector afs_xdr_vector
 #define xdr_int64 afs_xdr_int64
 #define xdr_uint64 afs_xdr_uint64
+#define xdr_pointer afs_xdr_pointer
 #endif
 
 #ifdef KERNEL
 #define        osi_free                afs_osi_Free
 
 /* keep here for now, 64 bit issues */
+#ifndef AFS_OBSD44_ENV
 extern void *afs_osi_Alloc(size_t x);
 #ifndef afs_osi_Alloc_NoSleep
 extern void *afs_osi_Alloc_NoSleep(size_t x);
 #endif
 extern void afs_osi_Free(void *x, size_t asize);
+#endif
 
 #endif
 #ifndef major                  /* ouch! */
@@ -169,16 +174,17 @@ enum xdr_op {
  * allocate dynamic storage of the appropriate size and return it.
  * bool_t      (*xdrproc_t)(XDR *, caddr_t *);
  */
-#if 0
-typedef bool_t(*xdrproc_t) ();
-#else
-#ifdef AFS_I386_LINUX26_ENV
-typedef bool_t(*xdrproc_t) (void *, caddr_t *, u_int);
+
+/* We need a different prototype for i386 Linux kernel code, because it 
+ * uses a register (rather than stack) based calling convention. The
+ * normal va_args prototype results in the arguments being placed on the
+ * stack, where they aren't accessible to the 'real' function.
+ */
+#if defined(AFS_I386_LINUX26_ENV) && defined(KERNEL) && !defined(UKERNEL)
+typedef bool_t(*xdrproc_t) (void *, caddr_t, u_int);
 #else
 typedef bool_t(*xdrproc_t) (void *, ...);
 #endif
-#endif
-
 
 /*
  * The XDR handle.