diff options
author | Richard Braun <rbraun@sceen.net> | 2017-03-17 21:13:44 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-03-17 21:13:44 +0100 |
commit | a6a4c99fda54e3058387a465ddda76019033f789 (patch) | |
tree | 1a993fd90c5ad49fec0039e5438b5e3aa1879323 /kern | |
parent | f81a2e65d7621253668d860a75f1ff5ae3070495 (diff) |
kern/turnstile: very early initialization
Diffstat (limited to 'kern')
-rw-r--r-- | kern/turnstile.c | 6 | ||||
-rw-r--r-- | kern/turnstile.h | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/kern/turnstile.c b/kern/turnstile.c index 43629376..f5e94db5 100644 --- a/kern/turnstile.c +++ b/kern/turnstile.c @@ -500,14 +500,18 @@ turnstile_ctor(void *ptr) } void __init -turnstile_setup(void) +turnstile_bootstrap(void) { unsigned int i; for (i = 0; i < ARRAY_SIZE(turnstile_htable); i++) { turnstile_bucket_init(&turnstile_htable[i]); } +} +void __init +turnstile_setup(void) +{ kmem_cache_init(&turnstile_cache, "turnstile", sizeof(struct turnstile), CPU_L1_SIZE, turnstile_ctor, 0); } diff --git a/kern/turnstile.h b/kern/turnstile.h index 21a5a1a9..4bc8f74d 100644 --- a/kern/turnstile.h +++ b/kern/turnstile.h @@ -101,6 +101,15 @@ turnstile_td_get_turnstile(const struct turnstile_td *td) void turnstile_td_propagate_priority(struct turnstile_td *td); /* + * Early initialization of the turnstile module. + * + * This module is initialized by architecture-specific code. It should + * be one of the first modules to be initialized since it's used by + * synchronization objects that may be accessed very early. + */ +void turnstile_bootstrap(void); + +/* * Initialize the turnstile module. */ void turnstile_setup(void); |