Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Port to G5
[simgrid.git] / src / gras / DataDesc / ddt_convert.c
index a5da480..8b1759b 100644 (file)
@@ -2,11 +2,12 @@
 
 /* ddt_remote - Stuff needed to get datadescs about remote hosts            */
 
-/* Authors: Olivier Aumage, Martin Quinson                                  */
-/* Copyright (C) 2003, 2004 the GRAS posse.                                 */
+/* Copyright (c) 2003 Olivier Aumage.                                       */
+/* Copyright (c) 2003, 2004 Martin Quinson.                                 */
+/* All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  under the terms of the license (GNU LGPL) which comes with this package. */
* under the terms of the license (GNU LGPL) which comes with this package. */
 
 /************************************************************************/
 /* C combines the power of assembler with the portability of assembler. */
@@ -14,7 +15,7 @@
 
 #include "gras/DataDesc/datadesc_private.h"
 
-GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(ddt_convert,datadesc,
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ddt_convert,datadesc,
                                 "Inter-architecture convertions");
 
 /***
@@ -24,8 +25,9 @@ GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(ddt_convert,datadesc,
  ***  l C<1/1> I<2/2:4/4:8/8:8/8> P<4/4:4/4> D<4/4:8/8>
  ***  B C<1/1> I<2/2:4/4:4/8:8/8> P<4/4:4/4> D<4/4:8/4>
  ***  B C<1/1> I<2/2:4/8:8/8:8/8> P<4/4:4/4> D<4/4:8/4>
- ***  B C:1/1: I:2/2:4/4:4/4:8/8: P:4/4:4/4: D:4/4:8/4:
- ***
+ ***  B C:1/1: I:2/2:4/4:4/4:8/8: P:4/4:4/4: D:4/4:8/4: AIX
+ ***  B C:1/1: I:2/2:4/2:4/2:8/2: P:4/2:4/2: D:4/2:8/2: ARM
+ ***  l C<1/1> I<2/2:4/4:4/4:8/8> P<4/4:4/4> D<4/4:8/8> win32 
  ***/
 
 const gras_arch_desc_t gras_arches[gras_arch_count] = {
@@ -42,8 +44,16 @@ const gras_arch_desc_t gras_arches[gras_arch_count] = {
                     {1,2,4,8,8,   8,8,   4,8}},
 
   {"aix",      1,   {1,2,4,4,8,   4,4,   4,8}, 
-                    {1,2,4,4,8,   4,4,   4,4}}
+                    {1,2,4,4,8,   4,4,   4,4}},
+
+  {"arm",      1,   {1,2,4,4,8,   4,4,   4,8}, 
+                    {1,2,2,2,2,   2,2,   2,2}},
+
+  {"win32",    0,   {1,2,4,4,8,   4,4,   4,8}, 
+                    {1,2,4,4,8,   4,4,   4,8}},
    
+  {"g5",       1,   {1,2,4,4,8,   4,4,   4,8}, 
+                    {1,2,4,4,4,   4,4,   4,4}}
 };
 
 const char *gras_datadesc_arch_name(int code) {
@@ -52,6 +62,7 @@ const char *gras_datadesc_arch_name(int code) {
    return gras_arches[code].name;
 }
 
+
 /**
  * Local function doing the grunt work
  */
@@ -60,7 +71,6 @@ gras_dd_reverse_bytes(void *to,
                      const void *from,
                      size_t length);
 
-
 /**
  * gras_dd_convert_elm:
  *
@@ -68,8 +78,8 @@ gras_dd_reverse_bytes(void *to,
  * The data to be converted is stored in @src, and is to be stored in @dst.
  * Both pointers may be the same location if no resizing is needed.
  */
-gras_error_t
-gras_dd_convert_elm(gras_datadesc_type_t *type, int count,
+xbt_error_t
+gras_dd_convert_elm(gras_datadesc_type_t type, int count,
                    int r_arch, 
                    void *src, void *dst) {
   gras_dd_cat_scalar_t scal = type->category.scalar_data;
@@ -84,8 +94,8 @@ gras_dd_convert_elm(gras_datadesc_type_t *type, int count,
   } tester;
   */
 
-  gras_assert(type->category_code == e_gras_datadesc_type_cat_scalar);
-  gras_assert(r_arch != GRAS_THISARCH);
+  xbt_assert(type->category_code == e_gras_datadesc_type_cat_scalar);
+  xbt_assert(r_arch != GRAS_THISARCH);
   
   r_size = type->size[r_arch];
   l_size = type->size[GRAS_THISARCH];
@@ -122,7 +132,7 @@ gras_dd_convert_elm(gras_datadesc_type_t *type, int count,
 
       DEBUG5("Resize integer %d from %lu @%p to %lu @%p",
             cpt, r_size,r_data, l_size,l_data);
-      gras_assert0(r_data != l_data, "Impossible to resize in place");
+      xbt_assert0(r_data != l_data, "Impossible to resize in place");
 
       if(sizeChange < 0) {
        DEBUG3("Truncate %d bytes (%s,%s)", -sizeChange,