extern afs_kmutex_t rx_refcnt_mutex;
extern afs_kmutex_t des_init_mutex;
extern afs_kmutex_t des_random_mutex;
+#ifndef KERNEL
extern afs_kmutex_t rx_clock_mutex;
extern afs_kmutex_t rxi_connCacheMutex;
extern afs_kmutex_t event_handler_mutex;
extern afs_kcondvar_t rx_event_handler_cond;
extern afs_kcondvar_t rx_listener_cond;
+#endif /* !KERNEL */
static afs_kmutex_t epoch_mutex;
static afs_kmutex_t rx_init_mutex;
static void
rxi_InitPthread(void)
{
- MUTEX_INIT(&rx_clock_mutex, "clock", MUTEX_DEFAULT, 0);
- MUTEX_INIT(&rx_stats_mutex, "stats", MUTEX_DEFAULT, 0);
- MUTEX_INIT(&rx_atomic_mutex, "atomic", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rx_quota_mutex, "quota", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rx_pthread_mutex, "pthread", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rx_packets_mutex, "packets", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rx_refcnt_mutex, "refcnts", MUTEX_DEFAULT, 0);
- MUTEX_INIT(&epoch_mutex, "epoch", MUTEX_DEFAULT, 0);
- MUTEX_INIT(&rx_init_mutex, "init", MUTEX_DEFAULT, 0);
- MUTEX_INIT(&event_handler_mutex, "event handler", MUTEX_DEFAULT, 0);
+#ifndef KERNEL
+ MUTEX_INIT(&rx_clock_mutex, "clock", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rxi_connCacheMutex, "conn cache", MUTEX_DEFAULT, 0);
+ MUTEX_INIT(&event_handler_mutex, "event handler", MUTEX_DEFAULT, 0);
MUTEX_INIT(&listener_mutex, "listener", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rx_if_init_mutex, "if init", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rx_if_mutex, "if", MUTEX_DEFAULT, 0);
+#endif
+ MUTEX_INIT(&rx_stats_mutex, "stats", MUTEX_DEFAULT, 0);
+ MUTEX_INIT(&rx_atomic_mutex, "atomic", MUTEX_DEFAULT, 0);
+ MUTEX_INIT(&epoch_mutex, "epoch", MUTEX_DEFAULT, 0);
+ MUTEX_INIT(&rx_init_mutex, "init", MUTEX_DEFAULT, 0);
MUTEX_INIT(&rx_debug_mutex, "debug", MUTEX_DEFAULT, 0);
+#ifndef KERNEL
CV_INIT(&rx_event_handler_cond, "evhand", CV_DEFAULT, 0);
CV_INIT(&rx_listener_cond, "rxlisten", CV_DEFAULT, 0);
+#endif
osi_Assert(pthread_key_create(&rx_thread_id_key, NULL) == 0);
osi_Assert(pthread_key_create(&rx_ts_info_key, NULL) == 0);
MUTEX_INIT(&rx_connHashTable_lock, "rx_connHashTable_lock", MUTEX_DEFAULT,
0);
MUTEX_INIT(&rx_serverPool_lock, "rx_serverPool_lock", MUTEX_DEFAULT, 0);
+#ifndef KERNEL
MUTEX_INIT(&rxi_keyCreate_lock, "rxi_keyCreate_lock", MUTEX_DEFAULT, 0);
+#endif
#endif /* RX_ENABLE_LOCKS */
}
EXT afs_kmutex_t rx_freePktQ_lock;
#endif /* RX_ENABLE_LOCKS */
-#if defined(AFS_PTHREAD_ENV)
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
#define RX_ENABLE_TSFPQ
EXT int rx_TSFPQGlobSize GLOBALSINIT(3); /* number of packets to transfer between global and local queues in one op */
EXT int rx_TSFPQLocalMax GLOBALSINIT(15); /* max number of packets on local FPQ before returning a glob to the global pool */
(rx_ts_info_p)->_FPQ.checkin_ops++; \
(rx_ts_info_p)->_FPQ.checkin_xfer += (num_transfer); \
} while(0)
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV && !KERNEL */
/* Number of free packets */
EXT int rx_nFreePackets GLOBALSINIT(0);
#endif
/* variable initialization for the benefit of darwin compiler; if it causes
problems elsewhere, conditionalize for darwin or fc_test compile breaks */
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
struct rxkad_global_stats rxkad_global_stats;
pthread_mutex_t rxkad_global_stats_lock;
pthread_key_t rxkad_stats_key;
-#else /* AFS_PTHREAD_ENV */
+#else /* AFS_PTHREAD_ENV && !KERNEL */
struct rxkad_stats rxkad_stats;
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV && !KERNEL */
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
/* Pthread initialisation */
static pthread_once_t rxkad_once_init = PTHREAD_ONCE_INIT;
extern pthread_mutex_t rxkad_random_mutex;
RXKAD_GLOBAL_STATS_UNLOCK;
return 0;
}
-#else
+#else /* AFS_PTHREAD_ENV && !KERNEL */
void
rxkad_Init(void)
{
return;
}
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV && !KERNEL */
/* static prototypes */
static afs_int32 ComputeSum(struct rx_packet *apacket,
live with the nearly accurate aggregation (e.g. you might miss a few increments,
but the resulting aggregation should be almost correct). */
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
typedef struct rxkad_stats_t {
#else
struct rxkad_stats {
afs_uint32 clientObjects;
afs_uint32 serverObjects;
long spares[8];
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
struct rxkad_stats_t * next;
struct rxkad_stats_t * prev;
} rxkad_stats_t; /* put these here for convenience */
-#else /* AFS_PTHREAD_ENV */
+#else /* AFS_PTHREAD_ENV && !KERNEL */
};
#ifdef AFS_NT40_ENV
struct rxkad_stats rxkad_stats; /* put this here for convenience */
#endif
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV && !KERNEL*/
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
struct rxkad_global_stats {
rxkad_stats_t * first;
rxkad_stats_t * last;
#define ADD_RXKAD_STATS(stats_elem, inc_value)
#define SUB_RXKAD_STATS(stats_elem, dec_value)
#endif /* AFS_OBSD38_ENV */
-#else /* AFS_PTHREAD_ENV */
+#else /* AFS_PTHREAD_ENV && !KERNEL*/
#define INC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem++
#define DEC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem--
#define ADD_RXKAD_STATS(stats_elem, inc_value) rxkad_stats.stats_elem += (inc_value)
#define SUB_RXKAD_STATS(stats_elem, dec_value) rxkad_stats.stats_elem -= (dec_value)
#define GET_RXKAD_STATS(stats) memcpy((stats), &rxkad_stats, sizeof(rxkad_stats))
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV && !KERNEL */
#if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
#define RXKAD_STATS_DECLSPEC extern
#endif
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
RXKAD_STATS_DECLSPEC struct rxkad_global_stats rxkad_global_stats;
-#else /* AFS_PTHREAD_ENV */
+#else /* AFS_PTHREAD_ENV && !KERNEL */
RXKAD_STATS_DECLSPEC struct rxkad_stats rxkad_stats;
#endif
#ifndef _AFS_PTHREAD_GLOCK_H_
#define _AFS_PTHREAD_GLOCK_H_
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
#include <pthread.h>
#include <afs/opr.h>
#define UNLOCK_GLOBAL_MUTEX \
opr_Verify(pthread_recursive_mutex_unlock(&grmutex)==0)
-#else
+#else /* AFS_PTHREAD_ENV && !KERNEL */
#define LOCK_GLOBAL_MUTEX
#define UNLOCK_GLOBAL_MUTEX
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV && !KERNEL */
#endif /* _AFS_PTHREAD_GLOCK_H_ */