bugfix: slab增加自旋锁

This commit is contained in:
fslongjin
2022-08-01 15:04:03 +08:00
parent 2fd21e0395
commit bc1d2562c0
2 changed files with 19 additions and 12 deletions

View File

@ -4,6 +4,7 @@
#include <common/glib.h>
#include <common/printk.h>
#include <common/kprint.h>
#include <common/spinlock.h>
#define SIZEOF_LONG_ALIGN(size) ((size + sizeof(long) - 1) & ~(sizeof(long) - 1))
#define SIZEOF_INT_ALIGN(size) ((size + sizeof(int) - 1) & ~(sizeof(int) - 1))
@ -42,6 +43,8 @@ struct slab
// dma内存池对象
struct slab_obj *cache_dma_pool_entry;
spinlock_t lock; // 当前内存池的操作锁
// 内存池的构造函数和析构函数
void *(*constructor)(void *vaddr, ul arg);
void *(*destructor)(void *vaddr, ul arg);