diff options
Diffstat (limited to 'include/linux')
33 files changed, 502 insertions, 335 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d5680cd7746a..bf5e0009de75 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #include <linux/list.h> | 35 | #include <linux/list.h> |
36 | #include <linux/mod_devicetable.h> | ||
36 | 37 | ||
37 | #include <acpi/acpi.h> | 38 | #include <acpi/acpi.h> |
38 | #include <acpi/acpi_bus.h> | 39 | #include <acpi/acpi_bus.h> |
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h index 290aef326812..5f921c84827a 100644 --- a/include/linux/apm_bios.h +++ b/include/linux/apm_bios.h | |||
@@ -21,20 +21,22 @@ typedef unsigned short apm_eventinfo_t; | |||
21 | 21 | ||
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | 23 | ||
24 | #include <linux/types.h> | ||
25 | |||
24 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) | 26 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) |
25 | #define APM_CS_16 (APM_CS + 8) | 27 | #define APM_CS_16 (APM_CS + 8) |
26 | #define APM_DS (APM_CS_16 + 8) | 28 | #define APM_DS (APM_CS_16 + 8) |
27 | 29 | ||
28 | struct apm_bios_info { | 30 | struct apm_bios_info { |
29 | unsigned short version; | 31 | u16 version; |
30 | unsigned short cseg; | 32 | u16 cseg; |
31 | unsigned long offset; | 33 | u32 offset; |
32 | unsigned short cseg_16; | 34 | u16 cseg_16; |
33 | unsigned short dseg; | 35 | u16 dseg; |
34 | unsigned short flags; | 36 | u16 flags; |
35 | unsigned short cseg_len; | 37 | u16 cseg_len; |
36 | unsigned short cseg_16_len; | 38 | u16 cseg_16_len; |
37 | unsigned short dseg_len; | 39 | u16 dseg_len; |
38 | }; | 40 | }; |
39 | 41 | ||
40 | /* Results of APM Installation Check */ | 42 | /* Results of APM Installation Check */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 695e34964cb7..b126c6f68e27 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -37,7 +37,7 @@ | |||
37 | struct scsi_ioctl_command; | 37 | struct scsi_ioctl_command; |
38 | 38 | ||
39 | struct request_queue; | 39 | struct request_queue; |
40 | typedef struct request_queue request_queue_t; | 40 | typedef struct request_queue request_queue_t __deprecated; |
41 | struct elevator_queue; | 41 | struct elevator_queue; |
42 | typedef struct elevator_queue elevator_t; | 42 | typedef struct elevator_queue elevator_t; |
43 | struct request_pm_state; | 43 | struct request_pm_state; |
@@ -233,7 +233,7 @@ struct request { | |||
233 | struct list_head queuelist; | 233 | struct list_head queuelist; |
234 | struct list_head donelist; | 234 | struct list_head donelist; |
235 | 235 | ||
236 | request_queue_t *q; | 236 | struct request_queue *q; |
237 | 237 | ||
238 | unsigned int cmd_flags; | 238 | unsigned int cmd_flags; |
239 | enum rq_cmd_type_bits cmd_type; | 239 | enum rq_cmd_type_bits cmd_type; |
@@ -337,15 +337,15 @@ struct request_pm_state | |||
337 | 337 | ||
338 | #include <linux/elevator.h> | 338 | #include <linux/elevator.h> |
339 | 339 | ||
340 | typedef void (request_fn_proc) (request_queue_t *q); | 340 | typedef void (request_fn_proc) (struct request_queue *q); |
341 | typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); | 341 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); |
342 | typedef int (prep_rq_fn) (request_queue_t *, struct request *); | 342 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
343 | typedef void (unplug_fn) (request_queue_t *); | 343 | typedef void (unplug_fn) (struct request_queue *); |
344 | 344 | ||
345 | struct bio_vec; | 345 | struct bio_vec; |
346 | typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); | 346 | typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); |
347 | typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); | 347 | typedef int (issue_flush_fn) (struct request_queue *, struct gendisk *, sector_t *); |
348 | typedef void (prepare_flush_fn) (request_queue_t *, struct request *); | 348 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); |
349 | typedef void (softirq_done_fn)(struct request *); | 349 | typedef void (softirq_done_fn)(struct request *); |
350 | 350 | ||
351 | enum blk_queue_state { | 351 | enum blk_queue_state { |
@@ -483,8 +483,8 @@ struct request_queue | |||
483 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 483 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
484 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 484 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
485 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ | 485 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ |
486 | #define QUEUE_FLAG_READFULL 3 /* write queue has been filled */ | 486 | #define QUEUE_FLAG_READFULL 3 /* read queue has been filled */ |
487 | #define QUEUE_FLAG_WRITEFULL 4 /* read queue has been filled */ | 487 | #define QUEUE_FLAG_WRITEFULL 4 /* write queue has been filled */ |
488 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ | 488 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ |
489 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 489 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
490 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 490 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ |
@@ -626,13 +626,13 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn; | |||
626 | 626 | ||
627 | #ifdef CONFIG_BOUNCE | 627 | #ifdef CONFIG_BOUNCE |
628 | extern int init_emergency_isa_pool(void); | 628 | extern int init_emergency_isa_pool(void); |
629 | extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); | 629 | extern void blk_queue_bounce(struct request_queue *q, struct bio **bio); |
630 | #else | 630 | #else |
631 | static inline int init_emergency_isa_pool(void) | 631 | static inline int init_emergency_isa_pool(void) |
632 | { | 632 | { |
633 | return 0; | 633 | return 0; |
634 | } | 634 | } |
635 | static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) | 635 | static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio) |
636 | { | 636 | { |
637 | } | 637 | } |
638 | #endif /* CONFIG_MMU */ | 638 | #endif /* CONFIG_MMU */ |
@@ -646,14 +646,14 @@ extern void blk_unregister_queue(struct gendisk *disk); | |||
646 | extern void register_disk(struct gendisk *dev); | 646 | extern void register_disk(struct gendisk *dev); |
647 | extern void generic_make_request(struct bio *bio); | 647 | extern void generic_make_request(struct bio *bio); |
648 | extern void blk_put_request(struct request *); | 648 | extern void blk_put_request(struct request *); |
649 | extern void __blk_put_request(request_queue_t *, struct request *); | 649 | extern void __blk_put_request(struct request_queue *, struct request *); |
650 | extern void blk_end_sync_rq(struct request *rq, int error); | 650 | extern void blk_end_sync_rq(struct request *rq, int error); |
651 | extern struct request *blk_get_request(request_queue_t *, int, gfp_t); | 651 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); |
652 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); | 652 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); |
653 | extern void blk_requeue_request(request_queue_t *, struct request *); | 653 | extern void blk_requeue_request(struct request_queue *, struct request *); |
654 | extern void blk_plug_device(request_queue_t *); | 654 | extern void blk_plug_device(struct request_queue *); |
655 | extern int blk_remove_plug(request_queue_t *); | 655 | extern int blk_remove_plug(struct request_queue *); |
656 | extern void blk_recount_segments(request_queue_t *, struct bio *); | 656 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
657 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, | 657 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, |
658 | struct gendisk *, unsigned int, void __user *); | 658 | struct gendisk *, unsigned int, void __user *); |
659 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | 659 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, |
@@ -662,14 +662,15 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *, | |||
662 | /* | 662 | /* |
663 | * Temporary export, until SCSI gets fixed up. | 663 | * Temporary export, until SCSI gets fixed up. |
664 | */ | 664 | */ |
665 | extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *); | 665 | extern int ll_back_merge_fn(struct request_queue *, struct request *, |
666 | struct bio *); | ||
666 | 667 | ||
667 | /* | 668 | /* |
668 | * A queue has just exitted congestion. Note this in the global counter of | 669 | * A queue has just exitted congestion. Note this in the global counter of |
669 | * congested queues, and wake up anyone who was waiting for requests to be | 670 | * congested queues, and wake up anyone who was waiting for requests to be |
670 | * put back. | 671 | * put back. |
671 | */ | 672 | */ |
672 | static inline void blk_clear_queue_congested(request_queue_t *q, int rw) | 673 | static inline void blk_clear_queue_congested(struct request_queue *q, int rw) |
673 | { | 674 | { |
674 | clear_bdi_congested(&q->backing_dev_info, rw); | 675 | clear_bdi_congested(&q->backing_dev_info, rw); |
675 | } | 676 | } |
@@ -678,29 +679,29 @@ static inline void blk_clear_queue_congested(request_queue_t *q, int rw) | |||
678 | * A queue has just entered congestion. Flag that in the queue's VM-visible | 679 | * A queue has just entered congestion. Flag that in the queue's VM-visible |
679 | * state flags and increment the global gounter of congested queues. | 680 | * state flags and increment the global gounter of congested queues. |
680 | */ | 681 | */ |
681 | static inline void blk_set_queue_congested(request_queue_t *q, int rw) | 682 | static inline void blk_set_queue_congested(struct request_queue *q, int rw) |
682 | { | 683 | { |
683 | set_bdi_congested(&q->backing_dev_info, rw); | 684 | set_bdi_congested(&q->backing_dev_info, rw); |
684 | } | 685 | } |
685 | 686 | ||
686 | extern void blk_start_queue(request_queue_t *q); | 687 | extern void blk_start_queue(struct request_queue *q); |
687 | extern void blk_stop_queue(request_queue_t *q); | 688 | extern void blk_stop_queue(struct request_queue *q); |
688 | extern void blk_sync_queue(struct request_queue *q); | 689 | extern void blk_sync_queue(struct request_queue *q); |
689 | extern void __blk_stop_queue(request_queue_t *q); | 690 | extern void __blk_stop_queue(struct request_queue *q); |
690 | extern void blk_run_queue(request_queue_t *); | 691 | extern void blk_run_queue(struct request_queue *); |
691 | extern void blk_start_queueing(request_queue_t *); | 692 | extern void blk_start_queueing(struct request_queue *); |
692 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); | 693 | extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long); |
693 | extern int blk_rq_unmap_user(struct bio *); | 694 | extern int blk_rq_unmap_user(struct bio *); |
694 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); | 695 | extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); |
695 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, | 696 | extern int blk_rq_map_user_iov(struct request_queue *, struct request *, |
696 | struct sg_iovec *, int, unsigned int); | 697 | struct sg_iovec *, int, unsigned int); |
697 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, | 698 | extern int blk_execute_rq(struct request_queue *, struct gendisk *, |
698 | struct request *, int); | 699 | struct request *, int); |
699 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, | 700 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
700 | struct request *, int, rq_end_io_fn *); | 701 | struct request *, int, rq_end_io_fn *); |
701 | extern int blk_verify_command(unsigned char *, int); | 702 | extern int blk_verify_command(unsigned char *, int); |
702 | 703 | ||
703 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) | 704 | static inline struct request_queue *bdev_get_queue(struct block_device *bdev) |
704 | { | 705 | { |
705 | return bdev->bd_disk->queue; | 706 | return bdev->bd_disk->queue; |
706 | } | 707 | } |
@@ -749,41 +750,41 @@ static inline void blkdev_dequeue_request(struct request *req) | |||
749 | /* | 750 | /* |
750 | * Access functions for manipulating queue properties | 751 | * Access functions for manipulating queue properties |
751 | */ | 752 | */ |
752 | extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, | 753 | extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn, |
753 | spinlock_t *lock, int node_id); | 754 | spinlock_t *lock, int node_id); |
754 | extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *); | 755 | extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *); |
755 | extern void blk_cleanup_queue(request_queue_t *); | 756 | extern void blk_cleanup_queue(struct request_queue *); |
756 | extern void blk_queue_make_request(request_queue_t *, make_request_fn *); | 757 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); |
757 | extern void blk_queue_bounce_limit(request_queue_t *, u64); | 758 | extern void blk_queue_bounce_limit(struct request_queue *, u64); |
758 | extern void blk_queue_max_sectors(request_queue_t *, unsigned int); | 759 | extern void blk_queue_max_sectors(struct request_queue *, unsigned int); |
759 | extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); | 760 | extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short); |
760 | extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); | 761 | extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); |
761 | extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); | 762 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
762 | extern void blk_queue_hardsect_size(request_queue_t *, unsigned short); | 763 | extern void blk_queue_hardsect_size(struct request_queue *, unsigned short); |
763 | extern void blk_queue_stack_limits(request_queue_t *t, request_queue_t *b); | 764 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); |
764 | extern void blk_queue_segment_boundary(request_queue_t *, unsigned long); | 765 | extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); |
765 | extern void blk_queue_prep_rq(request_queue_t *, prep_rq_fn *pfn); | 766 | extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); |
766 | extern void blk_queue_merge_bvec(request_queue_t *, merge_bvec_fn *); | 767 | extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); |
767 | extern void blk_queue_dma_alignment(request_queue_t *, int); | 768 | extern void blk_queue_dma_alignment(struct request_queue *, int); |
768 | extern void blk_queue_softirq_done(request_queue_t *, softirq_done_fn *); | 769 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); |
769 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 770 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
770 | extern int blk_queue_ordered(request_queue_t *, unsigned, prepare_flush_fn *); | 771 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); |
771 | extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); | 772 | extern void blk_queue_issue_flush_fn(struct request_queue *, issue_flush_fn *); |
772 | extern int blk_do_ordered(request_queue_t *, struct request **); | 773 | extern int blk_do_ordered(struct request_queue *, struct request **); |
773 | extern unsigned blk_ordered_cur_seq(request_queue_t *); | 774 | extern unsigned blk_ordered_cur_seq(struct request_queue *); |
774 | extern unsigned blk_ordered_req_seq(struct request *); | 775 | extern unsigned blk_ordered_req_seq(struct request *); |
775 | extern void blk_ordered_complete_seq(request_queue_t *, unsigned, int); | 776 | extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); |
776 | 777 | ||
777 | extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *); | 778 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
778 | extern void blk_dump_rq_flags(struct request *, char *); | 779 | extern void blk_dump_rq_flags(struct request *, char *); |
779 | extern void generic_unplug_device(request_queue_t *); | 780 | extern void generic_unplug_device(struct request_queue *); |
780 | extern void __generic_unplug_device(request_queue_t *); | 781 | extern void __generic_unplug_device(struct request_queue *); |
781 | extern long nr_blockdev_pages(void); | 782 | extern long nr_blockdev_pages(void); |
782 | 783 | ||
783 | int blk_get_queue(request_queue_t *); | 784 | int blk_get_queue(struct request_queue *); |
784 | request_queue_t *blk_alloc_queue(gfp_t); | 785 | struct request_queue *blk_alloc_queue(gfp_t); |
785 | request_queue_t *blk_alloc_queue_node(gfp_t, int); | 786 | struct request_queue *blk_alloc_queue_node(gfp_t, int); |
786 | extern void blk_put_queue(request_queue_t *); | 787 | extern void blk_put_queue(struct request_queue *); |
787 | 788 | ||
788 | /* | 789 | /* |
789 | * tag stuff | 790 | * tag stuff |
@@ -791,13 +792,13 @@ extern void blk_put_queue(request_queue_t *); | |||
791 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) | 792 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) |
792 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) | 793 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) |
793 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) | 794 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) |
794 | extern int blk_queue_start_tag(request_queue_t *, struct request *); | 795 | extern int blk_queue_start_tag(struct request_queue *, struct request *); |
795 | extern struct request *blk_queue_find_tag(request_queue_t *, int); | 796 | extern struct request *blk_queue_find_tag(struct request_queue *, int); |
796 | extern void blk_queue_end_tag(request_queue_t *, struct request *); | 797 | extern void blk_queue_end_tag(struct request_queue *, struct request *); |
797 | extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *); | 798 | extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *); |
798 | extern void blk_queue_free_tags(request_queue_t *); | 799 | extern void blk_queue_free_tags(struct request_queue *); |
799 | extern int blk_queue_resize_tags(request_queue_t *, int); | 800 | extern int blk_queue_resize_tags(struct request_queue *, int); |
800 | extern void blk_queue_invalidate_tags(request_queue_t *); | 801 | extern void blk_queue_invalidate_tags(struct request_queue *); |
801 | extern struct blk_queue_tag *blk_init_tags(int); | 802 | extern struct blk_queue_tag *blk_init_tags(int); |
802 | extern void blk_free_tags(struct blk_queue_tag *); | 803 | extern void blk_free_tags(struct blk_queue_tag *); |
803 | 804 | ||
@@ -809,7 +810,7 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
809 | return bqt->tag_index[tag]; | 810 | return bqt->tag_index[tag]; |
810 | } | 811 | } |
811 | 812 | ||
812 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); | 813 | extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *); |
813 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 814 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
814 | 815 | ||
815 | #define MAX_PHYS_SEGMENTS 128 | 816 | #define MAX_PHYS_SEGMENTS 128 |
@@ -821,7 +822,7 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *); | |||
821 | 822 | ||
822 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) | 823 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) |
823 | 824 | ||
824 | static inline int queue_hardsect_size(request_queue_t *q) | 825 | static inline int queue_hardsect_size(struct request_queue *q) |
825 | { | 826 | { |
826 | int retval = 512; | 827 | int retval = 512; |
827 | 828 | ||
@@ -836,7 +837,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev) | |||
836 | return queue_hardsect_size(bdev_get_queue(bdev)); | 837 | return queue_hardsect_size(bdev_get_queue(bdev)); |
837 | } | 838 | } |
838 | 839 | ||
839 | static inline int queue_dma_alignment(request_queue_t *q) | 840 | static inline int queue_dma_alignment(struct request_queue *q) |
840 | { | 841 | { |
841 | int retval = 511; | 842 | int retval = 511; |
842 | 843 | ||
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 3680ff9a30ed..90874a5d7d78 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -144,7 +144,7 @@ struct blk_user_trace_setup { | |||
144 | 144 | ||
145 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | 145 | #if defined(CONFIG_BLK_DEV_IO_TRACE) |
146 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | 146 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); |
147 | extern void blk_trace_shutdown(request_queue_t *); | 147 | extern void blk_trace_shutdown(struct request_queue *); |
148 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | 148 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); |
149 | 149 | ||
150 | /** | 150 | /** |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 12a1291855e2..86f9a3a6137d 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -15,8 +15,8 @@ | |||
15 | # define __acquire(x) __context__(x,1) | 15 | # define __acquire(x) __context__(x,1) |
16 | # define __release(x) __context__(x,-1) | 16 | # define __release(x) __context__(x,-1) |
17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
18 | extern void __chk_user_ptr(const void __user *); | 18 | extern void __chk_user_ptr(const volatile void __user *); |
19 | extern void __chk_io_ptr(const void __iomem *); | 19 | extern void __chk_io_ptr(const volatile void __iomem *); |
20 | #else | 20 | #else |
21 | # define __user | 21 | # define __user |
22 | # define __kernel | 22 | # define __kernel |
diff --git a/include/linux/device.h b/include/linux/device.h index d9f0a57f5a2f..3a38d1f70cb7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -551,6 +551,9 @@ extern void put_device(struct device * dev); | |||
551 | /* drivers/base/power/shutdown.c */ | 551 | /* drivers/base/power/shutdown.c */ |
552 | extern void device_shutdown(void); | 552 | extern void device_shutdown(void); |
553 | 553 | ||
554 | /* drivers/base/sys.c */ | ||
555 | extern void sysdev_shutdown(void); | ||
556 | |||
554 | 557 | ||
555 | /* drivers/base/firmware.c */ | 558 | /* drivers/base/firmware.c */ |
556 | extern int __must_check firmware_register(struct kset *); | 559 | extern int __must_check firmware_register(struct kset *); |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index e88fcbc77f8f..e8f42133a616 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -5,29 +5,29 @@ | |||
5 | 5 | ||
6 | #ifdef CONFIG_BLOCK | 6 | #ifdef CONFIG_BLOCK |
7 | 7 | ||
8 | typedef int (elevator_merge_fn) (request_queue_t *, struct request **, | 8 | typedef int (elevator_merge_fn) (struct request_queue *, struct request **, |
9 | struct bio *); | 9 | struct bio *); |
10 | 10 | ||
11 | typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); | 11 | typedef void (elevator_merge_req_fn) (struct request_queue *, struct request *, struct request *); |
12 | 12 | ||
13 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); | 13 | typedef void (elevator_merged_fn) (struct request_queue *, struct request *, int); |
14 | 14 | ||
15 | typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *); | 15 | typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *); |
16 | 16 | ||
17 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); | 17 | typedef int (elevator_dispatch_fn) (struct request_queue *, int); |
18 | 18 | ||
19 | typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); | 19 | typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); |
20 | typedef int (elevator_queue_empty_fn) (request_queue_t *); | 20 | typedef int (elevator_queue_empty_fn) (struct request_queue *); |
21 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); | 21 | typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *); |
22 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); | 22 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); |
23 | typedef int (elevator_may_queue_fn) (request_queue_t *, int); | 23 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); |
24 | 24 | ||
25 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); | 25 | typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t); |
26 | typedef void (elevator_put_req_fn) (struct request *); | 26 | typedef void (elevator_put_req_fn) (struct request *); |
27 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | 27 | typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); |
28 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 28 | typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); |
29 | 29 | ||
30 | typedef void *(elevator_init_fn) (request_queue_t *); | 30 | typedef void *(elevator_init_fn) (struct request_queue *); |
31 | typedef void (elevator_exit_fn) (elevator_t *); | 31 | typedef void (elevator_exit_fn) (elevator_t *); |
32 | 32 | ||
33 | struct elevator_ops | 33 | struct elevator_ops |
@@ -94,27 +94,27 @@ struct elevator_queue | |||
94 | /* | 94 | /* |
95 | * block elevator interface | 95 | * block elevator interface |
96 | */ | 96 | */ |
97 | extern void elv_dispatch_sort(request_queue_t *, struct request *); | 97 | extern void elv_dispatch_sort(struct request_queue *, struct request *); |
98 | extern void elv_dispatch_add_tail(request_queue_t *, struct request *); | 98 | extern void elv_dispatch_add_tail(struct request_queue *, struct request *); |
99 | extern void elv_add_request(request_queue_t *, struct request *, int, int); | 99 | extern void elv_add_request(struct request_queue *, struct request *, int, int); |
100 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); | 100 | extern void __elv_add_request(struct request_queue *, struct request *, int, int); |
101 | extern void elv_insert(request_queue_t *, struct request *, int); | 101 | extern void elv_insert(struct request_queue *, struct request *, int); |
102 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); | 102 | extern int elv_merge(struct request_queue *, struct request **, struct bio *); |
103 | extern void elv_merge_requests(request_queue_t *, struct request *, | 103 | extern void elv_merge_requests(struct request_queue *, struct request *, |
104 | struct request *); | 104 | struct request *); |
105 | extern void elv_merged_request(request_queue_t *, struct request *, int); | 105 | extern void elv_merged_request(struct request_queue *, struct request *, int); |
106 | extern void elv_dequeue_request(request_queue_t *, struct request *); | 106 | extern void elv_dequeue_request(struct request_queue *, struct request *); |
107 | extern void elv_requeue_request(request_queue_t *, struct request *); | 107 | extern void elv_requeue_request(struct request_queue *, struct request *); |
108 | extern int elv_queue_empty(request_queue_t *); | 108 | extern int elv_queue_empty(struct request_queue *); |
109 | extern struct request *elv_next_request(struct request_queue *q); | 109 | extern struct request *elv_next_request(struct request_queue *q); |
110 | extern struct request *elv_former_request(request_queue_t *, struct request *); | 110 | extern struct request *elv_former_request(struct request_queue *, struct request *); |
111 | extern struct request *elv_latter_request(request_queue_t *, struct request *); | 111 | extern struct request *elv_latter_request(struct request_queue *, struct request *); |
112 | extern int elv_register_queue(request_queue_t *q); | 112 | extern int elv_register_queue(struct request_queue *q); |
113 | extern void elv_unregister_queue(request_queue_t *q); | 113 | extern void elv_unregister_queue(struct request_queue *q); |
114 | extern int elv_may_queue(request_queue_t *, int); | 114 | extern int elv_may_queue(struct request_queue *, int); |
115 | extern void elv_completed_request(request_queue_t *, struct request *); | 115 | extern void elv_completed_request(struct request_queue *, struct request *); |
116 | extern int elv_set_request(request_queue_t *, struct request *, gfp_t); | 116 | extern int elv_set_request(struct request_queue *, struct request *, gfp_t); |
117 | extern void elv_put_request(request_queue_t *, struct request *); | 117 | extern void elv_put_request(struct request_queue *, struct request *); |
118 | 118 | ||
119 | /* | 119 | /* |
120 | * io scheduler registration | 120 | * io scheduler registration |
@@ -125,18 +125,18 @@ extern void elv_unregister(struct elevator_type *); | |||
125 | /* | 125 | /* |
126 | * io scheduler sysfs switching | 126 | * io scheduler sysfs switching |
127 | */ | 127 | */ |
128 | extern ssize_t elv_iosched_show(request_queue_t *, char *); | 128 | extern ssize_t elv_iosched_show(struct request_queue *, char *); |
129 | extern ssize_t elv_iosched_store(request_queue_t *, const char *, size_t); | 129 | extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t); |
130 | 130 | ||
131 | extern int elevator_init(request_queue_t *, char *); | 131 | extern int elevator_init(struct request_queue *, char *); |
132 | extern void elevator_exit(elevator_t *); | 132 | extern void elevator_exit(elevator_t *); |
133 | extern int elv_rq_merge_ok(struct request *, struct bio *); | 133 | extern int elv_rq_merge_ok(struct request *, struct bio *); |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Helper functions. | 136 | * Helper functions. |
137 | */ | 137 | */ |
138 | extern struct request *elv_rb_former_request(request_queue_t *, struct request *); | 138 | extern struct request *elv_rb_former_request(struct request_queue *, struct request *); |
139 | extern struct request *elv_rb_latter_request(request_queue_t *, struct request *); | 139 | extern struct request *elv_rb_latter_request(struct request_queue *, struct request *); |
140 | 140 | ||
141 | /* | 141 | /* |
142 | * rb support functions. | 142 | * rb support functions. |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index c8e02de737f6..efded00ad08c 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | 7 | ||
8 | #ifdef CONFIG_PM | 8 | #ifdef CONFIG_PM_SLEEP |
9 | /* | 9 | /* |
10 | * Check if a process has been frozen | 10 | * Check if a process has been frozen |
11 | */ | 11 | */ |
@@ -126,7 +126,7 @@ static inline void set_freezable(void) | |||
126 | current->flags &= ~PF_NOFREEZE; | 126 | current->flags &= ~PF_NOFREEZE; |
127 | } | 127 | } |
128 | 128 | ||
129 | #else | 129 | #else /* !CONFIG_PM_SLEEP */ |
130 | static inline int frozen(struct task_struct *p) { return 0; } | 130 | static inline int frozen(struct task_struct *p) { return 0; } |
131 | static inline int freezing(struct task_struct *p) { return 0; } | 131 | static inline int freezing(struct task_struct *p) { return 0; } |
132 | static inline void set_freeze_flag(struct task_struct *p) {} | 132 | static inline void set_freeze_flag(struct task_struct *p) {} |
@@ -143,6 +143,6 @@ static inline void freezer_do_not_count(void) {} | |||
143 | static inline void freezer_count(void) {} | 143 | static inline void freezer_count(void) {} |
144 | static inline int freezer_should_skip(struct task_struct *p) { return 0; } | 144 | static inline int freezer_should_skip(struct task_struct *p) { return 0; } |
145 | static inline void set_freezable(void) {} | 145 | static inline void set_freezable(void) {} |
146 | #endif | 146 | #endif /* !CONFIG_PM_SLEEP */ |
147 | 147 | ||
148 | #endif /* FREEZER_H_INCLUDED */ | 148 | #endif /* FREEZER_H_INCLUDED */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 49b7053043ad..e6a71c82d204 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_HUGETLB_H | 1 | #ifndef _LINUX_HUGETLB_H |
2 | #define _LINUX_HUGETLB_H | 2 | #define _LINUX_HUGETLB_H |
3 | 3 | ||
4 | #include <linux/fs.h> | ||
5 | |||
4 | #ifdef CONFIG_HUGETLB_PAGE | 6 | #ifdef CONFIG_HUGETLB_PAGE |
5 | 7 | ||
6 | #include <linux/mempolicy.h> | 8 | #include <linux/mempolicy.h> |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 5f5daad8bc54..d71d0121b7f9 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -555,7 +555,7 @@ typedef struct ide_drive_s { | |||
555 | char name[4]; /* drive name, such as "hda" */ | 555 | char name[4]; /* drive name, such as "hda" */ |
556 | char driver_req[10]; /* requests specific driver */ | 556 | char driver_req[10]; /* requests specific driver */ |
557 | 557 | ||
558 | request_queue_t *queue; /* request queue */ | 558 | struct request_queue *queue; /* request queue */ |
559 | 559 | ||
560 | struct request *rq; /* current request */ | 560 | struct request *rq; /* current request */ |
561 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | 561 | struct ide_drive_s *next; /* circular list of hwgroup drives */ |
@@ -1206,7 +1206,7 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); | |||
1206 | extern int ide_spin_wait_hwgroup(ide_drive_t *); | 1206 | extern int ide_spin_wait_hwgroup(ide_drive_t *); |
1207 | extern void ide_timer_expiry(unsigned long); | 1207 | extern void ide_timer_expiry(unsigned long); |
1208 | extern irqreturn_t ide_intr(int irq, void *dev_id); | 1208 | extern irqreturn_t ide_intr(int irq, void *dev_id); |
1209 | extern void do_ide_request(request_queue_t *); | 1209 | extern void do_ide_request(struct request_queue *); |
1210 | 1210 | ||
1211 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1211 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
1212 | 1212 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 0a3c2ebf2008..5523f19d88d2 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/irqflags.h> | 13 | #include <linux/irqflags.h> |
14 | #include <linux/bottom_half.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
17 | #include <asm/ptrace.h> | 15 | #include <asm/ptrace.h> |
18 | #include <asm/system.h> | 16 | #include <asm/system.h> |
@@ -97,6 +95,8 @@ extern int __must_check request_irq(unsigned int, irq_handler_t handler, | |||
97 | unsigned long, const char *, void *); | 95 | unsigned long, const char *, void *); |
98 | extern void free_irq(unsigned int, void *); | 96 | extern void free_irq(unsigned int, void *); |
99 | 97 | ||
98 | struct device; | ||
99 | |||
100 | extern int __must_check devm_request_irq(struct device *dev, unsigned int irq, | 100 | extern int __must_check devm_request_irq(struct device *dev, unsigned int irq, |
101 | irq_handler_t handler, unsigned long irqflags, | 101 | irq_handler_t handler, unsigned long irqflags, |
102 | const char *devname, void *dev_id); | 102 | const char *devname, void *dev_id); |
diff --git a/include/linux/lguest.h b/include/linux/lguest.h index 500aace21ca7..157ad64aa7ce 100644 --- a/include/linux/lguest.h +++ b/include/linux/lguest.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #define LHCALL_TS 8 | 17 | #define LHCALL_TS 8 |
18 | #define LHCALL_SET_CLOCKEVENT 9 | 18 | #define LHCALL_SET_CLOCKEVENT 9 |
19 | #define LHCALL_HALT 10 | 19 | #define LHCALL_HALT 10 |
20 | #define LHCALL_GET_WALLCLOCK 11 | ||
21 | #define LHCALL_BIND_DMA 12 | 20 | #define LHCALL_BIND_DMA 12 |
22 | #define LHCALL_SEND_DMA 13 | 21 | #define LHCALL_SEND_DMA 13 |
23 | #define LHCALL_SET_PTE 14 | 22 | #define LHCALL_SET_PTE 14 |
@@ -27,18 +26,38 @@ | |||
27 | #define LG_CLOCK_MIN_DELTA 100UL | 26 | #define LG_CLOCK_MIN_DELTA 100UL |
28 | #define LG_CLOCK_MAX_DELTA ULONG_MAX | 27 | #define LG_CLOCK_MAX_DELTA ULONG_MAX |
29 | 28 | ||
29 | /*G:031 First, how does our Guest contact the Host to ask for privileged | ||
30 | * operations? There are two ways: the direct way is to make a "hypercall", | ||
31 | * to make requests of the Host Itself. | ||
32 | * | ||
33 | * Our hypercall mechanism uses the highest unused trap code (traps 32 and | ||
34 | * above are used by real hardware interrupts). Seventeen hypercalls are | ||
35 | * available: the hypercall number is put in the %eax register, and the | ||
36 | * arguments (when required) are placed in %edx, %ebx and %ecx. If a return | ||
37 | * value makes sense, it's returned in %eax. | ||
38 | * | ||
39 | * Grossly invalid calls result in Sudden Death at the hands of the vengeful | ||
40 | * Host, rather than returning failure. This reflects Winston Churchill's | ||
41 | * definition of a gentleman: "someone who is only rude intentionally". */ | ||
30 | #define LGUEST_TRAP_ENTRY 0x1F | 42 | #define LGUEST_TRAP_ENTRY 0x1F |
31 | 43 | ||
32 | static inline unsigned long | 44 | static inline unsigned long |
33 | hcall(unsigned long call, | 45 | hcall(unsigned long call, |
34 | unsigned long arg1, unsigned long arg2, unsigned long arg3) | 46 | unsigned long arg1, unsigned long arg2, unsigned long arg3) |
35 | { | 47 | { |
48 | /* "int" is the Intel instruction to trigger a trap. */ | ||
36 | asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY) | 49 | asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY) |
50 | /* The call is in %eax (aka "a"), and can be replaced */ | ||
37 | : "=a"(call) | 51 | : "=a"(call) |
52 | /* The other arguments are in %eax, %edx, %ebx & %ecx */ | ||
38 | : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3) | 53 | : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3) |
54 | /* "memory" means this might write somewhere in memory. | ||
55 | * This isn't true for all calls, but it's safe to tell | ||
56 | * gcc that it might happen so it doesn't get clever. */ | ||
39 | : "memory"); | 57 | : "memory"); |
40 | return call; | 58 | return call; |
41 | } | 59 | } |
60 | /*:*/ | ||
42 | 61 | ||
43 | void async_hcall(unsigned long call, | 62 | void async_hcall(unsigned long call, |
44 | unsigned long arg1, unsigned long arg2, unsigned long arg3); | 63 | unsigned long arg1, unsigned long arg2, unsigned long arg3); |
@@ -52,31 +71,43 @@ struct hcall_ring | |||
52 | u32 eax, edx, ebx, ecx; | 71 | u32 eax, edx, ebx, ecx; |
53 | }; | 72 | }; |
54 | 73 | ||
55 | /* All the good stuff happens here: guest registers it with LGUEST_INIT */ | 74 | /*G:032 The second method of communicating with the Host is to via "struct |
75 | * lguest_data". The Guest's very first hypercall is to tell the Host where | ||
76 | * this is, and then the Guest and Host both publish information in it. :*/ | ||
56 | struct lguest_data | 77 | struct lguest_data |
57 | { | 78 | { |
58 | /* Fields which change during running: */ | 79 | /* 512 == enabled (same as eflags in normal hardware). The Guest |
59 | /* 512 == enabled (same as eflags) */ | 80 | * changes interrupts so often that a hypercall is too slow. */ |
60 | unsigned int irq_enabled; | 81 | unsigned int irq_enabled; |
61 | /* Interrupts blocked by guest. */ | 82 | /* Fine-grained interrupt disabling by the Guest */ |
62 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); | 83 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); |
63 | 84 | ||
64 | /* Virtual address of page fault. */ | 85 | /* The Host writes the virtual address of the last page fault here, |
86 | * which saves the Guest a hypercall. CR2 is the native register where | ||
87 | * this address would normally be found. */ | ||
65 | unsigned long cr2; | 88 | unsigned long cr2; |
66 | 89 | ||
67 | /* Async hypercall ring. 0xFF == done, 0 == pending. */ | 90 | /* Wallclock time set by the Host. */ |
91 | struct timespec time; | ||
92 | |||
93 | /* Async hypercall ring. Instead of directly making hypercalls, we can | ||
94 | * place them in here for processing the next time the Host wants. | ||
95 | * This batching can be quite efficient. */ | ||
96 | |||
97 | /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ | ||
68 | u8 hcall_status[LHCALL_RING_SIZE]; | 98 | u8 hcall_status[LHCALL_RING_SIZE]; |
99 | /* The actual registers for the hypercalls. */ | ||
69 | struct hcall_ring hcalls[LHCALL_RING_SIZE]; | 100 | struct hcall_ring hcalls[LHCALL_RING_SIZE]; |
70 | 101 | ||
71 | /* Fields initialized by the hypervisor at boot: */ | 102 | /* Fields initialized by the Host at boot: */ |
72 | /* Memory not to try to access */ | 103 | /* Memory not to try to access */ |
73 | unsigned long reserve_mem; | 104 | unsigned long reserve_mem; |
74 | /* ID of this guest (used by network driver to set ethernet address) */ | 105 | /* ID of this Guest (used by network driver to set ethernet address) */ |
75 | u16 guestid; | 106 | u16 guestid; |
76 | /* KHz for the TSC clock. */ | 107 | /* KHz for the TSC clock. */ |
77 | u32 tsc_khz; | 108 | u32 tsc_khz; |
78 | 109 | ||
79 | /* Fields initialized by the guest at boot: */ | 110 | /* Fields initialized by the Guest at boot: */ |
80 | /* Instruction range to suppress interrupts even if enabled */ | 111 | /* Instruction range to suppress interrupts even if enabled */ |
81 | unsigned long noirq_start, noirq_end; | 112 | unsigned long noirq_start, noirq_end; |
82 | }; | 113 | }; |
diff --git a/include/linux/lguest_bus.h b/include/linux/lguest_bus.h index c9b4e05fee49..d27853ddc644 100644 --- a/include/linux/lguest_bus.h +++ b/include/linux/lguest_bus.h | |||
@@ -15,11 +15,14 @@ struct lguest_device { | |||
15 | void *private; | 15 | void *private; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | /* By convention, each device can use irq index+1 if it wants to. */ | 18 | /*D:380 Since interrupt numbers are arbitrary, we use a convention: each device |
19 | * can use the interrupt number corresponding to its index. The +1 is because | ||
20 | * interrupt 0 is not usable (it's actually the timer interrupt). */ | ||
19 | static inline int lgdev_irq(const struct lguest_device *dev) | 21 | static inline int lgdev_irq(const struct lguest_device *dev) |
20 | { | 22 | { |
21 | return dev->index + 1; | 23 | return dev->index + 1; |
22 | } | 24 | } |
25 | /*:*/ | ||
23 | 26 | ||
24 | /* dma args must not be vmalloced! */ | 27 | /* dma args must not be vmalloced! */ |
25 | void lguest_send_dma(unsigned long key, struct lguest_dma *dma); | 28 | void lguest_send_dma(unsigned long key, struct lguest_dma *dma); |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index 0ba414a40c80..641670579446 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
@@ -9,14 +9,45 @@ | |||
9 | /* How many devices? Assume each one wants up to two dma arrays per device. */ | 9 | /* How many devices? Assume each one wants up to two dma arrays per device. */ |
10 | #define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2) | 10 | #define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2) |
11 | 11 | ||
12 | /*D:200 | ||
13 | * Lguest I/O | ||
14 | * | ||
15 | * The lguest I/O mechanism is the only way Guests can talk to devices. There | ||
16 | * are two hypercalls involved: SEND_DMA for output and BIND_DMA for input. In | ||
17 | * each case, "struct lguest_dma" describes the buffer: this contains 16 | ||
18 | * addr/len pairs, and if there are fewer buffer elements the len array is | ||
19 | * terminated with a 0. | ||
20 | * | ||
21 | * I/O is organized by keys: BIND_DMA attaches buffers to a particular key, and | ||
22 | * SEND_DMA transfers to buffers bound to particular key. By convention, keys | ||
23 | * correspond to a physical address within the device's page. This means that | ||
24 | * devices will never accidentally end up with the same keys, and allows the | ||
25 | * Host use The Futex Trick (as we'll see later in our journey). | ||
26 | * | ||
27 | * SEND_DMA simply indicates a key to send to, and the physical address of the | ||
28 | * "struct lguest_dma" to send. The Host will write the number of bytes | ||
29 | * transferred into the "struct lguest_dma"'s used_len member. | ||
30 | * | ||
31 | * BIND_DMA indicates a key to bind to, a pointer to an array of "struct | ||
32 | * lguest_dma"s ready for receiving, the size of that array, and an interrupt | ||
33 | * to trigger when data is received. The Host will only allow transfers into | ||
34 | * buffers with a used_len of zero: it then sets used_len to the number of | ||
35 | * bytes transferred and triggers the interrupt for the Guest to process the | ||
36 | * new input. */ | ||
12 | struct lguest_dma | 37 | struct lguest_dma |
13 | { | 38 | { |
14 | /* 0 if free to be used, filled by hypervisor. */ | 39 | /* 0 if free to be used, filled by the Host. */ |
15 | u32 used_len; | 40 | u32 used_len; |
16 | unsigned long addr[LGUEST_MAX_DMA_SECTIONS]; | 41 | unsigned long addr[LGUEST_MAX_DMA_SECTIONS]; |
17 | u16 len[LGUEST_MAX_DMA_SECTIONS]; | 42 | u16 len[LGUEST_MAX_DMA_SECTIONS]; |
18 | }; | 43 | }; |
44 | /*:*/ | ||
19 | 45 | ||
46 | /*D:460 This is the layout of a block device memory page. The Launcher sets up | ||
47 | * the num_sectors initially to tell the Guest the size of the disk. The Guest | ||
48 | * puts the type, sector and length of the request in the first three fields, | ||
49 | * then DMAs to the Host. The Host processes the request, sets up the result, | ||
50 | * then DMAs back to the Guest. */ | ||
20 | struct lguest_block_page | 51 | struct lguest_block_page |
21 | { | 52 | { |
22 | /* 0 is a read, 1 is a write. */ | 53 | /* 0 is a read, 1 is a write. */ |
@@ -28,27 +59,47 @@ struct lguest_block_page | |||
28 | u32 num_sectors; /* Disk length = num_sectors * 512 */ | 59 | u32 num_sectors; /* Disk length = num_sectors * 512 */ |
29 | }; | 60 | }; |
30 | 61 | ||
31 | /* There is a shared page of these. */ | 62 | /*D:520 The network device is basically a memory page where all the Guests on |
63 | * the network publish their MAC (ethernet) addresses: it's an array of "struct | ||
64 | * lguest_net": */ | ||
32 | struct lguest_net | 65 | struct lguest_net |
33 | { | 66 | { |
34 | /* Simply the mac address (with multicast bit meaning promisc). */ | 67 | /* Simply the mac address (with multicast bit meaning promisc). */ |
35 | unsigned char mac[6]; | 68 | unsigned char mac[6]; |
36 | }; | 69 | }; |
70 | /*:*/ | ||
37 | 71 | ||
38 | /* Where the Host expects the Guest to SEND_DMA console output to. */ | 72 | /* Where the Host expects the Guest to SEND_DMA console output to. */ |
39 | #define LGUEST_CONSOLE_DMA_KEY 0 | 73 | #define LGUEST_CONSOLE_DMA_KEY 0 |
40 | 74 | ||
41 | /* We have a page of these descriptors in the lguest_device page. */ | 75 | /*D:010 |
76 | * Drivers | ||
77 | * | ||
78 | * The Guest needs devices to do anything useful. Since we don't let it touch | ||
79 | * real devices (think of the damage it could do!) we provide virtual devices. | ||
80 | * We could emulate a PCI bus with various devices on it, but that is a fairly | ||
81 | * complex burden for the Host and suboptimal for the Guest, so we have our own | ||
82 | * "lguest" bus and simple drivers. | ||
83 | * | ||
84 | * Devices are described by an array of LGUEST_MAX_DEVICES of these structs, | ||
85 | * placed by the Launcher just above the top of physical memory: | ||
86 | */ | ||
42 | struct lguest_device_desc { | 87 | struct lguest_device_desc { |
88 | /* The device type: console, network, disk etc. */ | ||
43 | u16 type; | 89 | u16 type; |
44 | #define LGUEST_DEVICE_T_CONSOLE 1 | 90 | #define LGUEST_DEVICE_T_CONSOLE 1 |
45 | #define LGUEST_DEVICE_T_NET 2 | 91 | #define LGUEST_DEVICE_T_NET 2 |
46 | #define LGUEST_DEVICE_T_BLOCK 3 | 92 | #define LGUEST_DEVICE_T_BLOCK 3 |
47 | 93 | ||
94 | /* The specific features of this device: these depends on device type | ||
95 | * except for LGUEST_DEVICE_F_RANDOMNESS. */ | ||
48 | u16 features; | 96 | u16 features; |
49 | #define LGUEST_NET_F_NOCSUM 0x4000 /* Don't bother checksumming */ | 97 | #define LGUEST_NET_F_NOCSUM 0x4000 /* Don't bother checksumming */ |
50 | #define LGUEST_DEVICE_F_RANDOMNESS 0x8000 /* IRQ is fairly random */ | 98 | #define LGUEST_DEVICE_F_RANDOMNESS 0x8000 /* IRQ is fairly random */ |
51 | 99 | ||
100 | /* This is how the Guest reports status of the device: the Host can set | ||
101 | * LGUEST_DEVICE_S_REMOVED to indicate removal, but the rest are only | ||
102 | * ever manipulated by the Guest, and only ever set. */ | ||
52 | u16 status; | 103 | u16 status; |
53 | /* 256 and above are device specific. */ | 104 | /* 256 and above are device specific. */ |
54 | #define LGUEST_DEVICE_S_ACKNOWLEDGE 1 /* We have seen device. */ | 105 | #define LGUEST_DEVICE_S_ACKNOWLEDGE 1 /* We have seen device. */ |
@@ -58,9 +109,12 @@ struct lguest_device_desc { | |||
58 | #define LGUEST_DEVICE_S_REMOVED_ACK 16 /* Driver has been told. */ | 109 | #define LGUEST_DEVICE_S_REMOVED_ACK 16 /* Driver has been told. */ |
59 | #define LGUEST_DEVICE_S_FAILED 128 /* Something actually failed */ | 110 | #define LGUEST_DEVICE_S_FAILED 128 /* Something actually failed */ |
60 | 111 | ||
112 | /* Each device exists somewhere in Guest physical memory, over some | ||
113 | * number of pages. */ | ||
61 | u16 num_pages; | 114 | u16 num_pages; |
62 | u32 pfn; | 115 | u32 pfn; |
63 | }; | 116 | }; |
117 | /*:*/ | ||
64 | 118 | ||
65 | /* Write command first word is a request. */ | 119 | /* Write command first word is a request. */ |
66 | enum lguest_req | 120 | enum lguest_req |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 9aa6c10f7bb1..41978a557318 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -216,6 +216,8 @@ enum { | |||
216 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ | 216 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ |
217 | ATA_HOST_STARTED = (1 << 1), /* Host started */ | 217 | ATA_HOST_STARTED = (1 << 1), /* Host started */ |
218 | 218 | ||
219 | /* bits 24:31 of host->flags are reserved for LLD specific flags */ | ||
220 | |||
219 | /* various lengths of time */ | 221 | /* various lengths of time */ |
220 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 222 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ |
221 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ | 223 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ |
diff --git a/include/linux/loop.h b/include/linux/loop.h index 0b99b31f017b..26a0a103898f 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -63,7 +63,7 @@ struct loop_device { | |||
63 | struct task_struct *lo_thread; | 63 | struct task_struct *lo_thread; |
64 | wait_queue_head_t lo_event; | 64 | wait_queue_head_t lo_event; |
65 | 65 | ||
66 | request_queue_t *lo_queue; | 66 | struct request_queue *lo_queue; |
67 | struct gendisk *lo_disk; | 67 | struct gendisk *lo_disk; |
68 | struct list_head lo_list; | 68 | struct list_head lo_list; |
69 | }; | 69 | }; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index c456c3a1c28e..655094dc9440 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/mmzone.h> | 10 | #include <linux/mmzone.h> |
11 | #include <linux/rbtree.h> | 11 | #include <linux/rbtree.h> |
12 | #include <linux/prio_tree.h> | 12 | #include <linux/prio_tree.h> |
13 | #include <linux/fs.h> | ||
14 | #include <linux/mutex.h> | 13 | #include <linux/mutex.h> |
15 | #include <linux/debug_locks.h> | 14 | #include <linux/debug_locks.h> |
16 | #include <linux/backing-dev.h> | 15 | #include <linux/backing-dev.h> |
@@ -18,7 +17,9 @@ | |||
18 | 17 | ||
19 | struct mempolicy; | 18 | struct mempolicy; |
20 | struct anon_vma; | 19 | struct anon_vma; |
20 | struct file_ra_state; | ||
21 | struct user_struct; | 21 | struct user_struct; |
22 | struct writeback_control; | ||
22 | 23 | ||
23 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ | 24 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ |
24 | extern unsigned long max_mapnr; | 25 | extern unsigned long max_mapnr; |
@@ -861,38 +862,7 @@ struct shrinker { | |||
861 | extern void register_shrinker(struct shrinker *); | 862 | extern void register_shrinker(struct shrinker *); |
862 | extern void unregister_shrinker(struct shrinker *); | 863 | extern void unregister_shrinker(struct shrinker *); |
863 | 864 | ||
864 | /* | 865 | int vma_wants_writenotify(struct vm_area_struct *vma); |
865 | * Some shared mappigns will want the pages marked read-only | ||
866 | * to track write events. If so, we'll downgrade vm_page_prot | ||
867 | * to the private version (using protection_map[] without the | ||
868 | * VM_SHARED bit). | ||
869 | */ | ||
870 | static inline int vma_wants_writenotify(struct vm_area_struct *vma) | ||
871 | { | ||
872 | unsigned int vm_flags = vma->vm_flags; | ||
873 | |||
874 | /* If it was private or non-writable, the write bit is already clear */ | ||
875 | if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) | ||
876 | return 0; | ||
877 | |||
878 | /* The backer wishes to know when pages are first written to? */ | ||
879 | if (vma->vm_ops && vma->vm_ops->page_mkwrite) | ||
880 | return 1; | ||
881 | |||
882 | /* The open routine did something to the protections already? */ | ||
883 | if (pgprot_val(vma->vm_page_prot) != | ||
884 | pgprot_val(protection_map[vm_flags & | ||
885 | (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)])) | ||
886 | return 0; | ||
887 | |||
888 | /* Specialty mapping? */ | ||
889 | if (vm_flags & (VM_PFNMAP|VM_INSERTPAGE)) | ||
890 | return 0; | ||
891 | |||
892 | /* Can the mapping track the dirty pages? */ | ||
893 | return vma->vm_file && vma->vm_file->f_mapping && | ||
894 | mapping_cap_account_dirty(vma->vm_file->f_mapping); | ||
895 | } | ||
896 | 866 | ||
897 | extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); | 867 | extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); |
898 | 868 | ||
@@ -1246,7 +1216,7 @@ void drop_slab(void); | |||
1246 | extern int randomize_va_space; | 1216 | extern int randomize_va_space; |
1247 | #endif | 1217 | #endif |
1248 | 1218 | ||
1249 | __attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma); | 1219 | const char * arch_vma_name(struct vm_area_struct *vma); |
1250 | 1220 | ||
1251 | #endif /* __KERNEL__ */ | 1221 | #endif /* __KERNEL__ */ |
1252 | #endif /* _LINUX_MM_H */ | 1222 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 04bbe12fae8d..63a80ea61124 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -99,7 +99,7 @@ struct mmc_request { | |||
99 | struct mmc_host; | 99 | struct mmc_host; |
100 | struct mmc_card; | 100 | struct mmc_card; |
101 | 101 | ||
102 | extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 102 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
103 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 103 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
104 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, | 104 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, |
105 | struct mmc_command *, int); | 105 | struct mmc_command *, int); |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index af04a555b52c..2ada8ee316b3 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -159,6 +159,12 @@ struct ap_device_id { | |||
159 | 159 | ||
160 | #define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 | 160 | #define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 |
161 | 161 | ||
162 | #define ACPI_ID_LEN 9 | ||
163 | |||
164 | struct acpi_device_id { | ||
165 | __u8 id[ACPI_ID_LEN]; | ||
166 | kernel_ulong_t driver_data; | ||
167 | }; | ||
162 | 168 | ||
163 | #define PNP_ID_LEN 8 | 169 | #define PNP_ID_LEN 8 |
164 | #define PNP_MAX_DEVICES 8 | 170 | #define PNP_MAX_DEVICES 8 |
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h index 90ae8b474cb8..37e933c9987d 100644 --- a/include/linux/netfilter/xt_connlimit.h +++ b/include/linux/netfilter/xt_connlimit.h | |||
@@ -5,8 +5,8 @@ struct xt_connlimit_data; | |||
5 | 5 | ||
6 | struct xt_connlimit_info { | 6 | struct xt_connlimit_info { |
7 | union { | 7 | union { |
8 | u_int32_t v4_mask; | 8 | __be32 v4_mask; |
9 | u_int32_t v6_mask[4]; | 9 | __be32 v6_mask[4]; |
10 | }; | 10 | }; |
11 | unsigned int limit, inverse; | 11 | unsigned int limit, inverse; |
12 | 12 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 5e84f2e8d54c..d8f8a3a96644 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -534,6 +534,7 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val | |||
534 | 534 | ||
535 | int __must_check pci_enable_device(struct pci_dev *dev); | 535 | int __must_check pci_enable_device(struct pci_dev *dev); |
536 | int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); | 536 | int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); |
537 | int __must_check __pci_reenable_device(struct pci_dev *); | ||
537 | int __must_check pcim_enable_device(struct pci_dev *pdev); | 538 | int __must_check pcim_enable_device(struct pci_dev *pdev); |
538 | void pcim_pin_device(struct pci_dev *pdev); | 539 | void pcim_pin_device(struct pci_dev *pdev); |
539 | 540 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index cbabb9c675c9..69d68117bdac 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1225,6 +1225,10 @@ | |||
1225 | #define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D | 1225 | #define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D |
1226 | #define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E | 1226 | #define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E |
1227 | #define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F | 1227 | #define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F |
1228 | #define PCI_DEVICE_ID_NVIDIA_NVENET_28 0x07DC | ||
1229 | #define PCI_DEVICE_ID_NVIDIA_NVENET_29 0x07DD | ||
1230 | #define PCI_DEVICE_ID_NVIDIA_NVENET_30 0x07DE | ||
1231 | #define PCI_DEVICE_ID_NVIDIA_NVENET_31 0x07DF | ||
1228 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 | 1232 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 |
1229 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C | 1233 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C |
1230 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 | 1234 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 |
@@ -1972,6 +1976,8 @@ | |||
1972 | #define PCI_VENDOR_ID_ENE 0x1524 | 1976 | #define PCI_VENDOR_ID_ENE 0x1524 |
1973 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 | 1977 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 |
1974 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 | 1978 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 |
1979 | #define PCI_DEVICE_ID_ENE_CB714_SD 0x0750 | ||
1980 | #define PCI_DEVICE_ID_ENE_CB714_SD_2 0x0751 | ||
1975 | #define PCI_DEVICE_ID_ENE_1211 0x1211 | 1981 | #define PCI_DEVICE_ID_ENE_1211 0x1211 |
1976 | #define PCI_DEVICE_ID_ENE_1225 0x1225 | 1982 | #define PCI_DEVICE_ID_ENE_1225 0x1225 |
1977 | #define PCI_DEVICE_ID_ENE_1410 0x1410 | 1983 | #define PCI_DEVICE_ID_ENE_1410 0x1410 |
@@ -2075,6 +2081,23 @@ | |||
2075 | #define PCI_VENDOR_ID_TDI 0x192E | 2081 | #define PCI_VENDOR_ID_TDI 0x192E |
2076 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2082 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
2077 | 2083 | ||
2084 | #define PCI_VENDOR_ID_FREESCALE 0x1957 | ||
2085 | #define PCI_DEVICE_ID_MPC8548E 0x0012 | ||
2086 | #define PCI_DEVICE_ID_MPC8548 0x0013 | ||
2087 | #define PCI_DEVICE_ID_MPC8543E 0x0014 | ||
2088 | #define PCI_DEVICE_ID_MPC8543 0x0015 | ||
2089 | #define PCI_DEVICE_ID_MPC8547E 0x0018 | ||
2090 | #define PCI_DEVICE_ID_MPC8545E 0x0019 | ||
2091 | #define PCI_DEVICE_ID_MPC8545 0x001a | ||
2092 | #define PCI_DEVICE_ID_MPC8568E 0x0020 | ||
2093 | #define PCI_DEVICE_ID_MPC8568 0x0021 | ||
2094 | #define PCI_DEVICE_ID_MPC8567E 0x0022 | ||
2095 | #define PCI_DEVICE_ID_MPC8567 0x0023 | ||
2096 | #define PCI_DEVICE_ID_MPC8544E 0x0030 | ||
2097 | #define PCI_DEVICE_ID_MPC8544 0x0031 | ||
2098 | #define PCI_DEVICE_ID_MPC8641 0x7010 | ||
2099 | #define PCI_DEVICE_ID_MPC8641D 0x7011 | ||
2100 | |||
2078 | #define PCI_VENDOR_ID_PASEMI 0x1959 | 2101 | #define PCI_VENDOR_ID_PASEMI 0x1959 |
2079 | 2102 | ||
2080 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 | 2103 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 |
diff --git a/include/linux/pm.h b/include/linux/pm.h index ad3cc2eb0d34..e52f6f83c061 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -165,6 +165,7 @@ struct pm_ops { | |||
165 | int (*finish)(suspend_state_t state); | 165 | int (*finish)(suspend_state_t state); |
166 | }; | 166 | }; |
167 | 167 | ||
168 | #ifdef CONFIG_SUSPEND | ||
168 | extern struct pm_ops *pm_ops; | 169 | extern struct pm_ops *pm_ops; |
169 | 170 | ||
170 | /** | 171 | /** |
@@ -193,6 +194,12 @@ extern void arch_suspend_disable_irqs(void); | |||
193 | extern void arch_suspend_enable_irqs(void); | 194 | extern void arch_suspend_enable_irqs(void); |
194 | 195 | ||
195 | extern int pm_suspend(suspend_state_t state); | 196 | extern int pm_suspend(suspend_state_t state); |
197 | #else /* !CONFIG_SUSPEND */ | ||
198 | #define suspend_valid_only_mem NULL | ||
199 | |||
200 | static inline void pm_set_ops(struct pm_ops *pm_ops) {} | ||
201 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | ||
202 | #endif /* !CONFIG_SUSPEND */ | ||
196 | 203 | ||
197 | /* | 204 | /* |
198 | * Device power management | 205 | * Device power management |
@@ -266,7 +273,7 @@ typedef struct pm_message { | |||
266 | struct dev_pm_info { | 273 | struct dev_pm_info { |
267 | pm_message_t power_state; | 274 | pm_message_t power_state; |
268 | unsigned can_wakeup:1; | 275 | unsigned can_wakeup:1; |
269 | #ifdef CONFIG_PM | 276 | #ifdef CONFIG_PM_SLEEP |
270 | unsigned should_wakeup:1; | 277 | unsigned should_wakeup:1; |
271 | struct list_head entry; | 278 | struct list_head entry; |
272 | #endif | 279 | #endif |
@@ -276,7 +283,7 @@ extern int device_power_down(pm_message_t state); | |||
276 | extern void device_power_up(void); | 283 | extern void device_power_up(void); |
277 | extern void device_resume(void); | 284 | extern void device_resume(void); |
278 | 285 | ||
279 | #ifdef CONFIG_PM | 286 | #ifdef CONFIG_PM_SLEEP |
280 | extern int device_suspend(pm_message_t state); | 287 | extern int device_suspend(pm_message_t state); |
281 | extern int device_prepare_suspend(pm_message_t state); | 288 | extern int device_prepare_suspend(pm_message_t state); |
282 | 289 | ||
@@ -306,7 +313,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | |||
306 | return 0; | 313 | return 0; |
307 | } | 314 | } |
308 | 315 | ||
309 | #else /* !CONFIG_PM */ | 316 | #else /* !CONFIG_PM_SLEEP */ |
310 | 317 | ||
311 | static inline int device_suspend(pm_message_t state) | 318 | static inline int device_suspend(pm_message_t state) |
312 | { | 319 | { |
@@ -323,7 +330,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | |||
323 | return 0; | 330 | return 0; |
324 | } | 331 | } |
325 | 332 | ||
326 | #endif | 333 | #endif /* !CONFIG_PM_SLEEP */ |
327 | 334 | ||
328 | /* changes to device_may_wakeup take effect on the next pm state change. | 335 | /* changes to device_may_wakeup take effect on the next pm state change. |
329 | * by default, devices should wakeup if they can. | 336 | * by default, devices should wakeup if they can. |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 2a1897e6f937..16b46aace349 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -1,7 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Linux Plug and Play Support | 2 | * Linux Plug and Play Support |
3 | * Copyright by Adam Belay <ambx1@neo.rr.com> | 3 | * Copyright by Adam Belay <ambx1@neo.rr.com> |
4 | * | ||
5 | */ | 4 | */ |
6 | 5 | ||
7 | #ifndef _LINUX_PNP_H | 6 | #ifndef _LINUX_PNP_H |
@@ -23,7 +22,6 @@ | |||
23 | struct pnp_protocol; | 22 | struct pnp_protocol; |
24 | struct pnp_dev; | 23 | struct pnp_dev; |
25 | 24 | ||
26 | |||
27 | /* | 25 | /* |
28 | * Resource Management | 26 | * Resource Management |
29 | */ | 27 | */ |
@@ -73,37 +71,37 @@ struct pnp_dev; | |||
73 | #define PNP_PORT_FLAG_FIXED (1<<1) | 71 | #define PNP_PORT_FLAG_FIXED (1<<1) |
74 | 72 | ||
75 | struct pnp_port { | 73 | struct pnp_port { |
76 | unsigned short min; /* min base number */ | 74 | unsigned short min; /* min base number */ |
77 | unsigned short max; /* max base number */ | 75 | unsigned short max; /* max base number */ |
78 | unsigned char align; /* align boundary */ | 76 | unsigned char align; /* align boundary */ |
79 | unsigned char size; /* size of range */ | 77 | unsigned char size; /* size of range */ |
80 | unsigned char flags; /* port flags */ | 78 | unsigned char flags; /* port flags */ |
81 | unsigned char pad; /* pad */ | 79 | unsigned char pad; /* pad */ |
82 | struct pnp_port *next; /* next port */ | 80 | struct pnp_port *next; /* next port */ |
83 | }; | 81 | }; |
84 | 82 | ||
85 | #define PNP_IRQ_NR 256 | 83 | #define PNP_IRQ_NR 256 |
86 | struct pnp_irq { | 84 | struct pnp_irq { |
87 | DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmaks for IRQ lines */ | 85 | DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmask for IRQ lines */ |
88 | unsigned char flags; /* IRQ flags */ | 86 | unsigned char flags; /* IRQ flags */ |
89 | unsigned char pad; /* pad */ | 87 | unsigned char pad; /* pad */ |
90 | struct pnp_irq *next; /* next IRQ */ | 88 | struct pnp_irq *next; /* next IRQ */ |
91 | }; | 89 | }; |
92 | 90 | ||
93 | struct pnp_dma { | 91 | struct pnp_dma { |
94 | unsigned char map; /* bitmask for DMA channels */ | 92 | unsigned char map; /* bitmask for DMA channels */ |
95 | unsigned char flags; /* DMA flags */ | 93 | unsigned char flags; /* DMA flags */ |
96 | struct pnp_dma *next; /* next port */ | 94 | struct pnp_dma *next; /* next port */ |
97 | }; | 95 | }; |
98 | 96 | ||
99 | struct pnp_mem { | 97 | struct pnp_mem { |
100 | unsigned int min; /* min base number */ | 98 | unsigned int min; /* min base number */ |
101 | unsigned int max; /* max base number */ | 99 | unsigned int max; /* max base number */ |
102 | unsigned int align; /* align boundary */ | 100 | unsigned int align; /* align boundary */ |
103 | unsigned int size; /* size of range */ | 101 | unsigned int size; /* size of range */ |
104 | unsigned char flags; /* memory flags */ | 102 | unsigned char flags; /* memory flags */ |
105 | unsigned char pad; /* pad */ | 103 | unsigned char pad; /* pad */ |
106 | struct pnp_mem *next; /* next memory resource */ | 104 | struct pnp_mem *next; /* next memory resource */ |
107 | }; | 105 | }; |
108 | 106 | ||
109 | #define PNP_RES_PRIORITY_PREFERRED 0 | 107 | #define PNP_RES_PRIORITY_PREFERRED 0 |
@@ -127,7 +125,6 @@ struct pnp_resource_table { | |||
127 | struct resource irq_resource[PNP_MAX_IRQ]; | 125 | struct resource irq_resource[PNP_MAX_IRQ]; |
128 | }; | 126 | }; |
129 | 127 | ||
130 | |||
131 | /* | 128 | /* |
132 | * Device Managemnt | 129 | * Device Managemnt |
133 | */ | 130 | */ |
@@ -139,14 +136,14 @@ struct pnp_card { | |||
139 | struct list_head protocol_list; /* node in protocol's list of cards */ | 136 | struct list_head protocol_list; /* node in protocol's list of cards */ |
140 | struct list_head devices; /* devices attached to the card */ | 137 | struct list_head devices; /* devices attached to the card */ |
141 | 138 | ||
142 | struct pnp_protocol * protocol; | 139 | struct pnp_protocol *protocol; |
143 | struct pnp_id * id; /* contains supported EISA IDs*/ | 140 | struct pnp_id *id; /* contains supported EISA IDs */ |
144 | 141 | ||
145 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ | 142 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ |
146 | unsigned char pnpver; /* Plug & Play version */ | 143 | unsigned char pnpver; /* Plug & Play version */ |
147 | unsigned char productver; /* product version */ | 144 | unsigned char productver; /* product version */ |
148 | unsigned int serial; /* serial number */ | 145 | unsigned int serial; /* serial number */ |
149 | unsigned char checksum; /* if zero - checksum passed */ | 146 | unsigned char checksum; /* if zero - checksum passed */ |
150 | struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */ | 147 | struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */ |
151 | }; | 148 | }; |
152 | 149 | ||
@@ -159,18 +156,18 @@ struct pnp_card { | |||
159 | (card) = global_to_pnp_card((card)->global_list.next)) | 156 | (card) = global_to_pnp_card((card)->global_list.next)) |
160 | 157 | ||
161 | struct pnp_card_link { | 158 | struct pnp_card_link { |
162 | struct pnp_card * card; | 159 | struct pnp_card *card; |
163 | struct pnp_card_driver * driver; | 160 | struct pnp_card_driver *driver; |
164 | void * driver_data; | 161 | void *driver_data; |
165 | pm_message_t pm_state; | 162 | pm_message_t pm_state; |
166 | }; | 163 | }; |
167 | 164 | ||
168 | static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) | 165 | static inline void *pnp_get_card_drvdata(struct pnp_card_link *pcard) |
169 | { | 166 | { |
170 | return pcard->driver_data; | 167 | return pcard->driver_data; |
171 | } | 168 | } |
172 | 169 | ||
173 | static inline void pnp_set_card_drvdata (struct pnp_card_link *pcard, void *data) | 170 | static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data) |
174 | { | 171 | { |
175 | pcard->driver_data = data; | 172 | pcard->driver_data = data; |
176 | } | 173 | } |
@@ -186,22 +183,22 @@ struct pnp_dev { | |||
186 | struct list_head card_list; /* node in card's list of devices */ | 183 | struct list_head card_list; /* node in card's list of devices */ |
187 | struct list_head rdev_list; /* node in cards list of requested devices */ | 184 | struct list_head rdev_list; /* node in cards list of requested devices */ |
188 | 185 | ||
189 | struct pnp_protocol * protocol; | 186 | struct pnp_protocol *protocol; |
190 | struct pnp_card * card; /* card the device is attached to, none if NULL */ | 187 | struct pnp_card *card; /* card the device is attached to, none if NULL */ |
191 | struct pnp_driver * driver; | 188 | struct pnp_driver *driver; |
192 | struct pnp_card_link * card_link; | 189 | struct pnp_card_link *card_link; |
193 | 190 | ||
194 | struct pnp_id * id; /* supported EISA IDs*/ | 191 | struct pnp_id *id; /* supported EISA IDs */ |
195 | 192 | ||
196 | int active; | 193 | int active; |
197 | int capabilities; | 194 | int capabilities; |
198 | struct pnp_option * independent; | 195 | struct pnp_option *independent; |
199 | struct pnp_option * dependent; | 196 | struct pnp_option *dependent; |
200 | struct pnp_resource_table res; | 197 | struct pnp_resource_table res; |
201 | 198 | ||
202 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ | 199 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ |
203 | unsigned short regs; /* ISAPnP: supported registers */ | 200 | unsigned short regs; /* ISAPnP: supported registers */ |
204 | int flags; /* used by protocols */ | 201 | int flags; /* used by protocols */ |
205 | struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ | 202 | struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ |
206 | void *data; | 203 | void *data; |
207 | }; | 204 | }; |
@@ -220,19 +217,19 @@ struct pnp_dev { | |||
220 | (dev) = card_to_pnp_dev((dev)->card_list.next)) | 217 | (dev) = card_to_pnp_dev((dev)->card_list.next)) |
221 | #define pnp_dev_name(dev) (dev)->name | 218 | #define pnp_dev_name(dev) (dev)->name |
222 | 219 | ||
223 | static inline void *pnp_get_drvdata (struct pnp_dev *pdev) | 220 | static inline void *pnp_get_drvdata(struct pnp_dev *pdev) |
224 | { | 221 | { |
225 | return dev_get_drvdata(&pdev->dev); | 222 | return dev_get_drvdata(&pdev->dev); |
226 | } | 223 | } |
227 | 224 | ||
228 | static inline void pnp_set_drvdata (struct pnp_dev *pdev, void *data) | 225 | static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data) |
229 | { | 226 | { |
230 | dev_set_drvdata(&pdev->dev, data); | 227 | dev_set_drvdata(&pdev->dev, data); |
231 | } | 228 | } |
232 | 229 | ||
233 | struct pnp_fixup { | 230 | struct pnp_fixup { |
234 | char id[7]; | 231 | char id[7]; |
235 | void (*quirk_function)(struct pnp_dev *dev); /* fixup function */ | 232 | void (*quirk_function) (struct pnp_dev * dev); /* fixup function */ |
236 | }; | 233 | }; |
237 | 234 | ||
238 | /* config parameters */ | 235 | /* config parameters */ |
@@ -269,7 +266,6 @@ extern struct pnp_protocol pnpbios_protocol; | |||
269 | #define pnp_device_is_pnpbios(dev) 0 | 266 | #define pnp_device_is_pnpbios(dev) 0 |
270 | #endif | 267 | #endif |
271 | 268 | ||
272 | |||
273 | /* status */ | 269 | /* status */ |
274 | #define PNP_READY 0x0000 | 270 | #define PNP_READY 0x0000 |
275 | #define PNP_ATTACHED 0x0001 | 271 | #define PNP_ATTACHED 0x0001 |
@@ -287,17 +283,17 @@ extern struct pnp_protocol pnpbios_protocol; | |||
287 | 283 | ||
288 | struct pnp_id { | 284 | struct pnp_id { |
289 | char id[PNP_ID_LEN]; | 285 | char id[PNP_ID_LEN]; |
290 | struct pnp_id * next; | 286 | struct pnp_id *next; |
291 | }; | 287 | }; |
292 | 288 | ||
293 | struct pnp_driver { | 289 | struct pnp_driver { |
294 | char * name; | 290 | char *name; |
295 | const struct pnp_device_id *id_table; | 291 | const struct pnp_device_id *id_table; |
296 | unsigned int flags; | 292 | unsigned int flags; |
297 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); | 293 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); |
298 | void (*remove) (struct pnp_dev *dev); | 294 | void (*remove) (struct pnp_dev *dev); |
299 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); | 295 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); |
300 | int (*resume) (struct pnp_dev *dev); | 296 | int (*resume) (struct pnp_dev *dev); |
301 | struct device_driver driver; | 297 | struct device_driver driver; |
302 | }; | 298 | }; |
303 | 299 | ||
@@ -305,13 +301,14 @@ struct pnp_driver { | |||
305 | 301 | ||
306 | struct pnp_card_driver { | 302 | struct pnp_card_driver { |
307 | struct list_head global_list; | 303 | struct list_head global_list; |
308 | char * name; | 304 | char *name; |
309 | const struct pnp_card_device_id *id_table; | 305 | const struct pnp_card_device_id *id_table; |
310 | unsigned int flags; | 306 | unsigned int flags; |
311 | int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id); | 307 | int (*probe) (struct pnp_card_link *card, |
308 | const struct pnp_card_device_id *card_id); | ||
312 | void (*remove) (struct pnp_card_link *card); | 309 | void (*remove) (struct pnp_card_link *card); |
313 | int (*suspend) (struct pnp_card_link *card, pm_message_t state); | 310 | int (*suspend) (struct pnp_card_link *card, pm_message_t state); |
314 | int (*resume) (struct pnp_card_link *card); | 311 | int (*resume) (struct pnp_card_link *card); |
315 | struct pnp_driver link; | 312 | struct pnp_driver link; |
316 | }; | 313 | }; |
317 | 314 | ||
@@ -321,25 +318,28 @@ struct pnp_card_driver { | |||
321 | #define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */ | 318 | #define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */ |
322 | #define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */ | 319 | #define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */ |
323 | 320 | ||
324 | |||
325 | /* | 321 | /* |
326 | * Protocol Management | 322 | * Protocol Management |
327 | */ | 323 | */ |
328 | 324 | ||
329 | struct pnp_protocol { | 325 | struct pnp_protocol { |
330 | struct list_head protocol_list; | 326 | struct list_head protocol_list; |
331 | char * name; | 327 | char *name; |
332 | 328 | ||
333 | /* resource control functions */ | 329 | /* resource control functions */ |
334 | int (*get)(struct pnp_dev *dev, struct pnp_resource_table *res); | 330 | int (*get) (struct pnp_dev *dev, struct pnp_resource_table *res); |
335 | int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res); | 331 | int (*set) (struct pnp_dev *dev, struct pnp_resource_table *res); |
336 | int (*disable)(struct pnp_dev *dev); | 332 | int (*disable) (struct pnp_dev *dev); |
333 | |||
334 | /* protocol specific suspend/resume */ | ||
335 | int (*suspend) (struct pnp_dev * dev, pm_message_t state); | ||
336 | int (*resume) (struct pnp_dev * dev); | ||
337 | 337 | ||
338 | /* used by pnp layer only (look but don't touch) */ | 338 | /* used by pnp layer only (look but don't touch) */ |
339 | unsigned char number; /* protocol number*/ | 339 | unsigned char number; /* protocol number */ |
340 | struct device dev; /* link to driver model */ | 340 | struct device dev; /* link to driver model */ |
341 | struct list_head cards; | 341 | struct list_head cards; |
342 | struct list_head devices; | 342 | struct list_head devices; |
343 | }; | 343 | }; |
344 | 344 | ||
345 | #define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list) | 345 | #define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list) |
@@ -352,7 +352,6 @@ struct pnp_protocol { | |||
352 | (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ | 352 | (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ |
353 | (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) | 353 | (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) |
354 | 354 | ||
355 | |||
356 | extern struct bus_type pnp_bus_type; | 355 | extern struct bus_type pnp_bus_type; |
357 | 356 | ||
358 | #if defined(CONFIG_PNP) | 357 | #if defined(CONFIG_PNP) |
@@ -372,21 +371,25 @@ void pnp_remove_card(struct pnp_card *card); | |||
372 | int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); | 371 | int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); |
373 | void pnp_remove_card_device(struct pnp_dev *dev); | 372 | void pnp_remove_card_device(struct pnp_dev *dev); |
374 | int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); | 373 | int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); |
375 | struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from); | 374 | struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, |
376 | void pnp_release_card_device(struct pnp_dev * dev); | 375 | const char *id, struct pnp_dev *from); |
377 | int pnp_register_card_driver(struct pnp_card_driver * drv); | 376 | void pnp_release_card_device(struct pnp_dev *dev); |
378 | void pnp_unregister_card_driver(struct pnp_card_driver * drv); | 377 | int pnp_register_card_driver(struct pnp_card_driver *drv); |
378 | void pnp_unregister_card_driver(struct pnp_card_driver *drv); | ||
379 | extern struct list_head pnp_cards; | 379 | extern struct list_head pnp_cards; |
380 | 380 | ||
381 | /* resource management */ | 381 | /* resource management */ |
382 | struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev); | 382 | struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev); |
383 | struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority); | 383 | struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, |
384 | int priority); | ||
384 | int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); | 385 | int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); |
385 | int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); | 386 | int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); |
386 | int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data); | 387 | int pnp_register_port_resource(struct pnp_option *option, |
388 | struct pnp_port *data); | ||
387 | int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); | 389 | int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); |
388 | void pnp_init_resource_table(struct pnp_resource_table *table); | 390 | void pnp_init_resource_table(struct pnp_resource_table *table); |
389 | int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); | 391 | int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, |
392 | int mode); | ||
390 | int pnp_auto_config_dev(struct pnp_dev *dev); | 393 | int pnp_auto_config_dev(struct pnp_dev *dev); |
391 | int pnp_validate_config(struct pnp_dev *dev); | 394 | int pnp_validate_config(struct pnp_dev *dev); |
392 | int pnp_start_dev(struct pnp_dev *dev); | 395 | int pnp_start_dev(struct pnp_dev *dev); |
@@ -394,11 +397,11 @@ int pnp_stop_dev(struct pnp_dev *dev); | |||
394 | int pnp_activate_dev(struct pnp_dev *dev); | 397 | int pnp_activate_dev(struct pnp_dev *dev); |
395 | int pnp_disable_dev(struct pnp_dev *dev); | 398 | int pnp_disable_dev(struct pnp_dev *dev); |
396 | void pnp_resource_change(struct resource *resource, resource_size_t start, | 399 | void pnp_resource_change(struct resource *resource, resource_size_t start, |
397 | resource_size_t size); | 400 | resource_size_t size); |
398 | 401 | ||
399 | /* protocol helpers */ | 402 | /* protocol helpers */ |
400 | int pnp_is_active(struct pnp_dev * dev); | 403 | int pnp_is_active(struct pnp_dev *dev); |
401 | int compare_pnp_id(struct pnp_id * pos, const char * id); | 404 | int compare_pnp_id(struct pnp_id *pos, const char *id); |
402 | int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); | 405 | int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); |
403 | int pnp_register_driver(struct pnp_driver *drv); | 406 | int pnp_register_driver(struct pnp_driver *drv); |
404 | void pnp_unregister_driver(struct pnp_driver *drv); | 407 | void pnp_unregister_driver(struct pnp_driver *drv); |
@@ -411,23 +414,24 @@ static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } | |||
411 | static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } | 414 | static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } |
412 | static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } | 415 | static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } |
413 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } | 416 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } |
414 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } | 417 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { } |
418 | |||
415 | #define pnp_platform_devices 0 | 419 | #define pnp_platform_devices 0 |
416 | 420 | ||
417 | /* multidevice card support */ | 421 | /* multidevice card support */ |
418 | static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } | 422 | static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } |
419 | static inline void pnp_remove_card(struct pnp_card *card) { ; } | 423 | static inline void pnp_remove_card(struct pnp_card *card) { } |
420 | static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; } | 424 | static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; } |
421 | static inline void pnp_remove_card_device(struct pnp_dev *dev) { ; } | 425 | static inline void pnp_remove_card_device(struct pnp_dev *dev) { } |
422 | static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; } | 426 | static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; } |
423 | static inline struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from) { return NULL; } | 427 | static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; } |
424 | static inline void pnp_release_card_device(struct pnp_dev * dev) { ; } | 428 | static inline void pnp_release_card_device(struct pnp_dev *dev) { } |
425 | static inline int pnp_register_card_driver(struct pnp_card_driver * drv) { return -ENODEV; } | 429 | static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; } |
426 | static inline void pnp_unregister_card_driver(struct pnp_card_driver * drv) { ; } | 430 | static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { } |
427 | 431 | ||
428 | /* resource management */ | 432 | /* resource management */ |
429 | static inline struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev) { return NULL; } | 433 | static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev) { return NULL; } |
430 | static inline struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; } | 434 | static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; } |
431 | static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; } | 435 | static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; } |
432 | static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } | 436 | static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } |
433 | static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } | 437 | static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } |
@@ -440,20 +444,17 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } | |||
440 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | 444 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } |
441 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | 445 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } |
442 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | 446 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } |
443 | static inline void pnp_resource_change(struct resource *resource, | 447 | static inline void pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { } |
444 | resource_size_t start, | ||
445 | resource_size_t size) { } | ||
446 | 448 | ||
447 | /* protocol helpers */ | 449 | /* protocol helpers */ |
448 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } | 450 | static inline int pnp_is_active(struct pnp_dev *dev) { return 0; } |
449 | static inline int compare_pnp_id(struct pnp_id * pos, const char * id) { return -ENODEV; } | 451 | static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; } |
450 | static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } | 452 | static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } |
451 | static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } | 453 | static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } |
452 | static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } | 454 | static inline void pnp_unregister_driver(struct pnp_driver *drv) { } |
453 | 455 | ||
454 | #endif /* CONFIG_PNP */ | 456 | #endif /* CONFIG_PNP */ |
455 | 457 | ||
456 | |||
457 | #define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg) | 458 | #define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg) |
458 | #define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) | 459 | #define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) |
459 | #define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) | 460 | #define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) |
diff --git a/include/linux/pnpbios.h b/include/linux/pnpbios.h index 0a282ac1f6b2..329192adc9dd 100644 --- a/include/linux/pnpbios.h +++ b/include/linux/pnpbios.h | |||
@@ -99,32 +99,32 @@ | |||
99 | 99 | ||
100 | #pragma pack(1) | 100 | #pragma pack(1) |
101 | struct pnp_dev_node_info { | 101 | struct pnp_dev_node_info { |
102 | __u16 no_nodes; | 102 | __u16 no_nodes; |
103 | __u16 max_node_size; | 103 | __u16 max_node_size; |
104 | }; | 104 | }; |
105 | struct pnp_docking_station_info { | 105 | struct pnp_docking_station_info { |
106 | __u32 location_id; | 106 | __u32 location_id; |
107 | __u32 serial; | 107 | __u32 serial; |
108 | __u16 capabilities; | 108 | __u16 capabilities; |
109 | }; | 109 | }; |
110 | struct pnp_isa_config_struc { | 110 | struct pnp_isa_config_struc { |
111 | __u8 revision; | 111 | __u8 revision; |
112 | __u8 no_csns; | 112 | __u8 no_csns; |
113 | __u16 isa_rd_data_port; | 113 | __u16 isa_rd_data_port; |
114 | __u16 reserved; | 114 | __u16 reserved; |
115 | }; | 115 | }; |
116 | struct escd_info_struc { | 116 | struct escd_info_struc { |
117 | __u16 min_escd_write_size; | 117 | __u16 min_escd_write_size; |
118 | __u16 escd_size; | 118 | __u16 escd_size; |
119 | __u32 nv_storage_base; | 119 | __u32 nv_storage_base; |
120 | }; | 120 | }; |
121 | struct pnp_bios_node { | 121 | struct pnp_bios_node { |
122 | __u16 size; | 122 | __u16 size; |
123 | __u8 handle; | 123 | __u8 handle; |
124 | __u32 eisa_id; | 124 | __u32 eisa_id; |
125 | __u8 type_code[3]; | 125 | __u8 type_code[3]; |
126 | __u16 flags; | 126 | __u16 flags; |
127 | __u8 data[0]; | 127 | __u8 data[0]; |
128 | }; | 128 | }; |
129 | #pragma pack() | 129 | #pragma pack() |
130 | 130 | ||
@@ -133,22 +133,16 @@ struct pnp_bios_node { | |||
133 | /* non-exported */ | 133 | /* non-exported */ |
134 | extern struct pnp_dev_node_info node_info; | 134 | extern struct pnp_dev_node_info node_info; |
135 | 135 | ||
136 | extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data); | 136 | extern int pnp_bios_dev_node_info(struct pnp_dev_node_info *data); |
137 | extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data); | 137 | extern int pnp_bios_get_dev_node(u8 *nodenum, char config, |
138 | extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data); | 138 | struct pnp_bios_node *data); |
139 | extern int pnp_bios_get_stat_res (char *info); | 139 | extern int pnp_bios_set_dev_node(u8 nodenum, char config, |
140 | extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data); | 140 | struct pnp_bios_node *data); |
141 | extern int pnp_bios_escd_info (struct escd_info_struc *data); | 141 | extern int pnp_bios_get_stat_res(char *info); |
142 | extern int pnp_bios_read_escd (char *data, u32 nvram_base); | 142 | extern int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data); |
143 | extern int pnp_bios_escd_info(struct escd_info_struc *data); | ||
144 | extern int pnp_bios_read_escd(char *data, u32 nvram_base); | ||
143 | extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data); | 145 | extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data); |
144 | #define needed 0 | ||
145 | #if needed | ||
146 | extern int pnp_bios_get_event (u16 *message); | ||
147 | extern int pnp_bios_send_message (u16 message); | ||
148 | extern int pnp_bios_set_stat_res (char *info); | ||
149 | extern int pnp_bios_apm_id_table (char *table, u16 *size); | ||
150 | extern int pnp_bios_write_escd (char *data, u32 nvram_base); | ||
151 | #endif | ||
152 | 146 | ||
153 | #endif /* CONFIG_PNPBIOS */ | 147 | #endif /* CONFIG_PNPBIOS */ |
154 | 148 | ||
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index d0926d63406c..484988ed301e 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/thread_info.h> | 9 | #include <linux/thread_info.h> |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <linux/list.h> | ||
11 | 12 | ||
12 | #ifdef CONFIG_DEBUG_PREEMPT | 13 | #ifdef CONFIG_DEBUG_PREEMPT |
13 | extern void fastcall add_preempt_count(int val); | 14 | extern void fastcall add_preempt_count(int val); |
@@ -60,4 +61,47 @@ do { \ | |||
60 | 61 | ||
61 | #endif | 62 | #endif |
62 | 63 | ||
64 | #ifdef CONFIG_PREEMPT_NOTIFIERS | ||
65 | |||
66 | struct preempt_notifier; | ||
67 | |||
68 | /** | ||
69 | * preempt_ops - notifiers called when a task is preempted and rescheduled | ||
70 | * @sched_in: we're about to be rescheduled: | ||
71 | * notifier: struct preempt_notifier for the task being scheduled | ||
72 | * cpu: cpu we're scheduled on | ||
73 | * @sched_out: we've just been preempted | ||
74 | * notifier: struct preempt_notifier for the task being preempted | ||
75 | * next: the task that's kicking us out | ||
76 | */ | ||
77 | struct preempt_ops { | ||
78 | void (*sched_in)(struct preempt_notifier *notifier, int cpu); | ||
79 | void (*sched_out)(struct preempt_notifier *notifier, | ||
80 | struct task_struct *next); | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * preempt_notifier - key for installing preemption notifiers | ||
85 | * @link: internal use | ||
86 | * @ops: defines the notifier functions to be called | ||
87 | * | ||
88 | * Usually used in conjunction with container_of(). | ||
89 | */ | ||
90 | struct preempt_notifier { | ||
91 | struct hlist_node link; | ||
92 | struct preempt_ops *ops; | ||
93 | }; | ||
94 | |||
95 | void preempt_notifier_register(struct preempt_notifier *notifier); | ||
96 | void preempt_notifier_unregister(struct preempt_notifier *notifier); | ||
97 | |||
98 | static inline void preempt_notifier_init(struct preempt_notifier *notifier, | ||
99 | struct preempt_ops *ops) | ||
100 | { | ||
101 | INIT_HLIST_NODE(¬ifier->link); | ||
102 | notifier->ops = ops; | ||
103 | } | ||
104 | |||
105 | #endif | ||
106 | |||
63 | #endif /* __LINUX_PREEMPT_H */ | 107 | #endif /* __LINUX_PREEMPT_H */ |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 28ac632b42dd..dcb729244f47 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -227,7 +227,7 @@ struct mddev_s | |||
227 | unsigned int safemode_delay; | 227 | unsigned int safemode_delay; |
228 | struct timer_list safemode_timer; | 228 | struct timer_list safemode_timer; |
229 | atomic_t writes_pending; | 229 | atomic_t writes_pending; |
230 | request_queue_t *queue; /* for plugging ... */ | 230 | struct request_queue *queue; /* for plugging ... */ |
231 | 231 | ||
232 | atomic_t write_behind; /* outstanding async IO */ | 232 | atomic_t write_behind; /* outstanding async IO */ |
233 | unsigned int max_write_behind; /* 0 = sync */ | 233 | unsigned int max_write_behind; /* 0 = sync */ |
@@ -265,7 +265,7 @@ struct mdk_personality | |||
265 | int level; | 265 | int level; |
266 | struct list_head list; | 266 | struct list_head list; |
267 | struct module *owner; | 267 | struct module *owner; |
268 | int (*make_request)(request_queue_t *q, struct bio *bio); | 268 | int (*make_request)(struct request_queue *q, struct bio *bio); |
269 | int (*run)(mddev_t *mddev); | 269 | int (*run)(mddev_t *mddev); |
270 | int (*stop)(mddev_t *mddev); | 270 | int (*stop)(mddev_t *mddev); |
271 | void (*status)(struct seq_file *seq, mddev_t *mddev); | 271 | void (*status)(struct seq_file *seq, mddev_t *mddev); |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 965d5b3ea9eb..180a9d832dde 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -81,14 +81,16 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...); | |||
81 | /* assertions handling */ | 81 | /* assertions handling */ |
82 | 82 | ||
83 | /** always check a condition and panic if it's false. */ | 83 | /** always check a condition and panic if it's false. */ |
84 | #define RASSERT( cond, format, args... ) \ | 84 | #define __RASSERT( cond, scond, format, args... ) \ |
85 | if( !( cond ) ) \ | 85 | if( !( cond ) ) \ |
86 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " #cond " failed at " \ | 86 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ |
87 | __FILE__ ":%i:%s: " format "\n", \ | 87 | __FILE__ ":%i:%s: " format "\n", \ |
88 | in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) | 88 | in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) |
89 | 89 | ||
90 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | ||
91 | |||
90 | #if defined( CONFIG_REISERFS_CHECK ) | 92 | #if defined( CONFIG_REISERFS_CHECK ) |
91 | #define RFALSE( cond, format, args... ) RASSERT( !( cond ), format, ##args ) | 93 | #define RFALSE(cond, format, args...) __RASSERT(!(cond), "!(" #cond ")", format, ##args) |
92 | #else | 94 | #else |
93 | #define RFALSE( cond, format, args... ) do {;} while( 0 ) | 95 | #define RFALSE( cond, format, args... ) do {;} while( 0 ) |
94 | #endif | 96 | #endif |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 33b9b4841ee7..2e490271acf6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -681,7 +681,7 @@ enum cpu_idle_type { | |||
681 | #define SCHED_LOAD_SHIFT 10 | 681 | #define SCHED_LOAD_SHIFT 10 |
682 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) | 682 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) |
683 | 683 | ||
684 | #define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5) | 684 | #define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 1) |
685 | 685 | ||
686 | #ifdef CONFIG_SMP | 686 | #ifdef CONFIG_SMP |
687 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ | 687 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ |
@@ -786,6 +786,22 @@ extern int partition_sched_domains(cpumask_t *partition1, | |||
786 | 786 | ||
787 | #endif /* CONFIG_SMP */ | 787 | #endif /* CONFIG_SMP */ |
788 | 788 | ||
789 | /* | ||
790 | * A runqueue laden with a single nice 0 task scores a weighted_cpuload of | ||
791 | * SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a | ||
792 | * task of nice 0 or enough lower priority tasks to bring up the | ||
793 | * weighted_cpuload | ||
794 | */ | ||
795 | static inline int above_background_load(void) | ||
796 | { | ||
797 | unsigned long cpu; | ||
798 | |||
799 | for_each_online_cpu(cpu) { | ||
800 | if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE) | ||
801 | return 1; | ||
802 | } | ||
803 | return 0; | ||
804 | } | ||
789 | 805 | ||
790 | struct io_context; /* See blkdev.h */ | 806 | struct io_context; /* See blkdev.h */ |
791 | struct cpuset; | 807 | struct cpuset; |
@@ -935,6 +951,11 @@ struct task_struct { | |||
935 | struct sched_class *sched_class; | 951 | struct sched_class *sched_class; |
936 | struct sched_entity se; | 952 | struct sched_entity se; |
937 | 953 | ||
954 | #ifdef CONFIG_PREEMPT_NOTIFIERS | ||
955 | /* list of struct preempt_notifier: */ | ||
956 | struct hlist_head preempt_notifiers; | ||
957 | #endif | ||
958 | |||
938 | unsigned short ioprio; | 959 | unsigned short ioprio; |
939 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 960 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
940 | unsigned int btrace_seq; | 961 | unsigned int btrace_seq; |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 8518fa2a6f89..afe0f6d9b9bc 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -20,7 +20,7 @@ | |||
20 | struct plat_serial8250_port { | 20 | struct plat_serial8250_port { |
21 | unsigned long iobase; /* io base address */ | 21 | unsigned long iobase; /* io base address */ |
22 | void __iomem *membase; /* ioremap cookie or NULL */ | 22 | void __iomem *membase; /* ioremap cookie or NULL */ |
23 | unsigned long mapbase; /* resource base */ | 23 | resource_size_t mapbase; /* resource base */ |
24 | unsigned int irq; /* interrupt number */ | 24 | unsigned int irq; /* interrupt number */ |
25 | unsigned int uartclk; /* UART clock rate */ | 25 | unsigned int uartclk; /* UART clock rate */ |
26 | unsigned char regshift; /* register shift */ | 26 | unsigned char regshift; /* register shift */ |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 773d8d8828ad..09d17b06bf02 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -288,7 +288,7 @@ struct uart_port { | |||
288 | const struct uart_ops *ops; | 288 | const struct uart_ops *ops; |
289 | unsigned int custom_divisor; | 289 | unsigned int custom_divisor; |
290 | unsigned int line; /* port index */ | 290 | unsigned int line; /* port index */ |
291 | unsigned long mapbase; /* for ioremap */ | 291 | resource_size_t mapbase; /* for ioremap */ |
292 | struct device *dev; /* parent device */ | 292 | struct device *dev; /* parent device */ |
293 | unsigned char hub6; /* this should be in the 8250 driver */ | 293 | unsigned char hub6; /* this should be in the 8250 driver */ |
294 | unsigned char unused[3]; | 294 | unsigned char unused[3]; |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index e8e6da394c92..388cace9751f 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -24,7 +24,7 @@ struct pbe { | |||
24 | extern void drain_local_pages(void); | 24 | extern void drain_local_pages(void); |
25 | extern void mark_free_pages(struct zone *zone); | 25 | extern void mark_free_pages(struct zone *zone); |
26 | 26 | ||
27 | #if defined(CONFIG_PM) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) | 27 | #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) |
28 | extern int pm_prepare_console(void); | 28 | extern int pm_prepare_console(void); |
29 | extern void pm_restore_console(void); | 29 | extern void pm_restore_console(void); |
30 | #else | 30 | #else |
@@ -54,8 +54,7 @@ struct hibernation_ops { | |||
54 | void (*restore_cleanup)(void); | 54 | void (*restore_cleanup)(void); |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #ifdef CONFIG_PM | 57 | #ifdef CONFIG_HIBERNATION |
58 | #ifdef CONFIG_SOFTWARE_SUSPEND | ||
59 | /* kernel/power/snapshot.c */ | 58 | /* kernel/power/snapshot.c */ |
60 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); | 59 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); |
61 | static inline void register_nosave_region(unsigned long b, unsigned long e) | 60 | static inline void register_nosave_region(unsigned long b, unsigned long e) |
@@ -73,15 +72,16 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); | |||
73 | 72 | ||
74 | extern void hibernation_set_ops(struct hibernation_ops *ops); | 73 | extern void hibernation_set_ops(struct hibernation_ops *ops); |
75 | extern int hibernate(void); | 74 | extern int hibernate(void); |
76 | #else /* CONFIG_SOFTWARE_SUSPEND */ | 75 | #else /* CONFIG_HIBERNATION */ |
77 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 76 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
78 | static inline void swsusp_set_page_free(struct page *p) {} | 77 | static inline void swsusp_set_page_free(struct page *p) {} |
79 | static inline void swsusp_unset_page_free(struct page *p) {} | 78 | static inline void swsusp_unset_page_free(struct page *p) {} |
80 | 79 | ||
81 | static inline void hibernation_set_ops(struct hibernation_ops *ops) {} | 80 | static inline void hibernation_set_ops(struct hibernation_ops *ops) {} |
82 | static inline int hibernate(void) { return -ENOSYS; } | 81 | static inline int hibernate(void) { return -ENOSYS; } |
83 | #endif /* CONFIG_SOFTWARE_SUSPEND */ | 82 | #endif /* CONFIG_HIBERNATION */ |
84 | 83 | ||
84 | #ifdef CONFIG_PM_SLEEP | ||
85 | void save_processor_state(void); | 85 | void save_processor_state(void); |
86 | void restore_processor_state(void); | 86 | void restore_processor_state(void); |
87 | struct saved_context; | 87 | struct saved_context; |
@@ -106,7 +106,7 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
106 | { .notifier_call = fn, .priority = pri }; \ | 106 | { .notifier_call = fn, .priority = pri }; \ |
107 | register_pm_notifier(&fn##_nb); \ | 107 | register_pm_notifier(&fn##_nb); \ |
108 | } | 108 | } |
109 | #else /* CONFIG_PM */ | 109 | #else /* !CONFIG_PM_SLEEP */ |
110 | 110 | ||
111 | static inline int register_pm_notifier(struct notifier_block *nb) | 111 | static inline int register_pm_notifier(struct notifier_block *nb) |
112 | { | 112 | { |
@@ -119,12 +119,15 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
119 | } | 119 | } |
120 | 120 | ||
121 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) | 121 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) |
122 | #endif /* CONFIG_PM */ | 122 | #endif /* !CONFIG_PM_SLEEP */ |
123 | 123 | ||
124 | #if !defined CONFIG_SOFTWARE_SUSPEND || !defined(CONFIG_PM) | 124 | #ifndef CONFIG_HIBERNATION |
125 | static inline void register_nosave_region(unsigned long b, unsigned long e) | 125 | static inline void register_nosave_region(unsigned long b, unsigned long e) |
126 | { | 126 | { |
127 | } | 127 | } |
128 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) | ||
129 | { | ||
130 | } | ||
128 | #endif | 131 | #endif |
129 | 132 | ||
130 | #endif /* _LINUX_SWSUSP_H */ | 133 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/include/linux/time.h b/include/linux/time.h index e6aea5146e5d..6a5f503b4f1d 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -99,15 +99,11 @@ extern int update_persistent_clock(struct timespec now); | |||
99 | extern int no_sync_cmos_clock __read_mostly; | 99 | extern int no_sync_cmos_clock __read_mostly; |
100 | void timekeeping_init(void); | 100 | void timekeeping_init(void); |
101 | 101 | ||
102 | static inline unsigned long get_seconds(void) | 102 | unsigned long get_seconds(void); |
103 | { | ||
104 | return xtime.tv_sec; | ||
105 | } | ||
106 | |||
107 | struct timespec current_kernel_time(void); | 103 | struct timespec current_kernel_time(void); |
108 | 104 | ||
109 | #define CURRENT_TIME (current_kernel_time()) | 105 | #define CURRENT_TIME (current_kernel_time()) |
110 | #define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) | 106 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
111 | 107 | ||
112 | extern void do_gettimeofday(struct timeval *tv); | 108 | extern void do_gettimeofday(struct timeval *tv); |
113 | extern int do_settimeofday(struct timespec *tv); | 109 | extern int do_settimeofday(struct timespec *tv); |