f3/libutils.h
Michel Machado 751b5a609f add f3brew (experimental)
f3brew, f3 block read write, tests block devices
writing and reading blocks directly to devices.

This is a not-functional version of f3brew.
The main contribution of this patch is to reorganize libprobe.{h,c},
so f3brew, and any future application, can reuse the library.
2014-10-10 09:54:39 -04:00

16 lines
276 B
C

#ifndef HEADER_LIBUTILS_H
#define HEADER_LIBUTILS_H
#include <stdint.h>
int ilog2(uint64_t x);
int ceiling_log2(uint64_t x);
static inline void *align_512(void *p)
{
uintptr_t ip = (uintptr_t)p;
return (void *)( (ip + 511) & ~511 );
}
#endif /* HEADER_LIBUTILS_H */