mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-08-27 16:28:56 +00:00
Enforce the number of pages in a sector to be a power of two.
This commit is contained in:
parent
a6148ac3d0
commit
8b7e743921
@ -53,6 +53,11 @@
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
|
||||
#if COFFEE_PAGES_PER_SECTOR & (COFFEE_PAGES_PER_SECTOR - 1)
|
||||
#error COFFEE_PAGES_PER_SECTOR must be a power of two.
|
||||
#error Change COFFEE_PAGES_PER_SECTOR in cfs-coffee-arch.h.
|
||||
#endif
|
||||
|
||||
#define kb * 1024UL
|
||||
#define Mb * (1024 kb)
|
||||
|
||||
@ -322,6 +327,7 @@ find_contiguous_pages(unsigned wanted)
|
||||
return start;
|
||||
}
|
||||
}
|
||||
/* Jump to the next sector. */
|
||||
page = (page + COFFEE_PAGES_PER_SECTOR) & ~(COFFEE_PAGES_PER_SECTOR - 1);
|
||||
} else {
|
||||
start = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user