1 |
|
/* kip.h - Public interface for the L4 kernel interface page. |
2 |
|
Copyright (C) 2003 Free Software Foundation, Inc. |
3 |
|
Written by Marcus Brinkmann <marcus@gnu.org>. |
4 |
|
|
5 |
|
This file is part of the GNU L4 library. |
6 |
|
|
7 |
|
The GNU L4 library is free software; you can redistribute it and/or |
8 |
|
modify it under the terms of the GNU Lesser General Public License |
9 |
|
as published by the Free Software Foundation; either version 2.1 of |
10 |
|
the License, or (at your option) any later version. |
11 |
|
|
12 |
|
The GNU L4 library is distributed in the hope that it will be |
13 |
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
14 |
|
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
GNU Lesser General Public License for more details. |
16 |
|
|
17 |
|
You should have received a copy of the GNU Lesser General Public |
18 |
|
License along with the GNU L4 library; if not, write to the Free |
19 |
|
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
20 |
|
02111-1307, USA. */ |
21 |
|
|
22 |
#ifndef _L4_KIP_H |
#ifndef _L4_KIP_H |
23 |
#define _L4_KIP_H 1 |
#define _L4_KIP_H 1 |
24 |
|
|
57 |
|
|
58 |
_L4_BITFIELD_32_64 (__pad, 28, 60)); |
_L4_BITFIELD_32_64 (__pad, 28, 60)); |
59 |
})) l4_api_flags_t; |
})) l4_api_flags_t; |
60 |
|
|
61 |
|
|
62 |
typedef _L4_RAW (l4_word_t, _L4_STRUCT1 ({ |
typedef _L4_RAW (l4_word_t, _L4_STRUCT1 ({ |
63 |
_L4_BITFIELD4 |
_L4_BITFIELD4 |
433 |
} |
} |
434 |
|
|
435 |
|
|
436 |
|
#define L4_MIN_PAGE_SIZE_LOG2 10 |
437 |
|
|
438 |
_L4_EXTERN_INLINE l4_word_t |
_L4_EXTERN_INLINE l4_word_t |
439 |
l4_page_size_mask (void) |
l4_page_size_mask (void) |
440 |
{ |
{ |
441 |
return l4_get_kernel_interface ()->page_info.page_size_mask << 10; |
return l4_get_kernel_interface ()->page_info.page_size_mask |
442 |
|
<< L4_MIN_PAGE_SIZE_LOG2; |
443 |
|
} |
444 |
|
|
445 |
|
|
446 |
|
_L4_EXTERN_INLINE l4_word_t l4_min_page_size_log2 (void) |
447 |
|
__attribute__((__const__)); |
448 |
|
|
449 |
|
_L4_EXTERN_INLINE l4_word_t |
450 |
|
l4_min_page_size_log2 (void) |
451 |
|
{ |
452 |
|
page_size_mask = l4_get_kernel_interface ()->page_info.page_size_mask; |
453 |
|
unsigned int page_size_log2 = L4_MIN_PAGE_SIZE_LOG2; |
454 |
|
|
455 |
|
/* There'd better be one bit set. */ |
456 |
|
while (!(page_size_mask & 1)) |
457 |
|
{ |
458 |
|
page_size_log2++; |
459 |
|
page_size_mask >>= 1; |
460 |
|
} |
461 |
|
|
462 |
|
return page_size_log2; |
463 |
|
} |
464 |
|
|
465 |
|
|
466 |
|
_L4_EXTERN_INLINE l4_word_t l4_min_page_size_log2 (void) |
467 |
|
__attribute__((__const__)); |
468 |
|
|
469 |
|
_L4_EXTERN_INLINE l4_word_t |
470 |
|
l4_min_page_size (void) |
471 |
|
{ |
472 |
|
return L4_WORD_C(1) << l4_min_page_size_log2 (); |
473 |
} |
} |
474 |
|
|
475 |
|
|