Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
mbedtls
Commits
2eee902b
Commit
2eee902b
authored
Apr 24, 2011
by
Paul Bakker
Browse files
- Better timer for Windows platforms
- Made alarmed volatile for better Windows compatibility
parent
a755ca1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/polarssl/timing.h
View file @
2eee902b
...
...
@@ -39,7 +39,7 @@ struct hr_time
extern
"C"
{
#endif
extern
int
alarmed
;
extern
volatile
int
alarmed
;
/**
* \brief Return the CPU cycle counter value
...
...
library/timing.c
View file @
2eee902b
...
...
@@ -136,6 +136,18 @@ unsigned long hardclock( void )
return
(
itc
);
}
#else
#if defined(_MSC_VER)
unsigned
long
hardclock
(
void
)
{
LARGE_INTEGER
offset
;
QueryPerformanceCounter
(
&
offset
);
return
(
unsigned
long
)(
offset
.
QuadPart
);
}
#else
static
int
hardclock_init
=
0
;
...
...
@@ -157,6 +169,7 @@ unsigned long hardclock( void )
}
#endif
/* generic */
#endif
/* WIN32 */
#endif
/* IA-64 */
#endif
/* Alpha */
#endif
/* SPARC8 */
...
...
@@ -164,7 +177,7 @@ unsigned long hardclock( void )
#endif
/* AMD64 */
#endif
/* i586+ */
int
alarmed
=
0
;
volatile
int
alarmed
=
0
;
#if defined(_WIN32)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment