threadprofileinit.c 1.41 KB
/************************************************************************
 Copyright (C) 1999 NINTENDO CO,Ltd,
 Copyright (C) 1999 MONEGI CORPORATION,
        All Rights Reserved
This program is a trade secret of NINTENDO CO,Ltd and MONEGI Corp.
and it is not to be reproduced, published, disclosed to others, copied,
adapted, distributed, or displayed without the prior authorization of
NINTENDO CO,Ltd. and MONEGI Corp. Licensee agrees to attach or embed
this Notice on all copies of the program, including partial copies or
modified versions thereof.
*************************************************************************/
/************************************************************************
 $Date: 2002/10/29 08:06:43 $
 $Revision: 1.1.1.1 $
 $Author: blythe $
************************************************************************/

#ifndef _FINALROM

#include <rdb.h>
#include <os_internal.h>
#include <os_thread.h>
#include "osint.h"

/*
 * プロファイラを初期化する
 * 最初に一度必ず実行しなくてはならない
 */
void
osThreadProfileInit(void)
{
    register u32 saveMask;
    OSId i;

    saveMask = __osDisableInt();
    __osThprofFunc  = NULL;
    __osThprofFlag  = 1;       /* Init 実行フラグ */
    __osThprofCount = 0;
    __osThprofStack = &__osThprofHeap[THPROF_STACKSIZE/sizeof(u64) - 1];    
    __osRestoreInt(saveMask);

    for(i=0;i<THPROF_IDMAX;i++){
	osThreadProfileClear(i);
    }
}

#endif /* #ifndef _FINALROM */