1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
30 * Use is subject to license terms.
32 * Copyright (c) 2011, Whamcloud, Inc.
35 * This file is part of Lustre, http://www.lustre.org/
36 * Lustre is a trademark of Sun Microsystems, Inc.
38 * libcfs/include/libcfs/posix/posix-wordsize.h
40 * Wordsize related defines for posix userspace.
42 * Author: Robert Read <rread@sun.com>
45 #ifndef __LIBCFS_LINUX_KP30_H__
46 #define __LIBCFS_LINUX_KP30_H__
50 #if defined(__CYGWIN__)
51 # include <cygwin-ioctl.h>
53 #ifdef HAVE_SYS_IOCTL_H
54 # include <sys/ioctl.h>
60 # define CFS_MODULE_PARM(name, t, type, perm, desc)
61 #define PORTAL_SYMBOL_GET(x) inter_module_get(#x)
62 #define PORTAL_SYMBOL_PUT(x) inter_module_put(#x)
66 # ifndef BITS_PER_LONG
67 # if (~0UL) == 0xffffffffUL
68 # define BITS_PER_LONG 32
70 # define BITS_PER_LONG 64
74 # define BITS_PER_LONG __WORDSIZE
78 /******************************************************************************/
80 * Support for temporary event tracing with minimal Heisenberg effect. */
83 #define LWT_MEMORY (16<<20)
93 # if BITS_PER_LONG > 32
99 #define LWT_EVENT(p1,p2,p3,p4) /* no userland implementation yet */
100 #endif /* LWT_SUPPORT */
102 /* ------------------------------------------------------------------ */
104 #define IOCTL_LIBCFS_TYPE long
107 #if BITS_PER_LONG > 32
108 # define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
109 # define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
110 # define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
112 # define LI_POISON ((int)0x5a5a5a5a)
113 # define LL_POISON ((long)0x5a5a5a5a)
114 # define LP_POISON ((void *)(long)0x5a5a5a5a)
117 #if (defined(__KERNEL__) && defined(HAVE_KERN__U64_LONG_LONG)) || \
118 (!defined(__KERNEL__) && defined(HAVE_USER__U64_LONG_LONG))
119 /* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */
120 # define LPU64 "%llu"
121 # define LPD64 "%lld"
122 # define LPX64 "%#llx"
123 # define LPX64i "%llx"
124 # define LPO64 "%#llo"
126 #elif (BITS_PER_LONG == 32)
127 # define LPU64 "%llu"
128 # define LPD64 "%lld"
129 # define LPX64 "%#llx"
130 # define LPX64i "%llx"
131 # define LPO64 "%#llo"
133 #elif (BITS_PER_LONG == 64)
136 # define LPX64i "%lx"
137 # define LPX64 "%#lx"
138 # define LPO64 "%#lo"
143 # error "No word size defined"
147 * long_ptr_t & ulong_ptr_t, same to "long" for gcc