MOS Source Code
Loading...
Searching...
No Matches
slab_autoinit.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include "mos/misc/setup.h"
6
7#define _DO_SLAB_AUTOINIT(name, var, type, func) \
8 static void func(void) \
9 { \
10 var = kmemcache_create(name, sizeof(type)); \
11 } \
12 MOS_INIT(SLAB_AUTOINIT, func)
13
14#define SLAB_AUTOINIT(name, var, type) _DO_SLAB_AUTOINIT(name, var, type, MOS_CONCAT(__slab_autoinit_, __COUNTER__))