Artifact
23ecf93cb55ac034d30d46d7f2d5e566e23be968:
0000: 23 69 66 6e 64 65 66 20 5f 61 76 63 61 6c 6c 5f #ifndef _avcall_
0010: 61 72 6d 5f 63 09 09 09 09 2f 2a 2d 2a 2d 20 43 arm_c..../*-*- C
0020: 20 2d 2a 2d 2a 2f 0a 23 64 65 66 69 6e 65 20 5f -*-*/.#define _
0030: 61 76 63 61 6c 6c 5f 61 72 6d 5f 63 0a 2f 2a 2a avcall_arm_c./**
0040: 0a 20 20 43 6f 70 79 72 69 67 68 74 20 31 39 39 . Copyright 199
0050: 33 20 42 69 6c 6c 20 54 72 69 67 67 73 2c 20 3c 3 Bill Triggs, <
0060: 42 69 6c 6c 2e 54 72 69 67 67 73 40 69 6e 72 69 Bill.Triggs@inri
0070: 61 6c 70 65 73 2e 66 72 3e 0a 20 20 43 6f 70 79 alpes.fr>. Copy
0080: 72 69 67 68 74 20 31 39 39 35 2d 31 39 39 39 20 right 1995-1999
0090: 42 72 75 6e 6f 20 48 61 69 62 6c 65 2c 20 3c 62 Bruno Haible, <b
00a0: 72 75 6e 6f 40 63 6c 69 73 70 2e 6f 72 67 3e 0a runo@clisp.org>.
00b0: 0a 20 20 54 68 69 73 20 69 73 20 66 72 65 65 20 . This is free
00c0: 73 6f 66 74 77 61 72 65 20 64 69 73 74 72 69 62 software distrib
00d0: 75 74 65 64 20 75 6e 64 65 72 20 74 68 65 20 47 uted under the G
00e0: 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 NU General Publi
00f0: 63 0a 20 20 4c 69 63 65 6e 63 65 20 64 65 73 63 c. Licence desc
0100: 72 69 62 65 64 20 69 6e 20 74 68 65 20 66 69 6c ribed in the fil
0110: 65 20 43 4f 50 59 49 4e 47 2e 20 43 6f 6e 74 61 e COPYING. Conta
0120: 63 74 20 74 68 65 20 61 75 74 68 6f 72 20 69 66 ct the author if
0130: 0a 20 20 79 6f 75 20 64 6f 6e 27 74 20 68 61 76 . you don't hav
0140: 65 20 74 68 69 73 20 6f 72 20 63 61 6e 27 74 20 e this or can't
0150: 6c 69 76 65 20 77 69 74 68 20 69 74 2e 20 54 68 live with it. Th
0160: 65 72 65 20 69 73 20 41 42 53 4f 4c 55 54 45 4c ere is ABSOLUTEL
0170: 59 0a 20 20 4e 4f 20 57 41 52 52 41 4e 54 59 2c Y. NO WARRANTY,
0180: 20 65 78 70 6c 69 63 69 74 20 6f 72 20 69 6d 70 explicit or imp
0190: 6c 69 65 64 2c 20 6f 6e 20 74 68 69 73 20 73 6f lied, on this so
01a0: 66 74 77 61 72 65 2e 0a 2a 2a 2f 0a 2f 2a 2d 2d ftware..**/./*--
01b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
01c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
01d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
01e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
01f0: 2d 2d 2d 2d 0a 20 20 21 21 21 20 54 48 49 53 20 ----. !!! THIS
0200: 52 4f 55 54 49 4e 45 20 4d 55 53 54 20 42 45 20 ROUTINE MUST BE
0210: 43 4f 4d 50 49 4c 45 44 20 67 63 63 20 2d 4f 20 COMPILED gcc -O
0220: 21 21 21 0a 0a 20 20 46 6f 72 65 69 67 6e 20 66 !!!.. Foreign f
0230: 75 6e 63 74 69 6f 6e 20 69 6e 74 65 72 66 61 63 unction interfac
0240: 65 20 66 6f 72 20 61 6e 20 41 63 6f 72 6e 20 52 e for an Acorn R
0250: 69 73 63 20 4d 61 73 63 68 69 6e 65 20 77 69 74 isc Maschine wit
0260: 68 20 67 63 63 2e 0a 0a 20 20 54 68 69 73 20 63 h gcc... This c
0270: 61 6c 6c 73 20 61 20 43 20 66 75 6e 63 74 69 6f alls a C functio
0280: 6e 20 77 69 74 68 20 61 6e 20 61 72 67 75 6d 65 n with an argume
0290: 6e 74 20 6c 69 73 74 20 62 75 69 6c 74 20 75 70 nt list built up
02a0: 20 75 73 69 6e 67 20 6d 61 63 72 6f 73 0a 20 20 using macros.
02b0: 64 65 66 69 6e 65 64 20 69 6e 20 61 76 5f 63 61 defined in av_ca
02c0: 6c 6c 2e 68 2e 0a 0a 20 20 41 52 4d 20 41 72 67 ll.h... ARM Arg
02d0: 75 6d 65 6e 74 20 50 61 73 73 69 6e 67 20 43 6f ument Passing Co
02e0: 6e 76 65 6e 74 69 6f 6e 73 3a 0a 0a 20 20 41 6c nventions:.. Al
02f0: 6c 20 61 72 67 75 6d 65 6e 74 73 2c 20 65 78 63 l arguments, exc
0300: 65 70 74 20 74 68 65 20 66 69 72 73 74 20 34 20 ept the first 4
0310: 77 6f 72 64 73 2c 20 61 72 65 20 70 61 73 73 65 words, are passe
0320: 64 20 6f 6e 20 74 68 65 20 73 74 61 63 6b 20 77 d on the stack w
0330: 69 74 68 0a 20 20 77 6f 72 64 20 61 6c 69 67 6e ith. word align
0340: 6d 65 6e 74 2e 20 44 6f 75 62 6c 65 73 20 74 61 ment. Doubles ta
0350: 6b 65 20 74 77 6f 20 77 6f 72 64 73 2e 20 53 74 ke two words. St
0360: 72 75 63 74 75 72 65 20 61 72 67 73 20 61 72 65 ructure args are
0370: 20 70 61 73 73 65 64 20 61 73 0a 20 20 74 72 75 passed as. tru
0380: 65 20 73 74 72 75 63 74 75 72 65 73 20 65 6d 62 e structures emb
0390: 65 64 64 65 64 20 69 6e 20 74 68 65 20 61 72 67 edded in the arg
03a0: 75 6d 65 6e 74 20 73 74 61 63 6b 2e 20 54 6f 20 ument stack. To
03b0: 72 65 74 75 72 6e 20 61 20 73 74 72 75 63 74 75 return a structu
03c0: 72 65 2c 0a 20 20 74 68 65 20 63 61 6c 6c 65 64 re,. the called
03d0: 20 66 75 6e 63 74 69 6f 6e 20 63 6f 70 69 65 73 function copies
03e0: 20 74 68 65 20 72 65 74 75 72 6e 20 76 61 6c 75 the return valu
03f0: 65 20 74 6f 20 74 68 65 20 61 64 64 72 65 73 73 e to the address
0400: 20 73 75 70 70 6c 69 65 64 0a 20 20 69 6e 20 72 supplied. in r
0410: 65 67 69 73 74 65 72 20 22 25 72 30 22 2e 0a 0a egister "%r0"...
0420: 20 20 43 6f 6d 70 69 6c 65 20 74 68 69 73 20 72 Compile this r
0430: 6f 75 74 69 6e 65 20 77 69 74 68 20 67 63 63 20 outine with gcc
0440: 2d 4f 20 28 6f 72 20 2d 4f 32 20 6f 72 20 2d 67 -O (or -O2 or -g
0450: 20 2d 4f 29 20 74 6f 20 67 65 74 20 74 68 65 20 -O) to get the
0460: 72 69 67 68 74 0a 20 20 72 65 67 69 73 74 65 72 right. register
0470: 20 76 61 72 69 61 62 6c 65 73 2c 20 6f 72 20 75 variables, or u
0480: 73 65 20 74 68 65 20 61 73 73 65 6d 62 6c 65 72 se the assembler
0490: 20 76 65 72 73 69 6f 6e 2e 0a 20 20 2d 2d 2d 2d version.. ----
04a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
04b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
04c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
04d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
04e0: 2d 2d 2a 2f 0a 23 69 6e 63 6c 75 64 65 20 22 61 --*/.#include "a
04f0: 76 63 61 6c 6c 2e 68 2e 69 6e 22 0a 0a 23 64 65 vcall.h.in"..#de
0500: 66 69 6e 65 20 52 45 54 55 52 4e 28 54 59 50 45 fine RETURN(TYPE
0510: 2c 56 41 4c 29 09 28 2a 28 54 59 50 45 2a 29 6c ,VAL).(*(TYPE*)l
0520: 2d 3e 72 61 64 64 72 20 3d 20 28 54 59 50 45 29 ->raddr = (TYPE)
0530: 28 56 41 4c 29 29 0a 0a 69 6e 74 0a 5f 5f 62 75 (VAL))..int.__bu
0540: 69 6c 74 69 6e 5f 61 76 63 61 6c 6c 28 61 76 5f iltin_avcall(av_
0550: 61 6c 69 73 74 2a 20 6c 29 0a 7b 0a 20 20 72 65 alist* l).{. re
0560: 67 69 73 74 65 72 20 5f 5f 61 76 77 6f 72 64 2a gister __avword*
0570: 09 73 70 09 5f 5f 61 73 6d 5f 5f 28 22 72 31 33 .sp.__asm__("r13
0580: 22 29 3b 20 20 2f 2a 20 43 20 6e 61 6d 65 73 20 "); /* C names
0590: 66 6f 72 20 72 65 67 69 73 74 65 72 73 20 2a 2f for registers */
05a0: 0a 2f 2a 72 65 67 69 73 74 65 72 20 5f 5f 61 76 ./*register __av
05b0: 77 6f 72 64 09 69 72 65 74 09 5f 5f 61 73 6d 5f word.iret.__asm_
05c0: 5f 28 22 72 30 22 29 3b 20 2a 2f 0a 20 20 72 65 _("r0"); */. re
05d0: 67 69 73 74 65 72 20 5f 5f 61 76 77 6f 72 64 09 gister __avword.
05e0: 69 72 65 74 32 09 5f 5f 61 73 6d 5f 5f 28 22 72 iret2.__asm__("r
05f0: 31 22 29 3b 0a 20 20 72 65 67 69 73 74 65 72 20 1");. register
0600: 66 6c 6f 61 74 09 66 72 65 74 09 5f 5f 61 73 6d float.fret.__asm
0610: 5f 5f 28 22 72 30 22 29 3b 09 2f 2a 20 72 30 20 __("r0");./* r0
0620: 2a 2f 0a 20 20 72 65 67 69 73 74 65 72 20 64 6f */. register do
0630: 75 62 6c 65 09 64 72 65 74 09 5f 5f 61 73 6d 5f uble.dret.__asm_
0640: 5f 28 22 72 30 22 29 3b 09 2f 2a 20 72 30 2c 72 _("r0");./* r0,r
0650: 31 20 2a 2f 0a 0a 20 20 5f 5f 61 76 77 6f 72 64 1 */.. __avword
0660: 20 73 70 61 63 65 5b 5f 5f 41 56 5f 41 4c 49 53 space[__AV_ALIS
0670: 54 5f 57 4f 52 44 53 5d 3b 09 2f 2a 20 73 70 61 T_WORDS];./* spa
0680: 63 65 20 66 6f 72 20 63 61 6c 6c 65 65 27 73 20 ce for callee's
0690: 73 74 61 63 6b 20 66 72 61 6d 65 20 2a 2f 0a 20 stack frame */.
06a0: 20 5f 5f 61 76 77 6f 72 64 2a 20 61 72 67 66 72 __avword* argfr
06b0: 61 6d 65 20 3d 20 73 70 3b 09 09 2f 2a 20 73 74 ame = sp;../* st
06c0: 61 63 6b 20 6f 66 66 73 65 74 20 66 6f 72 20 61 ack offset for a
06d0: 72 67 75 6d 65 6e 74 20 6c 69 73 74 20 2a 2f 0a rgument list */.
06e0: 20 20 69 6e 74 20 61 72 67 6c 65 6e 20 3d 20 6c int arglen = l
06f0: 2d 3e 61 70 74 72 20 2d 20 6c 2d 3e 61 72 67 73 ->aptr - l->args
0700: 3b 0a 20 20 5f 5f 61 76 77 6f 72 64 20 69 3b 0a ;. __avword i;.
0710: 0a 20 20 66 6f 72 20 28 69 20 3d 20 34 3b 20 69 . for (i = 4; i
0720: 20 3c 20 61 72 67 6c 65 6e 3b 20 69 2b 2b 29 09 < arglen; i++).
0730: 09 2f 2a 20 70 75 73 68 20 66 75 6e 63 74 69 6f ./* push functio
0740: 6e 20 61 72 67 73 20 6f 6e 74 6f 20 73 74 61 63 n args onto stac
0750: 6b 20 2a 2f 0a 20 20 20 20 61 72 67 66 72 61 6d k */. argfram
0760: 65 5b 69 2d 34 5d 20 3d 20 6c 2d 3e 61 72 67 73 e[i-4] = l->args
0770: 5b 69 5d 3b 0a 0a 09 09 09 09 2f 2a 20 63 61 6c [i];....../* cal
0780: 6c 20 66 75 6e 63 74 69 6f 6e 2c 20 70 61 73 73 l function, pass
0790: 20 34 20 61 72 67 73 20 69 6e 20 72 65 67 69 73 4 args in regis
07a0: 74 65 72 73 20 2a 2f 0a 20 20 69 20 3d 20 28 2a ters */. i = (*
07b0: 6c 2d 3e 66 75 6e 63 29 28 6c 2d 3e 61 72 67 73 l->func)(l->args
07c0: 5b 30 5d 2c 20 6c 2d 3e 61 72 67 73 5b 31 5d 2c [0], l->args[1],
07d0: 20 6c 2d 3e 61 72 67 73 5b 32 5d 2c 20 6c 2d 3e l->args[2], l->
07e0: 61 72 67 73 5b 33 5d 29 3b 0a 0a 20 20 2f 2a 20 args[3]);.. /*
07f0: 73 61 76 65 20 72 65 74 75 72 6e 20 76 61 6c 75 save return valu
0800: 65 20 2a 2f 0a 20 20 69 66 20 28 6c 2d 3e 72 74 e */. if (l->rt
0810: 79 70 65 20 3d 3d 20 5f 5f 41 56 76 6f 69 64 29 ype == __AVvoid)
0820: 20 7b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 {. } else. if
0830: 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f (l->rtype == __
0840: 41 56 77 6f 72 64 29 20 7b 0a 20 20 20 20 52 45 AVword) {. RE
0850: 54 55 52 4e 28 5f 5f 61 76 77 6f 72 64 2c 20 69 TURN(__avword, i
0860: 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 );. } else. if
0870: 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f (l->rtype == __
0880: 41 56 63 68 61 72 29 20 7b 0a 20 20 20 20 52 45 AVchar) {. RE
0890: 54 55 52 4e 28 63 68 61 72 2c 20 69 29 3b 0a 20 TURN(char, i);.
08a0: 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d } else. if (l-
08b0: 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 73 63 >rtype == __AVsc
08c0: 68 61 72 29 20 7b 0a 20 20 20 20 52 45 54 55 52 har) {. RETUR
08d0: 4e 28 73 69 67 6e 65 64 20 63 68 61 72 2c 20 69 N(signed char, i
08e0: 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 );. } else. if
08f0: 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f (l->rtype == __
0900: 41 56 75 63 68 61 72 29 20 7b 0a 20 20 20 20 52 AVuchar) {. R
0910: 45 54 55 52 4e 28 75 6e 73 69 67 6e 65 64 20 63 ETURN(unsigned c
0920: 68 61 72 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73 har, i);. } els
0930: 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 e. if (l->rtype
0940: 20 3d 3d 20 5f 5f 41 56 73 68 6f 72 74 29 20 7b == __AVshort) {
0950: 0a 20 20 20 20 52 45 54 55 52 4e 28 73 68 6f 72 . RETURN(shor
0960: 74 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73 65 0a t, i);. } else.
0970: 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 20 3d if (l->rtype =
0980: 3d 20 5f 5f 41 56 75 73 68 6f 72 74 29 20 7b 0a = __AVushort) {.
0990: 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73 69 67 RETURN(unsig
09a0: 6e 65 64 20 73 68 6f 72 74 2c 20 69 29 3b 0a 20 ned short, i);.
09b0: 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d } else. if (l-
09c0: 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 69 6e >rtype == __AVin
09d0: 74 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 t) {. RETURN(
09e0: 69 6e 74 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73 int, i);. } els
09f0: 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 e. if (l->rtype
0a00: 20 3d 3d 20 5f 5f 41 56 75 69 6e 74 29 20 7b 0a == __AVuint) {.
0a10: 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73 69 67 RETURN(unsig
0a20: 6e 65 64 20 69 6e 74 2c 20 69 29 3b 0a 20 20 7d ned int, i);. }
0a30: 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d 3e 72 else. if (l->r
0a40: 74 79 70 65 20 3d 3d 20 5f 5f 41 56 6c 6f 6e 67 type == __AVlong
0a50: 29 20 7b 0a 20 20 20 20 52 45 54 55 52 4e 28 6c ) {. RETURN(l
0a60: 6f 6e 67 2c 20 69 29 3b 0a 20 20 7d 20 65 6c 73 ong, i);. } els
0a70: 65 0a 20 20 69 66 20 28 6c 2d 3e 72 74 79 70 65 e. if (l->rtype
0a80: 20 3d 3d 20 5f 5f 41 56 75 6c 6f 6e 67 29 20 7b == __AVulong) {
0a90: 0a 20 20 20 20 52 45 54 55 52 4e 28 75 6e 73 69 . RETURN(unsi
0aa0: 67 6e 65 64 20 6c 6f 6e 67 2c 20 69 29 3b 0a 20 gned long, i);.
0ab0: 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d } else. if (l-
0ac0: 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 6c 6f >rtype == __AVlo
0ad0: 6e 67 6c 6f 6e 67 20 7c 7c 20 6c 2d 3e 72 74 79 nglong || l->rty
0ae0: 70 65 20 3d 3d 20 5f 5f 41 56 75 6c 6f 6e 67 6c pe == __AVulongl
0af0: 6f 6e 67 29 20 7b 0a 20 20 20 20 28 28 5f 5f 61 ong) {. ((__a
0b00: 76 77 6f 72 64 2a 29 6c 2d 3e 72 61 64 64 72 29 vword*)l->raddr)
0b10: 5b 30 5d 20 3d 20 69 3b 0a 20 20 20 20 28 28 5f [0] = i;. ((_
0b20: 5f 61 76 77 6f 72 64 2a 29 6c 2d 3e 72 61 64 64 _avword*)l->radd
0b30: 72 29 5b 31 5d 20 3d 20 69 72 65 74 32 3b 0a 20 r)[1] = iret2;.
0b40: 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c 2d } else. if (l-
0b50: 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 66 6c >rtype == __AVfl
0b60: 6f 61 74 29 20 7b 0a 20 20 20 20 52 45 54 55 52 oat) {. RETUR
0b70: 4e 28 66 6c 6f 61 74 2c 20 66 72 65 74 29 3b 0a N(float, fret);.
0b80: 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 6c } else. if (l
0b90: 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 64 ->rtype == __AVd
0ba0: 6f 75 62 6c 65 29 20 7b 0a 20 20 20 20 52 45 54 ouble) {. RET
0bb0: 55 52 4e 28 64 6f 75 62 6c 65 2c 20 64 72 65 74 URN(double, dret
0bc0: 29 3b 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 );. } else. if
0bd0: 20 28 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f (l->rtype == __
0be0: 41 56 76 6f 69 64 70 29 20 7b 0a 20 20 20 20 52 AVvoidp) {. R
0bf0: 45 54 55 52 4e 28 76 6f 69 64 2a 2c 20 69 29 3b ETURN(void*, i);
0c00: 0a 20 20 7d 20 65 6c 73 65 0a 20 20 69 66 20 28 . } else. if (
0c10: 6c 2d 3e 72 74 79 70 65 20 3d 3d 20 5f 5f 41 56 l->rtype == __AV
0c20: 73 74 72 75 63 74 29 20 7b 0a 20 20 20 20 2f 2a struct) {. /*
0c30: 20 4e 42 3a 20 4f 6e 20 61 72 6d 2c 20 61 6c 6c NB: On arm, all
0c40: 20 73 74 72 75 63 74 75 72 65 20 73 69 7a 65 73 structure sizes
0c50: 20 61 72 65 20 64 69 76 69 73 69 62 6c 65 20 62 are divisible b
0c60: 79 20 34 2e 20 2a 2f 0a 20 20 20 20 69 66 20 28 y 4. */. if (
0c70: 6c 2d 3e 66 6c 61 67 73 20 26 20 5f 5f 41 56 5f l->flags & __AV_
0c80: 50 43 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52 PCC_STRUCT_RETUR
0c90: 4e 29 20 7b 0a 20 20 20 20 20 20 2f 2a 20 70 63 N) {. /* pc
0ca0: 63 20 73 74 72 75 63 74 20 72 65 74 75 72 6e 20 c struct return
0cb0: 63 6f 6e 76 65 6e 74 69 6f 6e 3a 20 6e 65 65 64 convention: need
0cc0: 20 61 20 20 2a 28 54 59 50 45 2a 29 6c 2d 3e 72 a *(TYPE*)l->r
0cd0: 61 64 64 72 20 3d 20 2a 28 54 59 50 45 2a 29 69 addr = *(TYPE*)i
0ce0: 3b 20 20 2a 2f 0a 20 20 20 20 20 20 69 66 20 28 ; */. if (
0cf0: 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65 l->rsize == size
0d00: 6f 66 28 63 68 61 72 29 29 20 7b 20 2f 2a 20 63 of(char)) { /* c
0d10: 61 6e 27 74 20 6f 63 63 75 72 20 2a 2f 0a 20 20 an't occur */.
0d20: 20 20 20 20 20 20 52 45 54 55 52 4e 28 63 68 61 RETURN(cha
0d30: 72 2c 20 2a 28 63 68 61 72 2a 29 69 29 3b 0a 20 r, *(char*)i);.
0d40: 20 20 20 20 20 7d 20 65 6c 73 65 0a 20 20 20 20 } else.
0d50: 20 20 69 66 20 28 6c 2d 3e 72 73 69 7a 65 20 3d if (l->rsize =
0d60: 3d 20 73 69 7a 65 6f 66 28 73 68 6f 72 74 29 29 = sizeof(short))
0d70: 20 7b 20 2f 2a 20 63 61 6e 27 74 20 6f 63 63 75 { /* can't occu
0d80: 72 20 2a 2f 0a 20 20 20 20 20 20 20 20 52 45 54 r */. RET
0d90: 55 52 4e 28 73 68 6f 72 74 2c 20 2a 28 73 68 6f URN(short, *(sho
0da0: 72 74 2a 29 69 29 3b 0a 20 20 20 20 20 20 7d 20 rt*)i);. }
0db0: 65 6c 73 65 0a 20 20 20 20 20 20 69 66 20 28 6c else. if (l
0dc0: 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65 6f ->rsize == sizeo
0dd0: 66 28 69 6e 74 29 29 20 7b 0a 20 20 20 20 20 20 f(int)) {.
0de0: 20 20 52 45 54 55 52 4e 28 69 6e 74 2c 20 2a 28 RETURN(int, *(
0df0: 69 6e 74 2a 29 69 29 3b 0a 20 20 20 20 20 20 7d int*)i);. }
0e00: 20 65 6c 73 65 0a 20 20 20 20 20 20 69 66 20 28 else. if (
0e10: 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a 65 l->rsize == size
0e20: 6f 66 28 64 6f 75 62 6c 65 29 29 20 7b 0a 20 20 of(double)) {.
0e30: 20 20 20 20 20 20 28 28 69 6e 74 2a 29 6c 2d 3e ((int*)l->
0e40: 72 61 64 64 72 29 5b 30 5d 20 3d 20 28 28 69 6e raddr)[0] = ((in
0e50: 74 2a 29 69 29 5b 30 5d 3b 0a 20 20 20 20 20 20 t*)i)[0];.
0e60: 20 20 28 28 69 6e 74 2a 29 6c 2d 3e 72 61 64 64 ((int*)l->radd
0e70: 72 29 5b 31 5d 20 3d 20 28 28 69 6e 74 2a 29 69 r)[1] = ((int*)i
0e80: 29 5b 31 5d 3b 0a 20 20 20 20 20 20 7d 20 65 6c )[1];. } el
0e90: 73 65 20 7b 0a 20 20 20 20 20 20 20 20 69 6e 74 se {. int
0ea0: 20 6e 20 3d 20 28 6c 2d 3e 72 73 69 7a 65 2b 33 n = (l->rsize+3
0eb0: 29 2f 34 3b 0a 20 20 20 20 20 20 20 20 77 68 69 )/4;. whi
0ec0: 6c 65 20 28 2d 2d 6e 20 3e 3d 20 30 29 0a 20 20 le (--n >= 0).
0ed0: 20 20 20 20 20 20 20 20 28 28 5f 5f 61 76 77 6f ((__avwo
0ee0: 72 64 2a 29 6c 2d 3e 72 61 64 64 72 29 5b 6e 5d rd*)l->raddr)[n]
0ef0: 20 3d 20 28 28 5f 5f 61 76 77 6f 72 64 2a 29 69 = ((__avword*)i
0f00: 29 5b 6e 5d 3b 0a 20 20 20 20 20 20 7d 0a 20 20 )[n];. }.
0f10: 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 } else {.
0f20: 20 2f 2a 20 6e 6f 72 6d 61 6c 20 73 74 72 75 63 /* normal struc
0f30: 74 20 72 65 74 75 72 6e 20 63 6f 6e 76 65 6e 74 t return convent
0f40: 69 6f 6e 20 2a 2f 0a 20 20 20 20 20 20 69 66 20 ion */. if
0f50: 28 6c 2d 3e 66 6c 61 67 73 20 26 20 5f 5f 41 56 (l->flags & __AV
0f60: 5f 52 45 47 49 53 54 45 52 5f 53 54 52 55 43 54 _REGISTER_STRUCT
0f70: 5f 52 45 54 55 52 4e 29 20 7b 0a 20 20 20 20 20 _RETURN) {.
0f80: 20 20 20 69 66 20 28 6c 2d 3e 72 73 69 7a 65 20 if (l->rsize
0f90: 3d 3d 20 73 69 7a 65 6f 66 28 63 68 61 72 29 29 == sizeof(char))
0fa0: 20 7b 20 2f 2a 20 63 61 6e 27 74 20 6f 63 63 75 { /* can't occu
0fb0: 72 20 2a 2f 0a 20 20 20 20 20 20 20 20 20 20 52 r */. R
0fc0: 45 54 55 52 4e 28 63 68 61 72 2c 20 69 29 3b 0a ETURN(char, i);.
0fd0: 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 0a 20 } else.
0fe0: 20 20 20 20 20 20 20 69 66 20 28 6c 2d 3e 72 73 if (l->rs
0ff0: 69 7a 65 20 3d 3d 20 73 69 7a 65 6f 66 28 73 68 ize == sizeof(sh
1000: 6f 72 74 29 29 20 7b 20 2f 2a 20 63 61 6e 27 74 ort)) { /* can't
1010: 20 6f 63 63 75 72 20 2a 2f 0a 20 20 20 20 20 20 occur */.
1020: 20 20 20 20 52 45 54 55 52 4e 28 73 68 6f 72 74 RETURN(short
1030: 2c 20 69 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 , i);. }
1040: 65 6c 73 65 0a 20 20 20 20 20 20 20 20 69 66 20 else. if
1050: 28 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 73 69 7a (l->rsize == siz
1060: 65 6f 66 28 69 6e 74 29 29 20 7b 0a 20 20 20 20 eof(int)) {.
1070: 20 20 20 20 20 20 52 45 54 55 52 4e 28 69 6e 74 RETURN(int
1080: 2c 20 69 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 , i);. }
1090: 65 6c 73 65 0a 20 20 20 20 20 20 20 20 69 66 20 else. if
10a0: 28 6c 2d 3e 72 73 69 7a 65 20 3d 3d 20 32 2a 73 (l->rsize == 2*s
10b0: 69 7a 65 6f 66 28 5f 5f 61 76 77 6f 72 64 29 29 izeof(__avword))
10c0: 20 7b 0a 20 20 20 20 20 20 20 20 20 20 28 28 5f {. ((_
10d0: 5f 61 76 77 6f 72 64 2a 29 6c 2d 3e 72 61 64 64 _avword*)l->radd
10e0: 72 29 5b 30 5d 20 3d 20 69 3b 0a 20 20 20 20 20 r)[0] = i;.
10f0: 20 20 20 20 20 28 28 5f 5f 61 76 77 6f 72 64 2a ((__avword*
1100: 29 6c 2d 3e 72 61 64 64 72 29 5b 31 5d 20 3d 20 )l->raddr)[1] =
1110: 69 72 65 74 32 3b 0a 20 20 20 20 20 20 20 20 7d iret2;. }
1120: 0a 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 20 . }. }.
1130: 20 7d 0a 20 20 72 65 74 75 72 6e 20 30 3b 0a 7d }. return 0;.}
1140: 0a 0a 23 65 6e 64 69 66 20 2f 2a 5f 61 76 63 61 ..#endif /*_avca
1150: 6c 6c 5f 61 72 6d 5f 63 20 2a 2f 0a ll_arm_c */.