aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/cache.h
blob: 1f451afd1acf54aa00d7fcdc1e38b4852cee453e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _CACHE_H
#define _CACHE_H

#include <stdint.h>
#include <com32.h>
#include "disk.h"
#include "fs.h"

/* The cache structure */
struct cache {
    block_t block;
    struct cache *prev;
    struct cache *next;
    void *data;
};

/* functions defined in cache.c */
void cache_init(struct device *, int);
const void *get_cache(struct device *, block_t);
struct cache *_get_cache_block(struct device *, block_t);
void cache_lock_block(struct cache *);

#endif /* cache.h */