Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix location of library license in win32 ucontextes
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Nov 2010 15:48:03 +0000 (15:48 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Nov 2010 15:48:03 +0000 (15:48 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8762 48e7efb5-ca39-0410-a469-dd3cf9ba447f

COPYING
include/xbt/win32_ucontext.h
src/xbt/win32_ucontext.c

diff --git a/COPYING b/COPYING
index c580bd0..7f93632 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -108,7 +108,7 @@ Their copyright is the following:
  *      Lesser General Public License for more details.
  *
  *      You should have received a copy of the GNU Lesser General Public
- *      License along with QueueUserAPCEx in the file COPYING.LIB;
+ *      License along with SimGrid in the file LICENSE-LGPL-2.1;
  *      if not, write to the Free Software Foundation, Inc.,
  *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
index 4b85617..eb4f8d2 100644 (file)
@@ -15,7 +15,7 @@
  *      Lesser General Public License for more details.\r
  *\r
  *      You should have received a copy of the GNU Lesser General Public\r
- *      License along with QueueUserAPCEx in the file COPYING.LIB;\r
+ *      License along with SimGrid in the file LICENSE-LGPL-2.1;\r
  *      if not, write to the Free Software Foundation, Inc.,\r
  *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\r
  */  \r
 #define UCONTEXT_H\r
     \r
 #include <windows.h>\r
-    \rtypedef struct __stack {
-  \rvoid *ss_sp;
-  \rsize_t ss_size;
-  \rint ss_flags;
-\r} stack_t;
-\r\rtypedef CONTEXT mcontext_t;
-\rtypedef unsigned long __sigset_t;
-\r\rtypedef struct __ucontext {
-  \runsigned long int uc_flags;
-  \rstruct __ucontext *uc_link;
-  \rstack_t uc_stack;
-  \rmcontext_t uc_mcontext;
-  \r__sigset_t uc_sigmask;
-\r} ucontext_t;
-\r\r\rint getcontext(ucontext_t * ucp);
-\rint setcontext(const ucontext_t * ucp);
-\rint makecontext(ucontext_t *, void (*)(), int, ...);
-\rint swapcontext(ucontext_t *, const ucontext_t *);
+    \rtypedef struct __stack {\r
+  \rvoid *ss_sp;\r
+  \rsize_t ss_size;\r
+  \rint ss_flags;\r
+\r} stack_t;\r
+\r\rtypedef CONTEXT mcontext_t;\r
+\rtypedef unsigned long __sigset_t;\r
+\r\rtypedef struct __ucontext {\r
+  \runsigned long int uc_flags;\r
+  \rstruct __ucontext *uc_link;\r
+  \rstack_t uc_stack;\r
+  \rmcontext_t uc_mcontext;\r
+  \r__sigset_t uc_sigmask;\r
+\r} ucontext_t;\r
+\r\r\rint getcontext(ucontext_t * ucp);\r
+\rint setcontext(const ucontext_t * ucp);\r
+\rint makecontext(ucontext_t *, void (*)(), int, ...);\r
+\rint swapcontext(ucontext_t *, const ucontext_t *);\r
 \r\r
 #endif  /* UCONTEXT_H */\r
index cbbe8eb..5d49317 100644 (file)
  *      Lesser General Public License for more details.\r
  *\r
  *      You should have received a copy of the GNU Lesser General Public\r
- *      License along with QueueUserAPCEx in the file COPYING.LIB;\r
+ *      License along with SimGrid in the file LICENSE-LGPL-2.1;\r
  *      if not, write to the Free Software Foundation, Inc.,\r
  *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\r
  */  \r
     \r
 #include "win32_ucontext.h"\r
 int getcontext(ucontext_t * ucp) \r
-{
-  \rint ret;
+{\r
+  \rint ret;\r
   \r\r
       /* Retrieve the full machine context */ \r
-      ucp->uc_mcontext.ContextFlags = CONTEXT_FULL;
-  \rret = GetThreadContext(GetCurrentThread(), &ucp->uc_mcontext);
-  \rreturn (ret == 0) ? -1 : 0;
-\r}
-
+      ucp->uc_mcontext.ContextFlags = CONTEXT_FULL;\r
+  \rret = GetThreadContext(GetCurrentThread(), &ucp->uc_mcontext);\r
+  \rreturn (ret == 0) ? -1 : 0;\r
+\r}\r
+\r
 \r\rint setcontext(const ucontext_t * ucp) \r
-{
-  \rint ret;
+{\r
+  \rint ret;\r
   \r\r
       /* Restore the full machine context (already set) */ \r
-      ret = SetThreadContext(GetCurrentThread(), &ucp->uc_mcontext);
-  \rreturn (ret == 0) ? -1 : 0;
-\r}
-
+      ret = SetThreadContext(GetCurrentThread(), &ucp->uc_mcontext);\r
+  \rreturn (ret == 0) ? -1 : 0;\r
+\r}\r
+\r
 \r\rint makecontext(ucontext_t * ucp, void (*func) (), int argc, ...) \r
-{
-  \rint i;
-  \rva_list ap;
-  \rchar *sp;
+{\r
+  \rint i;\r
+  \rva_list ap;\r
+  \rchar *sp;\r
   \r\r
       /* Stack grows down */ \r
-      sp = (char *) (size_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size;
+      sp = (char *) (size_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size;\r
   \r\r
       /* Reserve stack space for the arguments (maximum possible: argc*(8 bytes per argument)) */ \r
-      sp -= argc * 8;
-  \rif (sp < (char *) ucp->uc_stack.ss_sp) {
+      sp -= argc * 8;\r
+  \rif (sp < (char *) ucp->uc_stack.ss_sp) {\r
     \r\r
         /* errno = ENOMEM; */ \r
-        return -1;
-  \r}
+        return -1;\r
+  \r}\r
   \r\r
       /* Set the instruction and the stack pointer */ \r
-      ucp->uc_mcontext.Eip = (unsigned long) func;
-  \rucp->uc_mcontext.Esp = (unsigned long) sp - 4;
+      ucp->uc_mcontext.Eip = (unsigned long) func;\r
+  \rucp->uc_mcontext.Esp = (unsigned long) sp - 4;\r
   \r\r
       /* Save/Restore the full machine context */ \r
-      ucp->uc_mcontext.ContextFlags = CONTEXT_FULL;
+      ucp->uc_mcontext.ContextFlags = CONTEXT_FULL;\r
   \r\r
       /* Copy the arguments */ \r
-      va_start(ap, argc);
-  \rfor (i = 0; i < argc; i++) {
-    \rmemcpy(sp, ap, 8);
-    \rap += 8;
-    \rsp += 8;
-  \r}
-  \rva_end(ap);
-  \rreturn 0;
-\r}
-
+      va_start(ap, argc);\r
+  \rfor (i = 0; i < argc; i++) {\r
+    \rmemcpy(sp, ap, 8);\r
+    \rap += 8;\r
+    \rsp += 8;\r
+  \r}\r
+  \rva_end(ap);\r
+  \rreturn 0;\r
+\r}\r
+\r
 \r\rint swapcontext(ucontext_t * oucp, const ucontext_t * ucp) \r
-{
-  \rint ret;
-  \rif ((oucp == NULL) || (ucp == NULL)) {
+{\r
+  \rint ret;\r
+  \rif ((oucp == NULL) || (ucp == NULL)) {\r
     \r\r
         /*errno = EINVAL; */ \r
-        return -1;
-  \r}
-  \rret = getcontext(oucp);
-  \rif (ret == 0) {
-    \rret = setcontext(ucp);
-  \r}
-  \rreturn ret;
-\r}
-
+        return -1;\r
+  \r}\r
+  \rret = getcontext(oucp);\r
+  \rif (ret == 0) {\r
+    \rret = setcontext(ucp);\r
+  \r}\r
+  \rreturn ret;\r
+\r}\r
+\r
 \r\r\r