ukernel: set pthread stacksize to an integer multiple of 8k
[openafs.git] / src / afs / UKERNEL / sysincludes.h
index ff768a7..aa82526 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -11,7 +11,7 @@
 #define __AFS_SYSINCLUDESH__ 1
 
 #include  <stdio.h>
-#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) /* must be included after KERNEL undef'd */
+#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) && !defined(AFS_USR_DFBSD_ENV) /* must be included after KERNEL undef'd */
 #include  <errno.h>
 #endif
 #include  <stdlib.h>
@@ -20,7 +20,7 @@
 #include  <assert.h>
 #include  <stdarg.h>
 
-#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) /* must be included after KERNEL undef'd */
+#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) && !defined(AFS_USR_DFBSD_ENV) /* must be included after KERNEL undef'd */
 #include  <unistd.h>
 #include  <ctype.h>
 #include  <sys/types.h>
 #define FREAD                  0x0001
 #endif /* AFS_USR_LINUX22_ENV */
 
-#if defined(AFS_USR_DARWIN_ENV) || defined(AFS_USR_FBSD_ENV)
+#if defined(AFS_USR_DARWIN_ENV) || defined(AFS_USR_FBSD_ENV) || defined(AFS_USR_DFBSD_ENV)
+#ifdef _KERNEL
+#undef _KERNEL
+#endif
 #ifdef KERNEL
 #undef KERNEL
 #define AFS_USR_UNDEF_KERNEL_ENV 1
@@ -199,9 +202,8 @@ typedef unsigned int fsblkcnt_t;
 
 #ifdef UKERNEL
 
-#ifdef AFS_USR_SGI_ENV
 #undef socket
-#endif /* AFS_USR_SGI_ENV */
+#undef flock
 
 #if defined(AFS_USR_DARWIN_ENV) || defined(AFS_USR_FBSD_ENV)
 #undef if_mtu
@@ -221,9 +223,6 @@ typedef unsigned int fsblkcnt_t;
 #define vattr                  usr_vattr
 #define buf                    usr_buf
 #define statfs                 usr_statfs
-/* #define ucred               usr_ucred */
-#define user                   usr_user
-/* #define proc                        usr_proc */
 #define file                   usr_file
 #define dirent                 usr_dirent
 #define flock                  usr_flock
@@ -232,6 +231,7 @@ typedef unsigned int fsblkcnt_t;
 #define ifaddr                  usr_ifaddr
 #define ifnet                   usr_ifnet
 #define in_ifaddr              usr_in_ifaddr
+#undef socket
 #define socket                 usr_socket
 #define crget                  usr_crget
 #define crcopy                 usr_crcopy
@@ -341,26 +341,18 @@ typedef long usr_ino_t;
 #ifdef VFIFO
 #undef VFIFO
 #endif
-#ifdef VDOOR
-#undef VDOOR
-#endif
-#ifdef VBAD
-#undef VBAD
-#endif
 #ifdef VSOCK
 #undef VSOCK
 #endif
 
-#define VNON                   0
-#define VREG                   1
-#define VDIR                   2
-#define VBLK                   3
-#define VCHR                   4
-#define VLNK                   5
-#define VFIFO                  6
-#define VDOOR                  7
-#define VBAD                   8
-#define VSOCK                  9
+#define VNON 0
+#define VREG S_IFREG
+#define VDIR S_IFDIR
+#define VBLK S_IFBLK
+#define VCHR S_IFCHR
+#define VLNK S_IFLNK
+#define VSOCK S_IFSOCK
+#define VFIFO S_IFIFO
 
 typedef int usr_vtype_t;
 
@@ -959,11 +951,11 @@ extern pthread_cond_t usr_sleep_cond;
     do { \
        pthread_attr_t attr; \
        assert(pthread_attr_init(&attr) == 0); \
-       assert(pthread_attr_setstacksize(&attr, 124288) == 0); \
-       assert(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) == 0); \
+       assert(pthread_attr_setstacksize(&attr, 122880) == 0);     \
        assert(pthread_create((A), &attr, (B), (void *)(C)) == 0); \
        assert(pthread_attr_destroy(&attr) == 0); \
     } while(0)
