mmu: fix an unsigned/signed comparison error

-Werror=sign-compare complains about when comparing (unsigned)level with
page_mapper.nr_page_sizes().
Since nr_page_sizes() is meaningful only when it's non-negative and the
mmu::nr_page_sizes is unsigned, changing the return types of all
nr_page_sizes functions to unsigned is reasonable.

Signed-off-by: Boqun Feng <boqun.feng@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: add unused attribute to unused function

-Werror=unused-function complains symbol_binding is unused, add an
attribute of unused to mark this function unused.

Signed-off-by: Boqun Feng <boqun.feng@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: fix an unused-value error in LOCK/UNLOCK

According to http://gcc.gnu.org/gcc-4.9/porting_to.html, gcc now warns
about unused right-hand side of a comma expression that contains no side
effects.
Rewrite LOCK/UNCLOCK using inline funciton instead of comma expression.

Signed-off-by: Boqun Feng <boqun.feng@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>