2 ### Class GateAmithlon: Create an Amithlon gatestub file ######################
11 my $class = ref($proto) || $proto;
12 my $self = $class->SUPER::new
( @_ );
13 bless ($self, $class);
20 $self->SUPER::header
(@_);
22 print "#ifndef __INLINE_MACROS_H\n";
23 print "#define __INLINE_MACROS_H\n";
25 print "#ifndef __INLINE_MACROS_H_REGS\n";
26 print "#define __INLINE_MACROS_H_REGS\n";
28 print "#include <exec/types.h>\n";
30 print "struct _Regs {\n";
49 print "#endif /* __INLINE_MACROS_H_REGS */\n";
51 print "#endif /* __INLINE_MACROS_H */\n";
58 my $prototype = $params{'prototype'};
59 my $sfd = $self->{SFD
};
61 $self->SUPER::function_proto
(@_);
63 print_gateproto
($sfd, $prototype);
70 if (!$self->{PROTO
}) {
72 my $prototype = $params{'prototype'};
73 my $sfd = $self->{SFD
};
75 print "$prototype->{return}\n";
76 print "$gateprefix$prototype->{funcname}(struct _Regs* _regs)\n";
84 if (!$self->{PROTO
}) {
86 my $prototype = $params{'prototype'};
87 my $argtype = $params{'argtype'};
88 my $argname = $params{'argname'};
89 my $argreg = $params{'argreg'};
90 my $argnum = $params{'argnum'};
91 my $sfd = $self->{SFD
};
93 print " $prototype->{___args}[$argnum] = ($argtype) ({long r;" .
94 "__asm(\"movl %1,%0\":\"=r\"(r):\"m\"(_regs->$argreg));" .
102 if (!$self->{PROTO
}) {
104 my $prototype = $params{'prototype'};
105 my $sfd = $self->{SFD
};
107 if ($libarg ne 'none' && !$prototype->{nb
}) {
108 print " $sfd->{basetype} _base = ($sfd->{basetype}) " .
110 "__asm(\"movl %1,%0\":\"=r\"(r):\"m\"(_regs->a6));" .
114 print " return $libprefix$prototype->{funcname}(";
116 if ($libarg eq 'first' && !$prototype->{nb
}) {
118 print $prototype->{numargs
} > 0 ?
", " : "";
121 print join (', ', @
{$prototype->{___argnames
}});
123 if ($libarg eq 'last' && !$prototype->{nb
}) {
124 print $prototype->{numargs
} > 0 ?
", " : "";
133 sub print_gateproto
{
135 my $prototype = shift;
137 print "$prototype->{return}\n";
138 print "$gateprefix$prototype->{funcname}" .
139 "(struct _Regs* _regs) __attribute__((regparm(3)))";