mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 19:31:12 +00:00
Make the sleeps faster
Based on tests they are not faster, even though the raw sleeps have less instuctions. But having them call get_tmr breaks important logic. Make both raw to avoid any future problems.
This commit is contained in:
parent
879fc643d9
commit
a14f554657
2 changed files with 6 additions and 6 deletions
|
@ -37,15 +37,15 @@ u32 get_tmr_us()
|
||||||
|
|
||||||
void msleep(u32 milliseconds)
|
void msleep(u32 milliseconds)
|
||||||
{
|
{
|
||||||
u32 start = get_tmr_ms();
|
u32 start = RTC(0x10) | (RTC(0xC)<< 10);
|
||||||
while ((get_tmr_ms() - start) <= milliseconds)
|
while (((RTC(0x10) | (RTC(0xC)<< 10)) - start) <= milliseconds)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
void usleep(u32 microseconds)
|
void usleep(u32 microseconds)
|
||||||
{
|
{
|
||||||
u32 start = get_tmr_us();
|
u32 start = TMR(0x10);
|
||||||
while ((get_tmr_us() - start) <= microseconds)
|
while ((TMR(0x10) - start) <= microseconds)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#define byte_swap_32(num) ((num>>24)&0xff) | ((num<<8)&0xff0000) | \
|
#define byte_swap_32(num) ((num>>24)&0xff) | ((num<<8)&0xff0000) | \
|
||||||
((num>>8)&0xff00) | ((num<<24)&0xff000000); \
|
((num>>8)&0xff00) | ((num<<24)&0xff000000) \
|
||||||
|
|
||||||
typedef struct _cfg_op_t
|
typedef struct _cfg_op_t
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ void exec_cfg(u32 *base, const cfg_op_t *ops, u32 num_ops);
|
||||||
u32 crc32c(const void *buf, u32 len);
|
u32 crc32c(const void *buf, u32 len);
|
||||||
|
|
||||||
/* This is a faster implementation of memcmp that checks two u32 values */
|
/* This is a faster implementation of memcmp that checks two u32 values */
|
||||||
/* every 128 Bytes block. Intented for only for Backup and Restore */
|
/* every 128 Bytes block. Intented only for Backup and Restore */
|
||||||
u32 memcmp32sparse(const u32 *buf1, const u32 *buf2, u32 len);
|
u32 memcmp32sparse(const u32 *buf1, const u32 *buf2, u32 len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue