#define mem_free(ptr, bsize) free(ptr)
#endif
-#ifdef KERNEL
-#define osi_alloc afs_osi_Alloc
-#define osi_free afs_osi_Free
-
-/* keep here for now, 64 bit issues */
-extern void *afs_osi_Alloc(size_t x);
-extern void *afs_osi_Alloc_NoSleep(size_t x);
-extern void afs_osi_Free(void *x, size_t asize);
-
-#ifndef 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
#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_alloc afs_osi_Alloc
+#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
-#ifndef major /* ouch! */
+
+#endif
+#ifndef major /* ouch! */
#include <sys/types.h>
#endif
* request.
*/
enum xdr_op {
- XDR_ENCODE=0,
- XDR_DECODE=1,
- XDR_FREE=2
+ XDR_ENCODE = 0,
+ XDR_DECODE = 1,
+ XDR_FREE = 2
};
/*
* allocate dynamic storage of the appropriate size and return it.
* bool_t (*xdrproc_t)(XDR *, caddr_t *);
*/
-#if 0
-typedef bool_t (*xdrproc_t)();
+
+/* 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 *, ...);
+typedef bool_t(*xdrproc_t) (void *, ...);
#endif
-
/*
* The XDR handle.
* Contains operation which is being applied to the stream,
* and two private fields for the use of the particular impelementation.
*/
typedef struct {
- enum xdr_op x_op; /* operation; fast additional param */
- struct xdr_ops {
+ enum xdr_op x_op; /* operation; fast additional param */
+ struct xdr_ops {
#if defined(KERNEL) && ((defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV))
/* NOTE: SGI 6.1 adds two routines to the xdr_ops if the size of a long is
* 64 bits. I've only done this for the kernel, since other changes may
* be necessary if we make a 64 bit user version of AFS.
*/
- bool_t (*x_getint64)(void *xdrs, afs_int64 *lp); /* get 32 bits into a long */
- bool_t (*x_putint64)(void *xdrs, afs_int64 *lp); /* send 32 bits of a long */
-#endif /* defined(KERNEL) && ((defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV)) */
+ bool_t(*x_getint64) (void *xdrs, afs_int64 * lp); /* get 32 bits into a long */
+ bool_t(*x_putint64) (void *xdrs, afs_int64 * lp); /* send 32 bits of a long */
+#endif /* defined(KERNEL) && ((defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV)) */
#if !(defined(KERNEL) && defined(AFS_SUN57_ENV))
- bool_t (*x_getint32)(void *xdrs, afs_int32 *lp); /* get an afs_int32 from underlying stream */
- bool_t (*x_putint32)(void *xdrs, afs_int32 *lp); /* put an afs_int32 to " */
+ bool_t(*x_getint32) (void *xdrs, afs_int32 * lp); /* get an afs_int32 from underlying stream */
+ bool_t(*x_putint32) (void *xdrs, afs_int32 * lp); /* put an afs_int32 to " */
#endif
- bool_t (*x_getbytes)(void *xdrs, caddr_t addr, u_int len);/* get some bytes from " */
- bool_t (*x_putbytes)(void *xdrs, caddr_t addr, u_int len);/* put some bytes to " */
- u_int (*x_getpostn)(void *xdrs);/* returns bytes off from beginning */
- bool_t (*x_setpostn)(void *xdrs, u_int pos);/* lets you reposition the stream */
- afs_int32 * (*x_inline)(void *xdrs, u_int len); /* buf quick ptr to buffered data */
- void (*x_destroy)(void *xdrs); /* free privates of this xdr_stream */
+ bool_t(*x_getbytes) (void *xdrs, caddr_t addr, u_int len); /* get some bytes from " */
+ bool_t(*x_putbytes) (void *xdrs, caddr_t addr, u_int len); /* put some bytes to " */
+ u_int(*x_getpostn) (void *xdrs); /* returns bytes off from beginning */
+ bool_t(*x_setpostn) (void *xdrs, u_int pos); /* lets you reposition the stream */
+ afs_int32 *(*x_inline) (void *xdrs, u_int len); /* buf quick ptr to buffered data */
+ void (*x_destroy) (void *xdrs); /* free privates of this xdr_stream */
#if defined(KERNEL) && defined(AFS_SUN57_ENV)
- bool_t (*x_control)(void *xdrs);
- bool_t (*x_getint32)(void *xdrs, afs_int32 *lp);
- bool_t (*x_putint32)(void *xdrs, afs_int32 *lp);
+ bool_t(*x_control) (void *xdrs);
+ bool_t(*x_getint32) (void *xdrs, afs_int32 * lp);
+ bool_t(*x_putint32) (void *xdrs, afs_int32 * lp);
#endif
- } *x_ops;
- caddr_t x_public; /* users' data */
- caddr_t x_private; /* pointer to private data */
- caddr_t x_base; /* private used for position info */
- int x_handy; /* extra private word */
+ } *x_ops;
+ caddr_t x_public; /* users' data */
+ caddr_t x_private; /* pointer to private data */
+ caddr_t x_base; /* private used for position info */
+ int x_handy; /* extra private word */
} XDR;
/*
*/
#define NULL_xdrproc_t ((xdrproc_t)0)
struct xdr_discrim {
- int value;
- xdrproc_t proc;
+ int value;
+ xdrproc_t proc;
};
/*
#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_INT32((buf), ((afs_int32)(v)))
#include "xdr_prototypes.h"
-
#endif /* __XDR_INCLUDE__ */