ftl: initial implementation of the Flash Translation Layer

This commit is contained in:
S.J.R. van Schaik 2017-05-15 16:33:11 +02:00
parent bd326ad795
commit 2b5225ef98
4 changed files with 682 additions and 0 deletions

View file

@ -21,6 +21,9 @@
#define ROUND_DOWN(x, k) ((x) & ~((k) - 1))
#define ROUND_UP(x, k) (((x) + (k) - 1) & ~((k) - 1))
#define is_aligned(x, k) (!((x) & ((1 << (k)) - 1)))
#define align_eq(x, y, k) (!(((x) ^ (y)) >> k))
/* Bit manipulation */
#define BIT_SIZE(t) (CHAR_BIT * sizeof(t))
#define BIT(n) (1 << (n))