diff options
author | marcus <marcus> | 2005-01-22 02:19:59 +0000 |
---|---|---|
committer | marcus <marcus> | 2005-01-22 02:19:59 +0000 |
commit | f99381602bdf75edeac68251c725f280186ed676 (patch) | |
tree | 4d18758a7681da53862bf0429b9381821aa60c6e /libl4 | |
parent | 87f61c6c747f21a1ba4c0c81b01bd20aae47f8eb (diff) |
2005-01-22 Marcus Brinkmann <marcus@gnu.org>
* ia32/Makefile.am (nobase_include_HEADERS): Add l4/bits/arch.h,
l4/bits/compat/arch.h, l4/bits/compat.h.
* ia32/l4/bits/arch.h, ia32/l4/bits/compat/arch.h,
ia32/l4/bits/gnu/arch.h: New file.
* ia32/l4/bits/stubs-init.h (__L4_SETUP_SYSCALL_X): New macro.
(__L4_SETUP_SYSCALL): Implement using __L4_SETUP_SYSCALL_X.
(l4_init_stubs): Setup set_gs0 syscall stub.
* ia32/l4/bits/syscall.h (_L4_set_gs0): New function.
* ia32/l4/bits/stubs.h (__l4_set_gs0): New prototype.
* l4/arch.h: New file.
* l4/kip.h (struct _L4_kip): New members _pad5, arch0, arch1,
arch2 and arch3.
* headers.m4: Add arch.h, bits/arch.h, bits/compat/arch.h,
bits/gnu/arch.h.
* l4.h: Include l4/arch.h.
* Makefile.am: Add arch.h.
* ia32/l4/bits/vregs.h (_L4_utcb): Use %gs:4, not %gs:0.
Diffstat (limited to 'libl4')
-rw-r--r-- | libl4/ChangeLog | 20 | ||||
-rw-r--r-- | libl4/Makefile.am | 5 | ||||
-rw-r--r-- | libl4/headers.m4 | 6 | ||||
-rw-r--r-- | libl4/ia32/Makefile.am | 8 | ||||
-rw-r--r-- | libl4/ia32/l4/bits/arch.h | 33 | ||||
-rw-r--r-- | libl4/ia32/l4/bits/compat/arch.h | 24 | ||||
-rw-r--r-- | libl4/ia32/l4/bits/gnu/arch.h | 32 | ||||
-rw-r--r-- | libl4/ia32/l4/bits/stubs-init.h | 10 | ||||
-rw-r--r-- | libl4/ia32/l4/bits/stubs.h | 3 | ||||
-rw-r--r-- | libl4/ia32/l4/bits/syscall.h | 13 | ||||
-rw-r--r-- | libl4/ia32/l4/bits/vregs.h | 2 | ||||
-rw-r--r-- | libl4/l4.h | 3 | ||||
-rw-r--r-- | libl4/l4/arch.h | 30 | ||||
-rw-r--r-- | libl4/l4/kip.h | 9 |
14 files changed, 184 insertions, 14 deletions
diff --git a/libl4/ChangeLog b/libl4/ChangeLog index 954bbc7..8e8782b 100644 --- a/libl4/ChangeLog +++ b/libl4/ChangeLog @@ -1,3 +1,23 @@ +2005-01-22 Marcus Brinkmann <marcus@gnu.org> + + * ia32/Makefile.am (nobase_include_HEADERS): Add l4/bits/arch.h, + l4/bits/compat/arch.h, l4/bits/compat.h. + * ia32/l4/bits/arch.h, ia32/l4/bits/compat/arch.h, + ia32/l4/bits/gnu/arch.h: New file. + * ia32/l4/bits/stubs-init.h (__L4_SETUP_SYSCALL_X): New macro. + (__L4_SETUP_SYSCALL): Implement using __L4_SETUP_SYSCALL_X. + (l4_init_stubs): Setup set_gs0 syscall stub. + * ia32/l4/bits/syscall.h (_L4_set_gs0): New function. + * ia32/l4/bits/stubs.h (__l4_set_gs0): New prototype. + * l4/arch.h: New file. + * l4/kip.h (struct _L4_kip): New members _pad5, arch0, arch1, + arch2 and arch3. + * headers.m4: Add arch.h, bits/arch.h, bits/compat/arch.h, + bits/gnu/arch.h. + * l4.h: Include l4/arch.h. + * Makefile.am: Add arch.h. + * ia32/l4/bits/vregs.h (_L4_utcb): Use %gs:4, not %gs:0. + 2005-01-06 Neal H. Walfield <neal@gnu.org> * ia32/l4/bits/syscall.h (_L4_unmap): Fix register assignments. diff --git a/libl4/Makefile.am b/libl4/Makefile.am index df9eb71..13262b8 100644 --- a/libl4/Makefile.am +++ b/libl4/Makefile.am @@ -1,5 +1,5 @@ # Makefile.am - Makefile template for libl4. -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Marcus Brinkmann. # # This file is part of the GNU Hurd. @@ -36,7 +36,8 @@ compat_headers := $(common_headers) # Main libl4 header files. l4_headers = features.h globals.h init.h ipc.h kip.h math.h message.h \ misc.h pagefault.h schedule.h space.h stubs-init.h stubs.h \ - syscall.h thread.h thread-start.h types.h vregs.h sigma0.h + syscall.h thread.h thread-start.h types.h vregs.h sigma0.h \ + arch.h include_HEADERS = l4.h nobase_include_HEADERS = $(addprefix l4/, $(l4_headers)) \ diff --git a/libl4/headers.m4 b/libl4/headers.m4 index 5209095..2874442 100644 --- a/libl4/headers.m4 +++ b/libl4/headers.m4 @@ -1,5 +1,5 @@ # headers.m4 - Autoconf snippets to install links for header files. -# Copyright 2003, 2004 Free Software Foundation, Inc. +# Copyright 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Marcus Brinkmann <marcus@gnu.org>. # # This file is free software; as a special exception the author gives @@ -20,6 +20,7 @@ AC_CONFIG_LINKS([ include/l4/math.h:libl4/l4/math.h include/l4/message.h:libl4/l4/message.h include/l4/misc.h:libl4/l4/misc.h + include/l4/arch.h:libl4/l4/arch.h include/l4/pagefault.h:libl4/l4/pagefault.h include/l4/schedule.h:libl4/l4/schedule.h include/l4/space.h:libl4/l4/space.h @@ -58,6 +59,7 @@ AC_CONFIG_LINKS([ include/l4/bits/kip.h:libl4/${arch}/l4/bits/kip.h include/l4/bits/math.h:libl4/${arch}/l4/bits/math.h include/l4/bits/misc.h:libl4/${arch}/l4/bits/misc.h + include/l4/bits/arch.h:libl4/${arch}/l4/bits/arch.h include/l4/bits/space.h:libl4/${arch}/l4/bits/space.h include/l4/bits/stubs.h:libl4/${arch}/l4/bits/stubs.h include/l4/bits/stubs-init.h:libl4/${arch}/l4/bits/stubs-init.h @@ -66,9 +68,11 @@ AC_CONFIG_LINKS([ include/l4/bits/vregs.h:libl4/${arch}/l4/bits/vregs.h include/l4/bits/compat/ipc.h:libl4/${arch}/l4/bits/compat/ipc.h include/l4/bits/compat/misc.h:libl4/${arch}/l4/bits/compat/misc.h + include/l4/bits/compat/arch.h:libl4/${arch}/l4/bits/compat/arch.h include/l4/bits/compat/space.h:libl4/${arch}/l4/bits/compat/space.h include/l4/bits/gnu/ipc.h:libl4/${arch}/l4/bits/gnu/ipc.h include/l4/bits/gnu/kip.h:libl4/${arch}/l4/bits/gnu/kip.h include/l4/bits/gnu/misc.h:libl4/${arch}/l4/bits/gnu/misc.h + include/l4/bits/gnu/arch.h:libl4/${arch}/l4/bits/gnu/arch.h include/l4/bits/gnu/space.h:libl4/${arch}/l4/bits/gnu/space.h ]) diff --git a/libl4/ia32/Makefile.am b/libl4/ia32/Makefile.am index 349eae0..1ab0c33 100644 --- a/libl4/ia32/Makefile.am +++ b/libl4/ia32/Makefile.am @@ -1,5 +1,5 @@ # Makefile.am - Makefile template for libl4/ia32. -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Marcus Brinkmann. # # This file is part of the GNU Hurd. @@ -22,8 +22,8 @@ nobase_include_HEADERS = l4/bits/types.h \ l4/bits/math.h l4/bits/vregs.h l4/bits/syscall.h \ l4/bits/stubs.h l4/bits/stubs-init.h \ l4/bits/kip.h l4/bits/space.h l4/bits/ipc.h \ - l4/bits/misc.h \ + l4/bits/misc.h l4/bits/arch.h \ l4/bits/compat/ipc.h l4/bits/compat/misc.h \ - l4/bits/compat/space.h \ + l4/bits/compat/space.h l4/bits/compat/arch.h \ l4/bits/gnu/ipc.h l4/bits/gnu/kip.h l4/bits/gnu/misc.h \ - l4/bits/gnu/space.h + l4/bits/gnu/space.h l4/bits/gnu/arch.h diff --git a/libl4/ia32/l4/bits/arch.h b/libl4/ia32/l4/bits/arch.h new file mode 100644 index 0000000..7af173d --- /dev/null +++ b/libl4/ia32/l4/bits/arch.h @@ -0,0 +1,33 @@ +/* l4/bits/arch.h - L4 architecture definitions for ia32. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Written by Marcus Brinkmann <marcus@gnu.org>. + + 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_ARCH_H +# error "Never use <l4/bits/arch.h> directly; include <l4/arch.h> instead." +#endif + + +/* Now incorporate the public interfaces the user has selected. */ +#ifdef _L4_INTERFACE_L4 +#include <l4/bits/compat/arch.h> +#endif +#ifdef _L4_INTERFACE_GNU +#include <l4/bits/gnu/arch.h> +#endif diff --git a/libl4/ia32/l4/bits/compat/arch.h b/libl4/ia32/l4/bits/compat/arch.h new file mode 100644 index 0000000..487392a --- /dev/null +++ b/libl4/ia32/l4/bits/compat/arch.h @@ -0,0 +1,24 @@ +/* l4/bits/compat/arch.h - L4 architecture features for ia32. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Written by Marcus Brinkmann <marcus@gnu.org>. + + 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_ARCH_H +# error "Never use <l4/bits/compat/arch.h> directly; include <l4/arch.h> instead." +#endif diff --git a/libl4/ia32/l4/bits/gnu/arch.h b/libl4/ia32/l4/bits/gnu/arch.h new file mode 100644 index 0000000..f026de3 --- /dev/null +++ b/libl4/ia32/l4/bits/gnu/arch.h @@ -0,0 +1,32 @@ +/* l4/bits/gnu/arch.h - GNU L4 architecture features for ia32. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Written by Marcus Brinkmann <marcus@gnu.org>. + + 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_ARCH_H +# error "Never use <l4/bits/gnu/arch.h> directly; include <l4/arch.h> instead." +#endif + + +static inline void +_L4_attribute_always_inline +l4_set_gs0 (l4_word_t user_gs0) +{ + _L4_set_gs0 (user_gs0); +} diff --git a/libl4/ia32/l4/bits/stubs-init.h b/libl4/ia32/l4/bits/stubs-init.h index d7aef85..da8130b 100644 --- a/libl4/ia32/l4/bits/stubs-init.h +++ b/libl4/ia32/l4/bits/stubs-init.h @@ -1,5 +1,5 @@ /* stubs-init.h - Initialize system stubs in an architecture dependent way. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. Written by Marcus Brinkmann <marcus@gnu.org>. This file is part of the GNU L4 library. @@ -23,10 +23,12 @@ # error "Never use <l4/bits/stubs-init.h> directly; include <l4/stubs-init.h> instead." #endif -#define __L4_SETUP_SYSCALL(name) \ +#define __L4_SETUP_SYSCALL_X(name,kipname) \ extern void (*__l4_ ## name) (void); \ __l4_ ## name = (void (*) (void)) \ - (((l4_word_t) l4_kip ()) + l4_kip ()->name) + (((l4_word_t) l4_kip ()) + l4_kip ()->kipname) + +#define __L4_SETUP_SYSCALL(name) __L4_SETUP_SYSCALL_X(name,name) /* Initialize the syscall stubs. */ @@ -45,4 +47,6 @@ l4_init_stubs (void) __L4_SETUP_SYSCALL (space_control); __L4_SETUP_SYSCALL (processor_control); __L4_SETUP_SYSCALL (memory_control); + + __L4_SETUP_SYSCALL_X (set_gs0, arch0); }; diff --git a/libl4/ia32/l4/bits/stubs.h b/libl4/ia32/l4/bits/stubs.h index 604e898..088530c 100644 --- a/libl4/ia32/l4/bits/stubs.h +++ b/libl4/ia32/l4/bits/stubs.h @@ -1,5 +1,5 @@ /* stubs.h - L4 system call stubs for ia32. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. Written by Marcus Brinkmann <marcus@gnu.org>. This file is part of the GNU L4 library. @@ -36,3 +36,4 @@ __l4_syscall_stub_t __l4_unmap; __l4_syscall_stub_t __l4_space_control; __l4_syscall_stub_t __l4_processor_control; __l4_syscall_stub_t __l4_memory_control; +__l4_syscall_stub_t __l4_set_gs0; diff --git a/libl4/ia32/l4/bits/syscall.h b/libl4/ia32/l4/bits/syscall.h index c031906..9dd0655 100644 --- a/libl4/ia32/l4/bits/syscall.h +++ b/libl4/ia32/l4/bits/syscall.h @@ -316,3 +316,16 @@ _L4_memory_control (_L4_word_t control, _L4_word_t *attributes) return result; } + + +static inline void +_L4_attribute_always_inline +_L4_set_gs0 (_L4_word_t user_gs0) +{ + __asm__ __volatile__ ("push %%ebp\n" + "call *__l4_set_gs0\n" + "pop %%ebp\n" + : + : "a" (user_gs0) + : "ecx", "edx", "esi", "edi", "ebx"); +} diff --git a/libl4/ia32/l4/bits/vregs.h b/libl4/ia32/l4/bits/vregs.h index 5f22d84..363e222 100644 --- a/libl4/ia32/l4/bits/vregs.h +++ b/libl4/ia32/l4/bits/vregs.h @@ -31,7 +31,7 @@ _L4_utcb (void) { _L4_word_t *utcb; - __asm__ __volatile__ ("movl %%gs:0, %[utcb]" + __asm__ __volatile__ ("movl %%gs:4, %[utcb]" : [utcb] "=r" (utcb)); return utcb; @@ -1,5 +1,5 @@ /* l4.h - Public interface to L4. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. Written by Marcus Brinkmann <marcus@gnu.org>. This file is part of the GNU L4 library. @@ -30,5 +30,6 @@ #include <l4/space.h> #include <l4/ipc.h> #include <l4/misc.h> +#include <l4/arch.h> #endif /* l4.h */ diff --git a/libl4/l4/arch.h b/libl4/l4/arch.h new file mode 100644 index 0000000..ed353c2 --- /dev/null +++ b/libl4/l4/arch.h @@ -0,0 +1,30 @@ +/* l4/arch.h - Public interface to L4 architecture functions. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Written by Marcus Brinkmann <marcus@gnu.org>. + + 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_ARCH_H +#define _L4_ARCH_H 1 + +#include <l4/types.h> +#include <l4/bits/arch.h> + +/* Everything happens in the architecture specific files. */ + +#endif /* misc.h */ diff --git a/libl4/l4/kip.h b/libl4/l4/kip.h index 3f5e989..5fd77c8 100644 --- a/libl4/l4/kip.h +++ b/libl4/l4/kip.h @@ -1,5 +1,5 @@ /* l4/kip.h - Public interface to the L4 kernel interface page. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Written by Marcus Brinkmann <marcus@gnu.org>. This file is part of the GNU L4 library. @@ -242,6 +242,13 @@ struct _L4_kip _L4_word_t system_clock; _L4_word_t thread_switch; _L4_word_t schedule; + + _L4_word_t _pad5[5]; + + _L4_word_t arch0; + _L4_word_t arch1; + _L4_word_t arch2; + _L4_word_t arch3; }; |