Whamcloud - gitweb
LU-8058 lnet: Remove old commented out code
[fs/lustre-release.git] / libcfs / include / libcfs / types.h
index 71dd7fb..5a80d09 100644 (file)
@@ -1,17 +1,68 @@
-#ifndef _LIBCFS_TYPES_H
-#define _LIBCFS_TYPES_H
-
 /*
- * This file was inttroduced to resolve XT3 (Catamount) build issues.
- * The orignal idea was to move <lustre/types.h> here however at
- * the time of this writing
- * it's unclear what external dependencies are tied
- * to that file (It's not just some source file #including it)
- * there is some build/packaging infrastructure that includes it.
- * Hopefully that will be resolved shortly, that file will
- * be removed, its contents copied here and this comment can be deleted.
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
  */
+/*
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, 2014, Intel Corporation.
+ */
+#ifndef _LIBCFS_TYPES_H
+#define _LIBCFS_TYPES_H
 
-#include <lustre/types.h>
+#include <linux/types.h>
 
+#ifndef __KERNEL__
+# error This include is only for kernel use.
 #endif
+
+#if defined(_ASM_GENERIC_INT_L64_H)
+# define LPF64 "l"
+#elif defined(_ASM_GENERIC_INT_LL64_H)
+# define LPF64 "ll"
+#elif !defined(LPF64)
+# error "cannot define LPF64"
+#endif /* !LPF64 */
+
+#define LPU64 "%"LPF64"u"
+#define LPD64 "%"LPF64"d"
+#define LPX64 "%#"LPF64"x"
+#define LPX64i "%"LPF64"x"
+#define LPO64 "%#"LPF64"o"
+
+#define LPLU "%lu"
+#define LPLD "%ld"
+#define LPLX "%#lx"
+#define LPPID "%d"
+
+#if BITS_PER_LONG == 64
+# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
+# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
+# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
+#elif BITS_PER_LONG == 32
+# define LI_POISON ((int)0x5a5a5a5a)
+# define LL_POISON ((long)0x5a5a5a5a)
+# define LP_POISON ((void *)(long)0x5a5a5a5a)
+#else /* BITS_PER_LONG == 32 */
+# error "cannot define L{I,L,P}_POISON"
+#endif /* BITS_PER_LONG != 32 */
+
+#endif /* _LIBCFS_TYPES_H */