Skip to content

Commit

Permalink
Inline gettick
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Nov 11, 2024
1 parent f5ea194 commit a395ffa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 5 additions & 1 deletion gc/ogc/timesupp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
extern "C" {
#endif

u32 gettick(void);
static inline u32 gettick(void)
{
return __builtin_ppc_mftb();
}

u64 gettime(void);
void settime(u64 time);

Expand Down
10 changes: 0 additions & 10 deletions libogc/timesupp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@

#include <sys/time.h>

u32 gettick(void)
{
u32 result;
__asm__ __volatile__ (
"mftb %0\n"
: "=r" (result)
);
return result;
}

u64 gettime(void)
{
u32 tmp;
Expand Down

0 comments on commit a395ffa

Please sign in to comment.