* Otherwise we failed to acquire all the tokens.
* Release whatever we did get.
*/
+ KASSERT(tok->t_desc, ("token %p is not initialized", tok));
strncpy(td->td_gd->gd_cnt.v_token_name,
tok->t_desc,
sizeof(td->td_gd->gd_cnt.v_token_name) - 1);
static int unix_connect(const char *path);
static void usage_err(const char *ctl, ...);
static void usage_help(_Bool);
+static void init_locks(void);
static int save_ac;
static char **save_av;
}
/*
+ * Initialize pool tokens and other necessary locks
+ */
+static void
+init_locks(void)
+{
+
+#ifdef SMP
+ /*
+ * Get the initial mplock with a count of 1 for the BSP.
+ * This uses a LOGICAL cpu ID, ie BSP == 0.
+ */
+ cpu_get_initial_mplock();
+#endif
+
+ /* our token pool needs to work early */
+ lwkt_token_pool_init();
+
+}
+
+/*
* Initialize kernel memory. This reserves kernel virtual memory by using
* MAP_VPAGETABLE
*/
mi_proc0init(&gd->mi, proc0paddr);
lwp0.lwp_md.md_regs = &proc0_tf;
- /*init_locks();*/
-#ifdef SMP
- /*
- * Get the initial mplock with a count of 1 for the BSP.
- * This uses a LOGICAL cpu ID, ie BSP == 0.
- */
- cpu_get_initial_mplock();
-#endif
+ init_locks();
cninit();
rand_initialize();
#if 0 /* #ifdef DDB */
static int unix_connect(const char *path);
static void usage_err(const char *ctl, ...);
static void usage_help(_Bool);
+static void init_locks(void);
static int save_ac;
static char **save_av;
tls_set_gs(&CPU_prvspace[0], sizeof(struct privatespace));
}
+
+/*
+ * Initialize pool tokens and other necessary locks
+ */
+static void
+init_locks(void)
+{
+
+#ifdef SMP
+ /*
+ * Get the initial mplock with a count of 1 for the BSP.
+ * This uses a LOGICAL cpu ID, ie BSP == 0.
+ */
+ cpu_get_initial_mplock();
+#endif
+
+ /* our token pool needs to work early */
+ lwkt_token_pool_init();
+
+}
+
+
/*
* Initialize very low level systems including thread0, proc0, etc.
*/
mi_proc0init(&gd->mi, proc0paddr);
lwp0.lwp_md.md_regs = &proc0_tf;
- /*init_locks();*/
-#ifdef SMP
- /*
- * Get the initial mplock with a count of 1 for the BSP.
- * This uses a LOGICAL cpu ID, ie BSP == 0.
- */
- cpu_get_initial_mplock();
-#endif
+ init_locks();
cninit();
rand_initialize();
#if 0 /* #ifdef DDB */