LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
Macros | Functions | Variables
gmon.c File Reference
#include <sys/param.h>
#include <sys/time.h>
#include <arch/lib.h>
#include "gmon.h"
#include <ppc/timebase.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <debug.h>
Include dependency graph for gmon.c:

Go to the source code of this file.

Macros

#define SCALE_1_TO_1   0x10000L
 
#define ERR(s)   write(2, s, sizeof(s))
 

Functions

int cputime (void)
 
void moncontrol (int)
 
void monstartup (u_long lowpc, u_long highpc)
 
void _mcleanup ()
 
 __asm__ (".global _mcount \n" "_mcount: \n" "stwu %sp, -0x70(%sp) \n" "mflr %r0 \n" "stw %r0, 0x60(%sp) \n" "std %r3, 0x10(%sp) \n" "std %r4, 0x18(%sp) \n" "std %r5, 0x20(%sp) \n" "std %r6, 0x28(%sp) \n" "std %r7, 0x30(%sp) \n" "std %r8, 0x38(%sp) \n" "std %r9, 0x40(%sp) \n" "std %r10, 0x48(%sp) \n" "mflr %r3 \n" "lwz %r4,0x74(%sp) \n" "bl internal_mcount \n" "ld %r3, 0x10(%sp) \n" "ld %r4, 0x18(%sp) \n" "ld %r5, 0x20(%sp) \n" "ld %r6, 0x28(%sp) \n" "ld %r7, 0x30(%sp) \n" "ld %r8, 0x38(%sp) \n" "ld %r9, 0x40(%sp) \n" "ld %r10, 0x48(%sp) \n" "lwz %r11, 0x60(%sp) \n" "addi %sp, %sp, 0x70 \n" "mtlr %r0 \n" "lwz %r0,4(%sp) \n" "mtctr %r11 \n" "mtlr %r0 \n" "bctr \n")
 
void internal_mcount (fptrint_t selfpc, fptrint_t frompc)
 

Variables

char * minbrk
 
struct gmonparam _gmonparam = { GMON_PROF_ON }
 

Macro Definition Documentation

◆ ERR

#define ERR (   s)    write(2, s, sizeof(s))

Definition at line 59 of file gmon.c.

◆ SCALE_1_TO_1

#define SCALE_1_TO_1   0x10000L

Definition at line 57 of file gmon.c.

Function Documentation

◆ __asm__()

__asm__ ( ".global _mcount \n" "_mcount: \n" "stwu %  sp,
-0x70(%sp) \n" "mflr %r0 \n" "stw %  r0,
0x60(%sp) \n" "std %  r3,
0x10(%sp) \n" "std %  r4,
0x18(%sp) \n" "std %  r5,
0x20(%sp) \n" "std %  r6,
0x28(%sp) \n" "std %  r7,
0x30(%sp) \n" "std %  r8,
0x38(%sp) \n" "std %  r9,
0x40(%sp) \n" "std %  r10,
0x48(%sp) \n" "mflr %r3 \n" "lwz %  r4,
0x74(%sp) \n" "bl internal_mcount \n" "ld %  r3,
0x10(%sp) \n" "ld %  r4,
0x18(%sp) \n" "ld %  r5,
0x20(%sp) \n" "ld %  r6,
0x28(%sp) \n" "ld %  r7,
0x30(%sp) \n" "ld %  r8,
0x38(%sp) \n" "ld %  r9,
0x40(%sp) \n" "ld %  r10,
0x48(%sp) \n" "lwz %  r11,
0x60(%sp) \n" "addi %  sp,
sp,
0x70 \n" "mtlr %r0 \n" "lwz %  r0,
4(%sp) \n" "mtctr %r11 \n" "mtlr %r0 \n" "bctr \n"   
)

◆ _mcleanup()

void _mcleanup ( )

Definition at line 158 of file gmon.c.

◆ cputime()

int cputime ( void  )

Definition at line 77 of file gmon.c.

◆ internal_mcount()

void internal_mcount ( fptrint_t  selfpc,
fptrint_t  frompc 
)

Definition at line 326 of file gmon.c.

◆ moncontrol()

void moncontrol ( int  mode)

Definition at line 254 of file gmon.c.

◆ monstartup()

void monstartup ( u_long  lowpc,
u_long  highpc 
)

Definition at line 91 of file gmon.c.

Variable Documentation

◆ _gmonparam

struct gmonparam _gmonparam = { GMON_PROF_ON }

Definition at line 53 of file gmon.c.

◆ minbrk

char* minbrk

Definition at line 51 of file gmon.c.