X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fhpet.h;h=707f7cb9e795cb8ab5fdd0c84e7a9791605156a5;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=9ab04e9887dc0a7e6ff4e77ebbfd3ad4f48d45de;hpb=5fc42a6ed0ec81088c37caadb45898ae6cd0ad2c;p=linux-2.6.git diff --git a/include/linux/hpet.h b/include/linux/hpet.h index 9ab04e988..707f7cb9e 100644 --- a/include/linux/hpet.h +++ b/include/linux/hpet.h @@ -1,6 +1,10 @@ #ifndef __HPET__ #define __HPET__ 1 +#include + +#ifdef __KERNEL__ + /* * Offsets into HPET Registers */ @@ -54,12 +58,6 @@ struct hpet { #define HPET_LEG_RT_CNF_MASK (2UL) #define HPET_ENABLE_CNF_MASK (1UL) -/* - * HPET interrupt status register - */ - -#define HPET_ISR_CLEAR(HPET, TIMER) \ - (HPET)->hpet_isr |= (1UL << TIMER) /* * Timer configuration register @@ -89,22 +87,6 @@ struct hpet { #define Tn_FSB_INT_ADDR_SHIFT (32UL) #define Tn_FSB_INT_VAL_MASK (0x00000000ffffffffULL) -struct hpet_info { - unsigned long hi_ireqfreq; /* Hz */ - unsigned long hi_flags; /* information */ - unsigned short hi_hpet; - unsigned short hi_timer; -}; - -#define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ - -#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ -#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ -#define HPET_INFO _IOR('h', 0x03, struct hpet_info) -#define HPET_EPI _IO('h', 0x04) /* enable periodic */ -#define HPET_DPI _IO('h', 0x05) /* disable periodic */ -#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ - /* * exported interfaces */ @@ -116,7 +98,8 @@ struct hpet_task { }; struct hpet_data { - unsigned long hd_address; + unsigned long hd_phys_address; + void __iomem *hd_address; unsigned short hd_nirqs; unsigned short hd_flags; unsigned int hd_state; /* timer allocated */ @@ -125,9 +108,33 @@ struct hpet_data { #define HPET_DATA_PLATFORM 0x0001 /* platform call to hpet_alloc */ +static inline void hpet_reserve_timer(struct hpet_data *hd, int timer) +{ + hd->hd_state |= (1 << timer); + return; +} + int hpet_alloc(struct hpet_data *); int hpet_register(struct hpet_task *, int); int hpet_unregister(struct hpet_task *); int hpet_control(struct hpet_task *, unsigned int, unsigned long); +#endif /* __KERNEL__ */ + +struct hpet_info { + unsigned long hi_ireqfreq; /* Hz */ + unsigned long hi_flags; /* information */ + unsigned short hi_hpet; + unsigned short hi_timer; +}; + +#define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ + +#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ +#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ +#define HPET_INFO _IOR('h', 0x03, struct hpet_info) +#define HPET_EPI _IO('h', 0x04) /* enable periodic */ +#define HPET_DPI _IO('h', 0x05) /* disable periodic */ +#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ + #endif /* !__HPET__ */