/*****************************************************************
*                                                                *
* Copyright (C) 1985, Commodore Amiga Inc.  All rights reserved. *
*                                                                *
*****************************************************************/


/****************************************************************
*
* SOURCE CONTROL
* ------ -------
* $Header: /home/amiga/V36/src/kickstart/timer/RCS/timer.h,v 36.14 90/04/01 19:13:28 rsbx Exp $
*
* $Locker:  $
*
* $Log:	timer.h,v $
* Revision 36.14  90/04/01  19:13:28  rsbx
* RCS version change.
* 
* Revision 36.13  90/02/27  16:45:37  rsbx
* Now include exec/types.? directly.
* 
* Revision 36.12  90/01/12  20:05:36  rsbx
* Fixed #endifs to be ANSI compliant.
* 
* Revision 36.11  89/09/18  18:05:06  rsbx
* 
* 
* Revision 36.6  89/08/14  18:30:46  rsbx
* Added READECLOCK entrypoint offset.
* 
* Revision 36.5  89/08/09  19:23:52  rsbx
* *** empty log message ***
* 
* Revision 36.4  89/08/09  18:10:34  rsbx
* *** empty log message ***
* 
* Revision 36.2  89/08/09  14:10:50  rsbx
* added eclockval structure.
* 
*
****************************************************************/

#ifndef DEVICES_TIMER_H
#define DEVICES_TIMER_H

#include <exec/types.h>
#include <exec/io.h>

/* unit defintions */
#define UNIT_MICROHZ	0
#define UNIT_VBLANK	1
#define UNIT_ECLOCK	2
#define UNIT_WAITUNTIL	3
#define	UNIT_WAITECLOCK	4

#define TIMERNAME	"timer.device"

struct timeval {
    ULONG tv_secs;
    ULONG tv_micro;
};

struct EClockVal {
    ULONG ev_hi;
    ULONG ev_lo;
};

struct timerequest {
    struct IORequest tr_node;
    struct timeval tr_time;
};

/* IO_COMMAND to use for adding a timer */
#define TR_ADDREQUEST	CMD_NONSTD
#define TR_GETSYSTIME	(CMD_NONSTD+1)
#define TR_SETSYSTIME	(CMD_NONSTD+2)

#endif /* DEVICES_TIMER_H */
