+extern processor_t master_processor;
+
+/*
+ * Processor state is accessed by locking the scheduling lock
+ * for the assigned processor set.
+ */
+#define PROCESSOR_OFF_LINE 0 /* Not available */
+#define PROCESSOR_SHUTDOWN 1 /* Going off-line */
+#define PROCESSOR_START 2 /* Being started */
+#define PROCESSOR_INACTIVE 3 /* Inactive (unavailable) */
+#define PROCESSOR_IDLE 4 /* Idle (available) */
+#define PROCESSOR_DISPATCHING 5 /* Dispatching (idle -> active) */
+#define PROCESSOR_RUNNING 6 /* Normal execution */
+
+extern processor_t current_processor(void);
+
+extern processor_t cpu_to_processor(
+ int cpu);
+
+/* Lock macros */
+
+#define pset_lock(p) simple_lock(&(p)->sched_lock)
+#define pset_unlock(p) simple_unlock(&(p)->sched_lock)
+#define pset_lock_init(p) simple_lock_init(&(p)->sched_lock, 0)
+
+/* Update hints */
+
+#define pset_pri_hint(ps, p, pri) \
+MACRO_BEGIN \
+ if ((p) != (ps)->low_pri) { \
+ if ((pri) < (ps)->low_pri->current_pri) \
+ (ps)->low_pri = (p); \
+ else \
+ if ((ps)->low_pri->state < PROCESSOR_IDLE) \
+ (ps)->low_pri = (p); \
+ } \
+MACRO_END
+
+#define pset_count_hint(ps, p, cnt) \
+MACRO_BEGIN \
+ if ((p) != (ps)->low_count) { \
+ if ((cnt) < (ps)->low_count->runq.count) \
+ (ps)->low_count = (p); \
+ else \
+ if ((ps)->low_count->state < PROCESSOR_IDLE) \
+ (ps)->low_count = (p); \
+ } \
+MACRO_END
+
+extern void processor_bootstrap(void) __attribute__((section("__TEXT, initcode")));
+
+extern void processor_init(
+ processor_t processor,
+ int cpu_id,
+ processor_set_t processor_set) __attribute__((section("__TEXT, initcode")));
+
+extern void processor_meta_init(
+ processor_t processor,
+ processor_t primary);