diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/acpi.h | 4 | ||||
| -rw-r--r-- | include/linux/pci.h | 1 | ||||
| -rw-r--r-- | include/linux/time.h | 2 | ||||
| -rw-r--r-- | include/linux/timex.h | 25 |
4 files changed, 27 insertions, 5 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 9c619036dfb6..1bdcda4d36c8 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -354,11 +354,11 @@ void acpi_numa_arch_fixup(void); extern int acpi_mp_config; -#else /*!CONFIG_ACPI_BOOT*/ +#else #define acpi_mp_config 0 -#endif /*CONFIG_ACPI_BOOT*/ +#endif #ifdef CONFIG_ACPI_PCI diff --git a/include/linux/pci.h b/include/linux/pci.h index b82ec8e41174..79d909a8643a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -634,7 +634,6 @@ void pci_insert_device(struct pci_dev *, struct pci_bus *); void pci_remove_device(struct pci_dev *); struct pci_driver *pci_dev_driver(const struct pci_dev *); const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev); -void pci_announce_device_to_drivers(struct pci_dev *); unsigned int pci_do_scan_bus(struct pci_bus *bus); struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); diff --git a/include/linux/time.h b/include/linux/time.h index d9f9c6a340d8..088c52d09449 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -113,7 +113,7 @@ mktime (unsigned int year, unsigned int mon, )*60 + sec; /* finally seconds */ } -extern struct timeval xtime; +extern struct timespec xtime; #define CURRENT_TIME (xtime.tv_sec) diff --git a/include/linux/timex.h b/include/linux/timex.h index b82cbdc776f7..5b2b0ac18ae7 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -155,6 +155,28 @@ /* LATCH is used in the interval timer and ftape setup. */ #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ +/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can + * improve accuracy by shifting LSH bits, hence calculating: + * (NOM << LSH) / DEN + * This however means trouble for large NOM, because (NOM << LSH) may no + * longer fit in 32 bits. The following way of calculating this gives us + * some slack, under the following onditions: + * - (NOM / DEN) fits in (32 - LSH) bits. + * - (NOM % DEN) fits in (32 - LSH) bits. + */ +#define SH_DIV(NOM,DEN,LSH) ( ((NOM / DEN) << LSH) \ + + (((NOM % DEN) << LSH) + DEN / 2) / DEN) + +/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ +#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) + +/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ +#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) + +/* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ and */ +/* a value TUSEC for TICK_USEC (can be set bij adjtimex) */ +#define TICK_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8)) + /* * syscall interface - used (mainly by NTP daemon) * to discipline kernel clock oscillator @@ -251,7 +273,8 @@ struct timex { * Note: maximum error = NTP synch distance = dispersion + delay / 2; * estimated error = NTP dispersion. */ -extern long tick; /* timer interrupt period */ +extern unsigned long tick_usec; /* USER_HZ period (usec) */ +extern unsigned long tick_nsec; /* ACTHZ period (nsec) */ extern int tickadj; /* amount of adjustment per tick */ /* |
