On Sun, Feb 03, 2013 at 09:35:39PM -0800, H?vard Skinnemoen wrote:

> Right.
> 
> > But yes, 32bit/32bit/64bit/32bit is another interesting case -
> > fanotify_mark is 32/32/64/32/32.  From what ABI says it would seem to
> > be r12/r11/r8:r9/r10/stack, but if I understand you correctly, we'll
> > end up wanting *two* arguments on stack...
> 
> Yes, I think there may be a difference between the IAR and gcc ABI
> here. But I could be wrong.

Umm...  avr32_function_arg() in atmel 4.4.3 patch:
  if (arg_rsize == 8)
    {
      /* use r11:r10 or r9:r8. */
      if (!(GET_USED_INDEX (cum, 1) || GET_USED_INDEX (cum, 2)))
       index = 1;
      else if ((last_reg_index == 4) &&
               !(GET_USED_INDEX (cum, 3) || GET_USED_INDEX (cum, 4)))
       index = 3;
      else
       index = -1;
    }
  else if (arg_rsize == 4)
    {                          /* Use first available register */
      index = 0;
      while (index <= last_reg_index && GET_USED_INDEX (cum, index))
       index++;
      if (index > last_reg_index)
       index = -1;
    }

So it will use the gap in case of 32/32/64/32; the first two calls will
take index 0 and 1 (r12 and r11 resp.), the third will take 3 and 4
(r9:r8) and the fourth will take 2 (r10).  Relevant part of
avr32_function_arg_advance():
  /* Mark the used registers as "used". */
  if (GET_REG_INDEX (cum) >= 0)
    {
      SET_USED_INDEX (cum, GET_REG_INDEX (cum));
      if (arg_rsize == 8)
       {
         SET_USED_INDEX (cum, (GET_REG_INDEX (cum) + 1));
       }
    }
i.e. the third argument will only stomp on 3 and 4, leaving 2 unused.

And as far as I can see, their 4.3.3 patch does the same thing...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to