+#define usr_thread_join(A,B)   pthread_join(A, B)
 #define usr_thread_detach(A)   pthread_detach(A)
 #define usr_keycreate(A,B)     assert(pthread_key_create(A,B) == 0)
 #define usr_setspecific(A,B)   pthread_setspecific(A,B)
@@ -1160,7 +1152,6 @@ extern struct usr_ucred *usr_crget(void);
 extern struct usr_ucred *usr_crcopy(struct usr_ucred *);
 extern int usr_crhold(struct usr_ucred *);
 extern int usr_crfree(struct usr_ucred *);
-extern struct usr_ucred *afs_global_ucredp;
 
 struct usr_proc {
     unsigned long p_flag;
@@ -1230,23 +1221,23 @@ struct vcache;
 struct usr_vnodeops {
     int (*vn_open) (struct vcache **, afs_int32, afs_ucred_t *);
     int (*vn_close) (struct vcache *, afs_int32, afs_ucred_t *);
-    int (*vn_rdwr) (struct usr_vnode *avc, struct usr_uio *uio, 
+    int (*vn_rdwr) (struct usr_vnode *avc, struct usr_uio *uio,
                    int rw, int io, struct usr_ucred *cred);
     int (*vn_ioctl) (void);
     int (*vn_select) (void);
     int (*vn_getattr) (struct vcache *avc, struct vattr *, afs_ucred_t *);
     int (*vn_setattr) (struct vcache *avc, struct vattr *, afs_ucred_t *);
     int (*vn_access) (struct vcache *avc, afs_int32, afs_ucred_t *);
-    int (*vn_lookup) (struct vcache *adp, char *, struct vcache **, 
+    int (*vn_lookup) (struct vcache *adp, char *, struct vcache **,
                      afs_ucred_t *, int);
-    int (*vn_create) (struct vcache *adp, char *, struct vattr *, 
+    int (*vn_create) (struct vcache *adp, char *, struct vattr *,
                      enum vcexcl, int, struct vcache **, afs_ucred_t *);
     int (*vn_remove) (struct vcache *adp, char *, afs_ucred_t *);
-    int (*vn_link) (struct vcache *avc, struct vcache *adp, char *, 
+    int (*vn_link) (struct vcache *avc, struct vcache *adp, char *,
                    afs_ucred_t *);
     int (*vn_rename) (struct vcache *aodp, char *, struct vcache *, char *,
                      afs_ucred_t *);
-    int (*vn_mkdir) (struct vcache *adp, char *, struct vattr *, 
+    int (*vn_mkdir) (struct vcache *adp, char *, struct vattr *,
                     struct vcache **, afs_ucred_t *);
     int (*vn_rmdir) (struct vcache *adp, char *, afs_ucred_t *);
     int (*vn_readdir) (struct vcache *avc, struct uio *, afs_ucred_t *);
@@ -1299,12 +1290,6 @@ struct usr_vfs {
     struct usr_vfsops *vfs_op;
 };
 
-struct usr_sysent {
-    char sy_narg;
-    int (*sy_call) (void);
-};
-extern struct usr_sysent usr_sysent[];
-
 struct usr_ifnet {
     struct usr_ifnet *if_next;
     short if_flags;
@@ -1339,14 +1324,6 @@ struct usr_in_ifaddr {
 };
 extern struct usr_in_ifaddr *usr_in_ifaddr;
 
-extern usr_key_t afs_global_u_key;     /* for per thread authentication */
-
-#if defined(AFS_USR_OSF_ENV)
-extern char V;
-#else
-extern long V;
-#endif
-
 #endif /* UKERNEL */
 
 struct min_direct {