-#if defined(__KERNEL__) && defined(_VX_INFO_DEF_)
-
-#include <linux/spinlock.h>
-#include <linux/jiffies.h>
-#include <asm/atomic.h>
-#include <asm/param.h>
-#include <asm/cpumask.h>
-
-/* context sub struct */
-
-struct _vx_sched {
- spinlock_t tokens_lock; /* lock for this structure */
-
- int fill_rate; /* Fill rate: add X tokens... */
- int interval; /* Divisor: per Y jiffies */
- atomic_t tokens; /* number of CPU tokens in this context */
- int tokens_min; /* Limit: minimum for unhold */
- int tokens_max; /* Limit: no more than N tokens */
- uint32_t jiffies; /* add an integral multiple of Y to this */
-
- uint64_t ticks; /* token tick events */
- cpumask_t cpus_allowed; /* cpu mask for context */
-};
-
-static inline void vx_info_init_sched(struct _vx_sched *sched)
-{
- /* scheduling; hard code starting values as constants */
- sched->fill_rate = 1;
- sched->interval = 4;
- sched->tokens_min = HZ >> 4;
- sched->tokens_max = HZ >> 1;
- sched->jiffies = jiffies;
- sched->tokens_lock = SPIN_LOCK_UNLOCKED;
-
- atomic_set(&sched->tokens, HZ >> 2);
- sched->cpus_allowed = CPU_MASK_ALL;
-}
-
-static inline void vx_info_exit_sched(struct _vx_sched *sched)
-{
- return;
-}
-
-static inline int vx_info_proc_sched(struct _vx_sched *sched, char *buffer)
-{
- return sprintf(buffer,
- "Ticks:\t%16lld\n"
- "Token:\t\t%8d\n"
- "FillRate:\t%8d\n"
- "Interval:\t%8d\n"
- "TokensMin:\t%8d\n"
- "TokensMax:\t%8d\n"
- ,sched->ticks
- ,atomic_read(&sched->tokens)
- ,sched->fill_rate
- ,sched->interval
- ,sched->tokens_min
- ,sched->tokens_max
- );
-}
-
-
-#else /* _VX_INFO_DEF_ */