/[rtmk]/rtmk/rig/be-c.c
ViewVC logotype

Diff of /rtmk/rig/be-c.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by jrydberg, Tue Jan 29 18:18:28 2002 UTC revision 1.7 by jrydberg, Wed Feb 20 19:16:12 2002 UTC
# Line 505  output_arg_proto_decl (arg) Line 505  output_arg_proto_decl (arg)
505    char *stars = "";    char *stars = "";
506    
507    if (arg->type->attrs & NO_FIXED_LENGTH || arg->type->array > 0)    if (arg->type->attrs & NO_FIXED_LENGTH || arg->type->array > 0)
508      stars = " *";      stars = "*";
509    if (arg->direction & AD_IN)    if (arg->direction & AD_IN)
510      stars = " *";      stars = "*";
511    
512    output ("%s%s", arg->type->cname, stars);    output ("%s %s%s", arg->type->cname, stars, arg->cname);
513  }  }
514    
515  void  void
# Line 519  target_write_routine_prototype (rt) Line 519  target_write_routine_prototype (rt)
519    struct argument *arg;    struct argument *arg;
520    int len, start = 0;    int len, start = 0;
521    
522      output ("\n/* %s: %s */\n",
523              rt->name, rt->comment);
524    
525    output ("%s ", rt->returntype ?    output ("%s ", rt->returntype ?
526                     rt->returntype->cname : "void");                     rt->returntype->cname : "void");
527      start += strlen (rt->returntype ?
528                       rt->returntype->cname : "void");
529    if (no_use_params)    if (no_use_params)
530      {      {
531        output ("%s%s (", prefix, rt->cname);        output ("%s%s (", prefix, rt->cname);
532        len = start = strlen (rt->cname) + 2;        start += strlen (prefix) + strlen (rt->cname) + 3;
533      }      }
534    else    else
535      {      {
536        output ("%s%s PARAMS ((", prefix, rt->cname);        output ("%s%s PARAMS ((", prefix, rt->cname);
537        len = start = strlen (rt->cname) + 6 + 4;        start += strlen (prefix) + strlen (rt->cname) + 11;
538      }      }
539        
540    for (arg = rt->args; arg; arg = arg->next)    for (arg = rt->args, len = start; arg; arg = arg->next)
541      {      {
542        len += strlen (arg->cname);        len += strlen (arg->cname) + strlen (arg->type->cname) + 2;
543        if (len > 72)        if (len > 72)
544          {          {
545            output ("\n%-*s", start, " ");            output ("\n%-*s", start, " ");
# Line 609  target_write_header_encode_finish (rt, n Line 614  target_write_header_encode_finish (rt, n
614      output ("__msgh_out->msgh_remote_port = %s;\n", rt->args->cname);      output ("__msgh_out->msgh_remote_port = %s;\n", rt->args->cname);
615    
616    if (routine_need_reply (rt))    if (routine_need_reply (rt))
617      output ("__msgh_out->msgh_local_port = thread_reply_port ();\n");      output ("__msgh_out->msgh_local_port = __rig_reply_port_get ();\n");
618    else    else
619      output ("__msgh_out->msgh_local_port = 0;\n");      output ("__msgh_out->msgh_local_port = 0;\n");
620    
# Line 685  target_write_ipccall (rt) Line 690  target_write_ipccall (rt)
690    
691    /* reset msgt pointer */    /* reset msgt pointer */
692    if (routine_need_reply (rt))    if (routine_need_reply (rt))
693      output ("__msgt = (struct rtmk_msg_type *) (__msgh_in + 1);\n\n");      {
694          output ("/* ??? use __rig_reply_port_put (PORT) instead */\n");
695          output ("__rig_reply_port_put (__msgh_in->msgh_remote_port);\n\n");
696    
697          output ("__msgt = (struct rtmk_msg_type *) (__msgh_in + 1);\n\n");
698        }
699  }  }
700    
701  /* `target_write_local_variables' ... */  /* `target_write_local_variables' ... */
# Line 710  void Line 720  void
720  target_write_finishup (rt)  target_write_finishup (rt)
721       struct routine *rt;       struct routine *rt;
722  {  {
723      
724    
725    if (rt->returntype)    if (rt->returntype)
726      output ("return *__ret_code;\n");      output ("return *__ret_code;\n");
727    else      else  
# Line 758  target_server_finishup (rt) Line 770  target_server_finishup (rt)
770      }      }
771  }  }
772    
773    /* ??? */
774    void
775    target_server_alloc_local_array (rt, arg)
776         struct routine *rt;
777         struct argument *arg;
778    {
779      if (arg->type->attrs & NO_FIXED_LENGTH)
780        output ("%s = __builtin_alloca (%s__length);\n\n", arg->cname, arg->cname);
781      else
782        output ("%s = __builtin_alloca (%d);\n\n", arg->cname, arg->type->array);
783    }
784    
785    
786  /* `target_server_local_variables' ... */  /* `target_server_local_variables' ... */
787  void  void
788  target_server_local_variables (rt)  target_server_local_variables (rt)

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26