[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hurd-l4/libl4 ChangeLog l4/kip.h l4/types.h
From: |
Marcus Brinkmann |
Subject: |
hurd-l4/libl4 ChangeLog l4/kip.h l4/types.h |
Date: |
Thu, 18 Sep 2003 09:48:35 -0400 |
CVSROOT: /cvsroot/hurd
Module name: hurd-l4
Branch:
Changes by: Marcus Brinkmann <address@hidden> 03/09/18 09:48:35
Modified files:
libl4 : ChangeLog
libl4/l4 : kip.h types.h
Log message:
2003-09-18 Marcus Brinkmann <address@hidden>
* l4/kip.h (l4_min_page_size): New function.
(l4_min_page_size_log2): Likewise.
* l4/types.h (L4_WORD_C): Define macro.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/libl4/ChangeLog.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/libl4/l4/kip.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/libl4/l4/types.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: hurd-l4/libl4/ChangeLog
diff -u hurd-l4/libl4/ChangeLog:1.7 hurd-l4/libl4/ChangeLog:1.8
--- hurd-l4/libl4/ChangeLog:1.7 Wed Sep 17 10:22:23 2003
+++ hurd-l4/libl4/ChangeLog Thu Sep 18 09:48:35 2003
@@ -1,3 +1,10 @@
+2003-09-18 Marcus Brinkmann <address@hidden>
+
+ * l4/kip.h (l4_min_page_size): New function.
+ (l4_min_page_size_log2): Likewise.
+
+ * l4/types.h (L4_WORD_C): Define macro.
+
2003-09-17 Marcus Brinkmann <address@hidden>
* l4/math.h (__l4_msb): Rename to ...
Index: hurd-l4/libl4/l4/kip.h
diff -u hurd-l4/libl4/l4/kip.h:1.1 hurd-l4/libl4/l4/kip.h:1.2
--- hurd-l4/libl4/l4/kip.h:1.1 Sat Jul 26 13:26:09 2003
+++ hurd-l4/libl4/l4/kip.h Thu Sep 18 09:48:35 2003
@@ -1,3 +1,24 @@
+/* kip.h - Public interface for the L4 kernel interface page.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Marcus Brinkmann <address@hidden>.
+
+ This file is part of the GNU L4 library.
+
+ The GNU L4 library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ The GNU L4 library is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU L4 library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
#ifndef _L4_KIP_H
#define _L4_KIP_H 1
@@ -36,7 +57,7 @@
_L4_BITFIELD_32_64 (__pad, 28, 60));
})) l4_api_flags_t;
-
+
typedef _L4_RAW (l4_word_t, _L4_STRUCT1 ({
_L4_BITFIELD4
@@ -412,10 +433,43 @@
}
+#define L4_MIN_PAGE_SIZE_LOG2 10
+
_L4_EXTERN_INLINE l4_word_t
l4_page_size_mask (void)
{
- return l4_get_kernel_interface ()->page_info.page_size_mask << 10;
+ return l4_get_kernel_interface ()->page_info.page_size_mask
+ << L4_MIN_PAGE_SIZE_LOG2;
+}
+
+
+_L4_EXTERN_INLINE l4_word_t l4_min_page_size_log2 (void)
+ __attribute__((__const__));
+
+_L4_EXTERN_INLINE l4_word_t
+l4_min_page_size_log2 (void)
+{
+ page_size_mask = l4_get_kernel_interface ()->page_info.page_size_mask;
+ unsigned int page_size_log2 = L4_MIN_PAGE_SIZE_LOG2;
+
+ /* There'd better be one bit set. */
+ while (!(page_size_mask & 1))
+ {
+ page_size_log2++;
+ page_size_mask >>= 1;
+ }
+
+ return page_size_log2;
+}
+
+
+_L4_EXTERN_INLINE l4_word_t l4_min_page_size_log2 (void)
+ __attribute__((__const__));
+
+_L4_EXTERN_INLINE l4_word_t
+l4_min_page_size (void)
+{
+ return L4_WORD_C(1) << l4_min_page_size_log2 ();
}
Index: hurd-l4/libl4/l4/types.h
diff -u hurd-l4/libl4/l4/types.h:1.3 hurd-l4/libl4/l4/types.h:1.4
--- hurd-l4/libl4/l4/types.h:1.3 Tue Sep 9 18:07:49 2003
+++ hurd-l4/libl4/l4/types.h Thu Sep 18 09:48:35 2003
@@ -49,9 +49,11 @@
#if L4_WORDSIZE == L4_WORDSIZE_32
typedef l4_uint32_t l4_word_t;
+#define L4_WORD_C(c) c ## ULL
#else
#if L4_WORDSIZE == L4_WORDSIZE_64
typedef l4_uint64_t l4_word_t;
+#define L4_WORD_C(c) c ## UL
#else
#error "Unsupported word size."
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- hurd-l4/libl4 ChangeLog l4/kip.h l4/types.h,
Marcus Brinkmann <=