| Last change
                  on this file since 642 was
                  444,
                  checked in by satin@…, 7 years ago | 
        
          | 
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
 | 
        | File size:
            367 bytes | 
      
      
        
  | Rev | Line |  | 
|---|
| [444] | 1 | #include <machine/syscall.h> | 
|---|
|  | 2 | #include <sys/time.h> | 
|---|
|  | 3 |  | 
|---|
|  | 4 | int | 
|---|
|  | 5 | nanosleep(const struct timespec *rqtp, struct timespec *rmtp) | 
|---|
|  | 6 | { | 
|---|
|  | 7 | unsigned long current_time, end_time; | 
|---|
|  | 8 | asm ("rdtime %0" : "+r" (current_time)); | 
|---|
|  | 9 | end_time = current_time + rqtp->tv_sec * 1000000000ULL + rqtp->tv_nsec; | 
|---|
|  | 10 | while (current_time <= end_time) asm ("rdtime %0" : "+r" (current_time)); | 
|---|
|  | 11 | return 0; | 
|---|
|  | 12 | } | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.