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.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * libcfs/include/libcfs/posix/posix-wordsize.h
38 * Wordsize related defines for posix userspace.
40 * Author: Robert Read <rread@sun.com>
43 #ifndef __LIBCFS_LINUX_KP30_H__
44 #define __LIBCFS_LINUX_KP30_H__
48 #if defined(__CYGWIN__)
49 # include <cygwin-ioctl.h>
51 #ifdef HAVE_SYS_IOCTL_H
52 # include <sys/ioctl.h>
58 # define CFS_MODULE_PARM(name, t, type, perm, desc)
59 #define PORTAL_SYMBOL_GET(x) inter_module_get(#x)
60 #define PORTAL_SYMBOL_PUT(x) inter_module_put(#x)
64 # ifndef BITS_PER_LONG
65 # if (~0UL) == 0xffffffffUL
66 # define BITS_PER_LONG 32
68 # define BITS_PER_LONG 64
72 # define BITS_PER_LONG __WORDSIZE
76 /******************************************************************************/
78 * Support for temporary event tracing with minimal Heisenberg effect. */
81 #define LWT_MEMORY (16<<20)
91 # if BITS_PER_LONG > 32
97 #define LWT_EVENT(p1,p2,p3,p4) /* no userland implementation yet */
98 #endif /* LWT_SUPPORT */
100 /* ------------------------------------------------------------------ */
102 #define IOCTL_LIBCFS_TYPE long
105 #if BITS_PER_LONG > 32
106 # define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
107 # define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
108 # define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
110 # define LI_POISON ((int)0x5a5a5a5a)
111 # define LL_POISON ((long)0x5a5a5a5a)
112 # define LP_POISON ((void *)(long)0x5a5a5a5a)
115 #if (defined(__KERNEL__) && defined(HAVE_KERN__U64_LONG_LONG)) || \
116 (!defined(__KERNEL__) && defined(HAVE_USER__U64_LONG_LONG))
117 /* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */
118 # define LPU64 "%llu"
119 # define LPD64 "%lld"
120 # define LPX64 "%#llx"
121 # define LPX64i "%llx"
122 # define LPO64 "%#llo"
124 #elif (BITS_PER_LONG == 32)
125 # define LPU64 "%llu"
126 # define LPD64 "%lld"
127 # define LPX64 "%#llx"
128 # define LPX64i "%llx"
129 # define LPO64 "%#llo"
131 #elif (BITS_PER_LONG == 64)
134 # define LPX64i "%lx"
135 # define LPX64 "%#lx"
136 # define LPO64 "%#lo"
141 # error "No word size defined"
145 * long_ptr_t & ulong_ptr_t, same to "long" for gcc