unsigned long scaled_ticks_per_cycle;
/* last time the CMOS clock got updated */
time_t last_rtc_update;
+ /* partial unused tick */
+ unsigned long partial_tick;
} state;
unsigned long est_cycle_freq;
*/
void timer_interrupt(int irq, void *dev, struct pt_regs * regs)
{
- const unsigned long half = 1UL << (FIX_SHIFT - 1);
- const unsigned long mask = (1UL << (FIX_SHIFT + 1)) - 1;
unsigned long delta;
__u32 now;
long nticks;
#endif
/*
- * Estimate how many ticks have passed since the last update.
- * Round the result, .5 to even. When we loose ticks due to
- * say using IDE, the clock has been seen to run up to 15% slow
- * if we truncate.
+ * Calculate how many ticks have passed since the last update,
+ * including any previous partial leftover. Save any resulting
+ * fraction for the next pass.
*/
now = rpcc();
delta = now - state.last_time;
state.last_time = now;
- delta = delta * state.scaled_ticks_per_cycle;
- if ((delta & mask) != half)
- delta += half;
+ delta = delta * state.scaled_ticks_per_cycle + state.partial_tick;
+ state.partial_tick = delta & ((1UL << FIX_SHIFT) - 1);
nticks = delta >> FIX_SHIFT;
- do {
+ while (nticks > 0) {
do_timer(regs);
- } while (--nticks > 0);
+ nticks--;
+ }
/*
* If we have an externally synchronized Linux clock, then update
state.scaled_ticks_per_cycle
= ((unsigned long) HZ << FIX_SHIFT) / cycle_freq;
state.last_rtc_update = 0;
+ state.partial_tick = 0L;
/* setup timer */
irq_handler = timer_interrupt;
*/
delta_usec = delta_cycles * state.scaled_ticks_per_cycle * 15625;
- delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6)) * HZ)) + 1) / 2;
+ delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2;
usec += delta_usec;
if (usec >= 1000000) {
NFS_WB(inode, req->wb_pid == pid);
}
-/*
- * Write back and invalidate. Sometimes we can't leave the stuff
- * hanging if we can't write it out.
- */
-int
-nfs_wbinval(struct inode *inode)
-{
- int retval = nfs_wb_all(inode);
-
- if (retval)
- nfs_cancel_dirty(inode,0);
- return retval;
-}
-
-int nfs_wbinval_pid(struct inode *inode, pid_t pid)
-{
- int retval = nfs_wb_pid(inode, pid);
-
- if (retval)
- nfs_cancel_dirty(inode,pid);
- return retval;
-}
-
void
nfs_inval(struct inode *inode)
{
* back first..
*/
extern void nfs_inval(struct inode *);
-extern int nfs_wbinval(struct inode *);
-extern int nfs_wbinval_pid(struct inode *, pid_t);
-
extern int nfs_truncate_dirty_pages(struct inode *, unsigned long);
extern int nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int, int);
int len;
char buffer[256-sizeof(int)];
} path_array[2] = {
- { 23, "/usr/src/linux/include/" },
+ { 0, "" },
{ 0, "" }
};
char *hpath;
hpath = getenv("HPATH");
- if (!hpath)
- hpath = "/usr/src/linux/include";
+ if (!hpath) {
+ fputs("mkdep: HPATH not set in environment. "
+ "Don't bypass the top level Makefile.\n", stderr);
+ return 1;
+ }
len = strlen(hpath);
memcpy(path_array[0].buffer, hpath, len);
if (len && hpath[len-1] != '/')