2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * UKERNEL OSI header file. Extends afs_osi.h.
13 * afs_osi.h includes this file, which is the only way this file should
14 * be included in a source file. This file can redefine macros declared in
18 #ifndef _OSI_MACHDEP_H_
19 #define _OSI_MACHDEP_H_
21 #include "afs/sysincludes.h"
23 #define MAX_OSI_PATH 1024
24 #define MAX_OSI_FILES 1024
25 #define MAX_OSI_LINKS 25
26 #define OSI_WAITHASH_SIZE 128 /* must be power of two */
27 #define MAX_HOSTADDR 32
29 #define AFS_UCRED struct usr_ucred
31 #define AFS_PROC struct usr_proc
33 #define AFS_KALLOC(A) afs_osi_Alloc(A)
39 #define osi_Time() (time(NULL))
42 #define gop_lookupname(fnamep,segflg,followlink,compvpp) lookupname((fnamep),(segflg),(followlink),(compvpp))
43 #undef gop_lookupname_user
44 #define gop_lookupname_user(fnamep,segflg,followlink,compvpp) lookupname((fnamep),(segflg),(followlink),(compvpp))
46 #define osi_vnhold(avc, r) do { VN_HOLD(AFSTOV(avc)); } while(0)
49 #define afs_suser(x) suser(x)
52 * Global lock support.
55 extern usr_thread_t afs_global_owner;
56 extern usr_mutex_t afs_global_lock;
58 #define ISAFS_GLOCK() (usr_thread_self() == afs_global_owner)
62 usr_mutex_lock(&afs_global_lock); \
63 afs_global_owner = usr_thread_self(); \
65 #define AFS_GUNLOCK() \
68 memset(&afs_global_owner, 0, sizeof(usr_thread_t)); \
69 usr_mutex_unlock(&afs_global_lock); \
71 #define AFS_ASSERT_GLOCK() \
72 do { if (!ISAFS_GLOCK()) { osi_Panic("afs global lock not held"); } } while(0)
74 extern int afs_bufferpages;
76 extern int afs_suser(void *credp);
78 #endif /* _OSI_MACHDEP_H_ */