-
-/* Given a return value in `regbuf' with a type `valtype',
- extract and copy its value into `valbuf'. */
-
-static void
-d10v_extract_return_value (struct type *type, struct regcache *regcache,
- void *valbuf)
-{
- int len;
- if (TYPE_LENGTH (type) == 1)
- {
- ULONGEST c;
- regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &c);
- store_unsigned_integer (valbuf, 1, c);
- }
- else
- {
- /* For return values of odd size, the first byte is in the
- least significant part of the first register. The
- remaining bytes in remaining registers. Interestingly, when
- such values are passed in, the last byte is in the most
- significant byte of that same register - wierd. */
- int reg = RET1_REGNUM;
- int off = 0;
- if (TYPE_LENGTH (type) & 1)
- {
- regcache_cooked_read_part (regcache, RET1_REGNUM, 1, 1,
- (bfd_byte *)valbuf + off);
- off++;
- reg++;
- }
- /* Transfer the remaining registers. */
- for (; off < TYPE_LENGTH (type); reg++, off += 2)
- {
- regcache_cooked_read (regcache, RET1_REGNUM + reg,
- (bfd_byte *) valbuf + off);
- }
- }
-}
-