2 ### Class StubAmithlon: Create a Amithlon stub 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 "ULONG _CallLib68k(struct _Regs*,LONG) " .
52 "__attribute__((__regparm__(3)));\n";
54 print "#endif /* __INLINE_MACROS_H */\n";
61 my $prototype = $params{'prototype'};
62 my $sfd = $self->{SFD
};
64 if ($prototype->{type
} eq 'function') {
68 if (!$prototype->{nb
}) {
69 print " BASE_EXT_DECL\n";
71 if (!$prototype->{nr
}) {
72 print " $prototype->{return} _res;\n";
75 print " struct _Regs _regs;\n";
78 $self->SUPER::function_start
(@_);
85 my $prototype = $params{'prototype'};
86 my $argtype = $params{'argtype'};
87 my $argname = $params{'argname'};
88 my $argreg = $params{'argreg'};
89 my $argnum = $params{'argnum'};
91 if ($$prototype{'type'} eq 'function') {
92 printf " __asm(\"movl %%1,%%0\":\"=m\"(_regs.%s)" .
93 ":\"ri\"((ULONG)%s));\n", $argreg, $argname;
96 $self->SUPER::function_arg
(@_);
103 my $prototype = $params{'prototype'};
104 my $sfd = $self->{SFD
};
107 if ($$prototype{'type'} eq 'function') {
108 if (!$prototype->{nb
}) {
109 print " __asm(\"movl %1,%0\":\"=m\"(_regs.a6)" .
110 ":\"ri\"((ULONG)(BASE_NAME)));\n";
115 if (!$prototype->{nr
}) {
116 print "_res = ($prototype->{return}) ";
119 print "_CallLib68k(&_regs,-$prototype->{bias});\n";
121 if (!$prototype->{nr
}) {
122 print " return _res;\n";
128 $self->SUPER::function_end
(@_);