PatchworkOS  69292a3
A non-POSIX operating system.
Loading...
Searching...
No Matches
cache.h File Reference
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <kernel/cpu/cpu.h>
#include <kernel/sync/lock.h>
#include <sys/list.h>
Include dependency graph for cache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cache_slab_layout_t
 Cache slab layout structure. More...
 
struct  cache_t
 Cache structure. More...
 

Macros

#define CACHE_LIMIT   16
 Maximum number of free slabs in a cache.
 
#define CACHE_BUFCTL_END   (0)
 End of buffer control list marker.
 
#define CACHE_LINE   64
 Cache line size in bytes.
 
#define CACHE_SLAB_PAGES   64
 Number of pages in a slab.
 
#define CACHE_CREATE(_cache, _name, _size, _alignment, _ctor, _dtor)
 Macro to create a cache initializer.
 

Typedefs

typedef struct cache cache_t
 
typedef uint16_t cache_bufctl_t
 Buffer control type.
 

Functions

struct ALIGNED (CACHE_LINE)
 
void * cache_alloc (cache_t *cache)
 Allocate an object from the cache.
 
void cache_free (void *obj)
 Free an object back to its cache.
 

Variables

 cache_slab_t
 
 cache_cpu_t
 

Typedef Documentation

◆ cache_t

typedef struct cache cache_t

Definition at line 11 of file cache.h.