require '_h2ph_pre.ph';

if(defined(&PIC)) {
    eval 'sub MCOUNT () { &__asm__(".global mcount");  &__asm__("mcount:");  &__asm__("add %o7, 8, %o1");  &__asm__("1: call 2f; nop; 2:");  &__asm__("add %o7,__mcount-1b, %o2");  &__asm__("ld [%o2], %o2");  &__asm__("jmpl %o2, %g0");  &__asm__("add %i7, 8, %o0");;}' unless defined(&MCOUNT);
} else {
    eval 'sub MCOUNT () { &__asm__(".global mcount");  &__asm__("mcount:");  &__asm__("add %i7, 8, %o0");  &__asm__("sethi %hi(__mcount), %o2");  &__asm__("jmpl %o2 + %lo(__mcount), %g0");  &__asm__("add %o7, 8, %o1");;}' unless defined(&MCOUNT);
}
unless(defined(&_MCOUNT_DECL)) {
    sub _MCOUNT_DECL () {	 &static  &void  &_mcount;}
}
if(defined(&_KERNEL)) {
    eval 'sub MCOUNT_ENTER () { &s =  &splhigh();}' unless defined(&MCOUNT_ENTER);
    eval 'sub MCOUNT_EXIT () { &splx( &s);}' unless defined(&MCOUNT_EXIT);
}
1;
