diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cdrom.h | 2 | ||||
| -rw-r--r-- | include/linux/fs.h | 3 | ||||
| -rw-r--r-- | include/linux/genhd.h | 4 | ||||
| -rw-r--r-- | include/linux/interrupt.h | 1 | ||||
| -rw-r--r-- | include/linux/sched.h | 3 | ||||
| -rw-r--r-- | include/linux/time.h | 42 | ||||
| -rw-r--r-- | include/linux/times.h | 4 |
7 files changed, 46 insertions, 13 deletions
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index b3a349fc341d..296ffe2cdfd4 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -716,6 +716,7 @@ struct request_sense { #ifdef __KERNEL__ #include <linux/devfs_fs_kernel.h> +#include <linux/device.h> struct cdrom_write_settings { unsigned char fpacket; /* fixed/variable packets */ @@ -730,6 +731,7 @@ struct cdrom_device_info { struct cdrom_device_info *next; /* next device_info for this major */ void *handle; /* driver-dependent data */ devfs_handle_t de; /* real driver should create this */ + struct device cdrom_driverfs_dev; /* driverfs implementation */ int number; /* generic driver updates this */ /* specifications */ kdev_t dev; /* device number */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 322e644060cf..002e02289155 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -701,6 +701,9 @@ extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct de /* * File types + * + * NOTE! These match bits 12..15 of stat.st_mode + * (ie "(i_mode >> 12) & 15"). */ #define DT_UNKNOWN 0 #define DT_FIFO 1 diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 18c981dafbf3..44a954b2c370 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -12,6 +12,7 @@ #include <linux/config.h> #include <linux/types.h> #include <linux/major.h> +#include <linux/device.h> enum { /* These three have identical behaviour; use the second one if DOS fdisk gets @@ -62,6 +63,7 @@ struct hd_struct { unsigned long nr_sects; devfs_handle_t de; /* primary (master) devfs entry */ int number; /* stupid old code wastes space */ + struct device hd_driverfs_dev; /* support driverfs hiearchy */ }; #define GENHD_FL_REMOVABLE 1 @@ -80,6 +82,7 @@ struct gendisk { struct block_device_operations *fops; devfs_handle_t *de_arr; /* one per physical disc */ + struct device **driverfs_dev_arr;/* support driverfs hierarchy */ char *flags; /* one per physical disc */ }; @@ -241,6 +244,7 @@ char *disk_name (struct gendisk *hd, int minor, char *buf); extern void devfs_register_partitions (struct gendisk *dev, int minor, int unregister); +extern void driverfs_remove_partitions (struct gendisk *hd, int minor); static inline unsigned int disk_index (kdev_t dev) { diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index fbc10eab16f4..3870d26066e9 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -57,6 +57,7 @@ enum HI_SOFTIRQ=0, NET_TX_SOFTIRQ, NET_RX_SOFTIRQ, + SCSI_SOFTIRQ, TASKLET_SOFTIRQ }; diff --git a/include/linux/sched.h b/include/linux/sched.h index 390627c2f1f6..6a83711022f8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -10,7 +10,6 @@ extern unsigned long event; #include <linux/threads.h> #include <linux/kernel.h> #include <linux/types.h> -#include <linux/times.h> #include <linux/timex.h> #include <linux/jiffies.h> #include <linux/rbtree.h> @@ -310,7 +309,7 @@ struct task_struct { unsigned long it_real_value, it_prof_value, it_virt_value; unsigned long it_real_incr, it_prof_incr, it_virt_incr; struct timer_list real_timer; - struct tms times; + unsigned long utime, stime, cutime, cstime; unsigned long start_time; long per_cpu_utime[NR_CPUS], per_cpu_stime[NR_CPUS]; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ diff --git a/include/linux/time.h b/include/linux/time.h index e7447958ece1..d9f9c6a340d8 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -12,6 +12,16 @@ struct timespec { }; #endif /* _STRUCT_TIMESPEC */ +struct timeval { + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ +}; + +struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + #ifdef __KERNEL__ /* @@ -48,6 +58,27 @@ jiffies_to_timespec(unsigned long jiffies, struct timespec *value) value->tv_sec = jiffies / HZ; } +/* Same for "timeval" */ +static __inline__ unsigned long +timeval_to_jiffies(struct timeval *value) +{ + unsigned long sec = value->tv_sec; + long usec = value->tv_usec; + + if (sec >= (MAX_JIFFY_OFFSET / HZ)) + return MAX_JIFFY_OFFSET; + usec += 1000000L / HZ - 1; + usec /= 1000000L / HZ; + return HZ * sec + usec; +} + +static __inline__ void +jiffies_to_timeval(unsigned long jiffies, struct timeval *value) +{ + value->tv_usec = (jiffies % HZ) * (1000000L / HZ); + value->tv_sec = jiffies / HZ; +} + /* Converts Gregorian date to seconds since 1970-01-01 00:00:00. * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 @@ -88,17 +119,6 @@ extern struct timeval xtime; #endif /* __KERNEL__ */ - -struct timeval { - time_t tv_sec; /* seconds */ - suseconds_t tv_usec; /* microseconds */ -}; - -struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; - #define NFDBITS __NFDBITS #ifdef __KERNEL__ diff --git a/include/linux/times.h b/include/linux/times.h index 569349ef461e..1174e9f88ea2 100644 --- a/include/linux/times.h +++ b/include/linux/times.h @@ -1,6 +1,10 @@ #ifndef _LINUX_TIMES_H #define _LINUX_TIMES_H +#ifdef __KERNEL__ +# define jiffies_to_clock_t(x) ((x) / (HZ / USER_HZ)) +#endif + struct tms { clock_t tms_utime; clock_t tms_stime; |
