                incdir  include:
                incdir  lvo:
                incdir  powerasm:source/powerpc_lib/warprace/

**      '(C) Copyright 1997 Haage & Partner Computer GmbH'
**           All Rights Reserved

                include intuition/intuition.i
                include powerpc/powerpc.i
                include warprace.i

                include exec_lib.i
                include intuition_lib.i
                include graphics_lib.i
                include powerpc_lib.i

                xref    EmptyPPC
                xref    _LinkerDB


VERSION         =       1
REVISION        =       0
REVISIONCOUNT   =       1

LOOPCOUNT       =       1000

                mc68020

                section "",code
start
                movem.l d1-a6,-(sp)
                lea     _LinkerDB,a4
                cmp.l   #WR_ID,d0
                bne.b   .leave
                tst     WRI_68K(a0)
                beq.b   .go
.leave
                movem.l (sp)+,d1-a6
                moveq   #0,d0
                rts
.go
                move.l  a0,a2
                move.l  WRI_POWERPCBASE(a2),_PowerPCBase
                move.l  $4.w,_SysBase
                move.l  WRI_STARTTIMER_68K(a2),a1
                jsr     (a1)
                move    #LOOPCOUNT-1,d7
.loop
                RUNPOWERPC      EmptyPPC
                dbra    d7,.loop
                move.l  WRI_STOPTIMER_68K(a2),a1
                jsr     (a1)
                divu.l  #LOOPCOUNT,d0
                move.l  d0,Result
                divul.l #1000,d1:d0
                move.l  d0,ResultParams
                move.l  d1,ResultParams+4
                move.l  #STATUS_SUCCESS,Status
                move.l  #WRO,d0
                movem.l (sp)+,d1-a6
                rts


                section "",data
WRO
                dc.l    ModName
                dc.l    Short
                dc.l    Description
                dc.l    Author
                dc.l    VERSION
                dc.l    REVISION
                dc.l    REVISIONCOUNT
                dc.l    0
Result
                dc.l    0
                dc.l    RES_MICROSECS
                dc.l    ResultString
                dc.l    ResultParams
Status
                dc.l    0
ErrStr
                dc.l    0
                dc.l    0
                dc.l    0

ModName         dc.b    "CallPPC",0
Short           dc.b    "CPU context switch test program",0
Description     dc.b    "This program measures the performance of the CPU context\n"
                dc.b    "switches. An empty PPC function is called many times from\n"
                dc.b    "68K side and the average overhead time is evaluated",0
Author          dc.b    "Sam Jordan",0
ResultString    dc.b    "Average overhead time: %ld.%03ld ms",0

                section "",bss
_SysBase        ds.l    1
_PowerPCBase    ds.l    1
ResultParams    ds.l    2
