diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2010-11-17 21:45:58 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2010-11-17 21:45:58 +0000 |
commit | 9a984ac7cb2d9b585509a8f8ec8126d6c525b7c9 (patch) | |
tree | 7554c8cff521fabc1a34f41e5b14ca88a29ef418 /libgloss/tic6x | |
parent | f8ff5e47b62a52d4588babab5249504e014d547c (diff) | |
download | newlib-9a984ac7cb2d9b585509a8f8ec8126d6c525b7c9.zip newlib-9a984ac7cb2d9b585509a8f8ec8126d6c525b7c9.tar.gz newlib-9a984ac7cb2d9b585509a8f8ec8126d6c525b7c9.tar.bz2 |
2010-11-17 Bernd Schmidt <bernds@codesourcery.com>
* tic6x/syscalls.c (cio_getclk_to_host, cio_getclk_from_host): New
structs.
(cio_to_host, cio_from_host): Use them.
(clock): New function.
Diffstat (limited to 'libgloss/tic6x')
-rw-r--r-- | libgloss/tic6x/syscalls.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libgloss/tic6x/syscalls.c b/libgloss/tic6x/syscalls.c index dc0633b..393fba6 100644 --- a/libgloss/tic6x/syscalls.c +++ b/libgloss/tic6x/syscalls.c @@ -149,6 +149,17 @@ struct __attribute__((packed)) cio_gettime_from_host int time; }; +struct __attribute__((packed)) cio_getclk_to_host +{ + /* Empty. */ +}; + +struct __attribute__((packed)) cio_getclk_from_host +{ + /* Clock cycles (little endian). */ + int result; +}; + struct __attribute__((packed)) cio_to_host { /* Data length (target endian). */ @@ -167,6 +178,7 @@ struct __attribute__((packed)) cio_to_host struct cio_unlink_to_host unlink; struct cio_rename_to_host rename; struct cio_gettime_to_host gettime; + struct cio_getclk_to_host getclk; } parms; /* Variable-length data. */ unsigned char data[]; @@ -188,6 +200,7 @@ struct __attribute__((packed)) cio_from_host struct cio_unlink_from_host unlink; struct cio_rename_from_host rename; struct cio_gettime_from_host gettime; + struct cio_getclk_from_host getclk; } parms; /* Data. */ unsigned char data[]; @@ -344,6 +357,14 @@ gettimeofday (struct timeval *tp, void *tzvp) return 0; } +clock_t +clock (void) +{ + semi_call_wrapper (_DTGETCLK, NULL, 0); + return SWAPINT (_CIOBUF_.u.from_host.parms.getclk.result); +} + + int isatty (int file __attribute__((unused))) { |