diff options
author | neal <neal> | 2008-02-15 10:46:04 +0000 |
---|---|---|
committer | neal <neal> | 2008-02-15 10:46:04 +0000 |
commit | 24e886a83566fc8f608f63aed1c1edcd1f269f37 (patch) | |
tree | 4e34f04079b650cf4299c1bfb96d4759104fee6e | |
parent | fba5fb69bc007ccbbd18103b0f3f577c0f76326a (diff) |
2008-02-15 Neal H. Walfield <neal@gnu.org>
* l4/math.h (_L4_lsb): Count correctly.
* l4/space.h: Include <assert.h>.
(_L4_fpage): Add asserts.
-rw-r--r-- | libl4/ChangeLog | 7 | ||||
-rw-r--r-- | libl4/l4/math.h | 2 | ||||
-rw-r--r-- | libl4/l4/space.h | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/libl4/ChangeLog b/libl4/ChangeLog index a60637e..376487a 100644 --- a/libl4/ChangeLog +++ b/libl4/ChangeLog @@ -1,3 +1,10 @@ +2008-02-15 Neal H. Walfield <neal@gnu.org> + + * l4/math.h (_L4_lsb): Count correctly. + + * l4/space.h: Include <assert.h>. + (_L4_fpage): Add asserts. + 2008-02-05 Neal H. Walfield <neal@gnu.org> * l4/features.h [_L4_COMPAT]: Enable the L4 compatability diff --git a/libl4/l4/math.h b/libl4/l4/math.h index f5a2a3c..901d19f 100644 --- a/libl4/l4/math.h +++ b/libl4/l4/math.h @@ -112,7 +112,7 @@ _L4_lsb (_L4_word_t data) #endif __L4_LSB_TRY(32); __L4_LSB_TRY(31); __L4_LSB_TRY(30); __L4_LSB_TRY(29); __L4_LSB_TRY(28); __L4_LSB_TRY(27); __L4_LSB_TRY(26); __L4_LSB_TRY(25); - __L4_LSB_TRY(24); __L4_LSB_TRY(23); __L4_LSB_TRY(22); __L4_LSB_TRY(11); + __L4_LSB_TRY(24); __L4_LSB_TRY(23); __L4_LSB_TRY(22); __L4_LSB_TRY(21); __L4_LSB_TRY(20); __L4_LSB_TRY(19); __L4_LSB_TRY(18); __L4_LSB_TRY(17); __L4_LSB_TRY(16); __L4_LSB_TRY(15); __L4_LSB_TRY(14); __L4_LSB_TRY(13); __L4_LSB_TRY(12); __L4_LSB_TRY(11); __L4_LSB_TRY(10); __L4_LSB_TRY(9); diff --git a/libl4/l4/space.h b/libl4/l4/space.h index 715bcf8..53d2193 100644 --- a/libl4/l4/space.h +++ b/libl4/l4/space.h @@ -26,6 +26,7 @@ #include <l4/math.h> #include <l4/bits/space.h> #include <l4/syscall.h> +#include <assert.h> typedef _L4_RAW @@ -81,6 +82,10 @@ _L4_fpage (_L4_word_t base, int size) { __L4_fpage_t fpage; _L4_word_t msb = _L4_msb (size) - 1; + _L4_word_t lsb = _L4_lsb (size) - 1; + + assert ((base & ((1 << 10) - 1)) == 0); + assert (msb == lsb); fpage.base = base >> 10; fpage.log2_size = size ? ((1 << msb) == size ? msb : msb + 1) : 0; |