-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
* Just present a single processor until will add thread support.
*/
#ifndef smp_processor_id
-#define cfs_smp_processor_id() 0
+# define cfs_smp_processor_id() 0
#else
-#define cfs_smp_processor_id() smp_processor_id()
+# define cfs_smp_processor_id() smp_processor_id()
#endif
#ifndef num_online_cpus
-#define cfs_num_online_cpus() 1
+# define cfs_num_online_cpus() 1
#else
-#define cfs_num_online_cpus() num_online_cpus()
+# define cfs_num_online_cpus() num_online_cpus()
#endif
#ifndef num_possible_cpus
-#define cfs_num_possible_cpus() 1
+# define cfs_num_possible_cpus() 1
#else
-#define cfs_num_possible_cpus() num_possible_cpus()
+# define cfs_num_possible_cpus() num_possible_cpus()
+#endif
+#ifndef num_present_cpus
+# define cfs_num_present_cpus() 1
+#else
+# define cfs_num_present_cpus() num_present_cpus()
#endif
-
/*
* Wait Queue.
*/
return 0;
}
-#define cfs_lock_kernel() do {} while (0)
#define cfs_sigfillset(l) do {} while (0)
#define cfs_recalc_sigpending(l) do {} while (0)
-#define cfs_kernel_thread(l,m,n) LBUG()
+/* Fine, crash, but stop giving me compile warnings */
#define cfs_kthread_run(fn,d,fmt,...) LBUG()
+#define CFS_DAEMON_FLAGS 0
+
+#define CFS_L1_CACHE_ALIGN(x) (x)
+
#ifdef HAVE_LIBPTHREAD
typedef int (*cfs_thread_t)(void *);
-int cfs_create_thread(cfs_thread_t func, void *arg);
+int cfs_create_thread(cfs_thread_t func, void *arg, unsigned long flags);
#else
#define cfs_create_thread(l,m) LBUG()
#endif
# define max(x,y) ((x)>(y) ? (x) : (y))
#endif
+#define cfs_get_random_bytes_prim(val, size) (*val) = 0
+
/* utility libcfs init/fini entries */
#ifdef __WINNT__
extern int libcfs_arch_init(void);