1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 #ifndef __LIBCFS_DARWIN_KP30__
5 #define __LIBCFS_DARWIN_KP30__
7 #ifndef __LIBCFS_KP30_H__
8 #error Do not #include this file directly. #include <libcfs/kp30.h> instead
13 #include <sys/types.h>
14 #include <sys/malloc.h>
15 #include <sys/systm.h>
16 #include <mach/mach_types.h>
20 #include <miscfs/devfs/devfs.h>
23 #include <libcfs/darwin/darwin-lock.h>
24 #include <libcfs/darwin/darwin-prim.h>
25 #include <lnet/lnet.h>
27 #define our_cond_resched() cfs_schedule_timeout(CFS_TASK_INTERRUPTIBLE, 1)
30 #define LASSERT_SPIN_LOCKED(lock) do {} while(0) /* XXX */
32 #define LASSERT_SPIN_LOCKED(lock) do {} while(0)
34 #define LASSERT_SEM_LOCKED(sem) do {} while(0) /* XXX */
36 #define LIBCFS_PANIC(msg) panic(msg)
37 #error libcfs_register_panic_notifier() missing
38 #error libcfs_unregister_panic_notifier() missing
40 /* --------------------------------------------------------------------- */
42 #define PORTAL_SYMBOL_REGISTER(x) cfs_symbol_register(#x, &x)
43 #define PORTAL_SYMBOL_UNREGISTER(x) cfs_symbol_unregister(#x)
45 #define PORTAL_SYMBOL_GET(x) ((typeof(&x))cfs_symbol_get(#x))
46 #define PORTAL_SYMBOL_PUT(x) cfs_symbol_put(#x)
48 #define PORTAL_MODULE_USE do{int i = 0; i++;}while(0)
49 #define PORTAL_MODULE_UNUSE do{int i = 0; i--;}while(0)
51 #define num_online_cpus() cfs_online_cpus()
53 /******************************************************************************/
54 /* XXX Liang: There is no module parameter supporting in OSX */
55 #define CFS_MODULE_PARM(name, t, type, perm, desc)
57 #define CFS_SYSFS_MODULE_PARM 0 /* no sysfs access to module parameters */
58 /******************************************************************************/
60 #else /* !__KERNEL__ */
66 # include <machine/limits.h>
67 # include <sys/types.h>
70 #define BITS_PER_LONG LONG_BIT
71 /******************************************************************************/
73 * Support for temporary event tracing with minimal Heisenberg effect. */
86 # define LWT_EVENT(p1,p2,p3,p4) /* no lwt implementation yet */
88 /* -------------------------------------------------------------------------- */
90 #define IOCTL_LIBCFS_TYPE struct libcfs_ioctl_data
97 # define LI_POISON ((int)0x5a5a5a5a)
98 # define LL_POISON ((long)0x5a5a5a5a)
99 # define LP_POISON ((void *)(long)0x5a5a5a5a)