mirror of
https://github.com/CTCaer/hekate.git
synced 2024-12-24 12:14:11 +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
@ -37,15 +37,15 @@ u32 get_tmr_us()
|
||||
|
||||
void msleep(u32 milliseconds)
|
||||
{
|
||||
u32 start = get_tmr_ms();
|
||||
while ((get_tmr_ms() - start) <= milliseconds)
|
||||
u32 start = RTC(0x10) | (RTC(0xC)<< 10);
|
||||
while (((RTC(0x10) | (RTC(0xC)<< 10)) - start) <= milliseconds)
|
||||
;
|
||||
}
|
||||
|
||||
void usleep(u32 microseconds)
|
||||
{
|
||||
u32 start = get_tmr_us();
|
||||
while ((get_tmr_us() - start) <= microseconds)
|
||||
u32 start = TMR(0x10);
|
||||
while ((TMR(0x10) - start) <= microseconds)
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "types.h"
|
||||
|
||||
#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
|
||||
{
|
||||
@ -38,7 +38,7 @@ void exec_cfg(u32 *base, const cfg_op_t *ops, u32 num_ops);
|
||||
u32 crc32c(const void *buf, u32 len);
|
||||
|
||||
/* 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);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user