home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.1 (Developer) [x86] / NeXT Step 3.1 Intel dev.cdr.dmg / NextDeveloper / Headers / kernserv / clock_timer.h < prev    next >
Encoding:
Text File  |  1993-04-30  |  1.2 KB  |  52 lines

  1. /*
  2.  * The machine independent clock and timer definitions.
  3.  *
  4.  * Copyright (c) 1989 NeXT, Inc.
  5.  *
  6.  * HISTORY
  7.  *
  8.  *  6Dec91 Brian Pinkerton at NeXT
  9.  *    Created.
  10.  */
  11. #import <mach/mach_types.h>
  12. #import    <mach/boolean.h>
  13. #import <bsd/sys/time.h>
  14. #import <bsd/sys/callout.h>
  15.  
  16. typedef    unsigned long long    ns_time_t;    /* nanoseconds! */
  17.  
  18. #if    __nrw__
  19.  
  20. /*
  21.  * FIXME - static versions of this struct are not properly aligned.
  22.  */
  23. typedef struct chrono_attributes {
  24.     ns_time_t    max_value __attribute__(( aligned(8) ));    
  25.                     /* max value of clock or timer */
  26.     ns_time_t    resolution;    /* actual hardware accuracy */
  27. } *chrono_attributes_t;
  28.  
  29. #else    __nrw__
  30.  
  31. typedef struct chrono_attributes {
  32.     ns_time_t    max_value;    /* max value of clock or timer */
  33.     ns_time_t    resolution;    /* actual hardware accuracy */
  34. } *chrono_attributes_t;
  35.  
  36. #endif    __nrw__
  37.  
  38. typedef enum {
  39.     Calendar,    /* assumed battery back-up */
  40.     System,        /* assumed "highest resolution available" */
  41. } clock_types_t;
  42.  
  43.  
  44. /*
  45.  *  Clock functions.  These can be called from any ipl.
  46.  */
  47. ns_time_t clock_value(clock_types_t which_clock);
  48. void set_clock(clock_types_t which_clock, ns_time_t ns);
  49. const struct chrono_attributes *clock_attributes(clock_types_t which_clock);
  50.  
  51.  
  52.