aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h16
-rw-r--r--include/acpi/acpi_drivers.h23
-rw-r--r--include/acpi/actypes.h6
-rw-r--r--include/acpi/acutils.h4
-rw-r--r--include/asm-alpha/bitops.h2
-rw-r--r--include/asm-arm/arch-mxc/uncompress.h3
-rw-r--r--include/asm-arm/arch-omap/mailbox.h2
-rw-r--r--include/asm-arm/unaligned.h22
-rw-r--r--include/asm-blackfin/bfin-global.h1
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF54x_base.h33
-rw-r--r--include/asm-blackfin/mach-bf548/irq.h1
-rw-r--r--include/asm-blackfin/mach-bf561/cdefBF561.h6
-rw-r--r--include/asm-blackfin/mach-bf561/defBF561.h4
-rw-r--r--include/asm-blackfin/thread_info.h12
-rw-r--r--include/asm-i386/acpi.h23
-rw-r--r--include/asm-i386/bootparam.h9
-rw-r--r--include/asm-i386/e820.h2
-rw-r--r--include/asm-i386/ist.h10
-rw-r--r--include/asm-i386/suspend.h2
-rw-r--r--include/asm-ia64/acpi.h5
-rw-r--r--include/asm-ia64/ia32.h9
-rw-r--r--include/asm-ia64/machvec.h1
-rw-r--r--include/asm-ia64/processor.h4
-rw-r--r--include/asm-ia64/smp.h1
-rw-r--r--include/asm-m68k/raw_io.h8
-rw-r--r--include/asm-m68k/system.h33
-rw-r--r--include/asm-m68knommu/hardirq.h2
-rw-r--r--include/asm-m68knommu/hw_irq.h4
-rw-r--r--include/asm-m68knommu/machdep.h38
-rw-r--r--include/asm-m68knommu/mcfdma.h2
-rw-r--r--include/asm-m68knommu/system.h4
-rw-r--r--include/asm-m68knommu/timex.h24
-rw-r--r--include/asm-mips/edac.h35
-rw-r--r--include/asm-mips/war.h1
-rw-r--r--include/asm-powerpc/bug.h2
-rw-r--r--include/asm-powerpc/page.h1
-rw-r--r--include/asm-powerpc/pci-bridge.h36
-rw-r--r--include/asm-powerpc/ppc_asm.h12
-rw-r--r--include/asm-powerpc/vio.h5
-rw-r--r--include/asm-s390/ccwdev.h5
-rw-r--r--include/asm-s390/s390_ext.h2
-rw-r--r--include/asm-s390/smp.h11
-rw-r--r--include/asm-s390/unistd.h2
-rw-r--r--include/asm-x86_64/acpi.h22
-rw-r--r--include/asm-x86_64/ist.h1
-rw-r--r--include/asm-x86_64/suspend.h2
-rw-r--r--include/asm-x86_64/uaccess.h4
-rw-r--r--include/asm-xtensa/io.h1
-rw-r--r--include/linux/acpi.h1
-rw-r--r--include/linux/apm_bios.h20
-rw-r--r--include/linux/blkdev.h145
-rw-r--r--include/linux/blktrace_api.h2
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/linux/device.h3
-rw-r--r--include/linux/elevator.h76
-rw-r--r--include/linux/freezer.h6
-rw-r--r--include/linux/hugetlb.h2
-rw-r--r--include/linux/ide.h4
-rw-r--r--include/linux/interrupt.h4
-rw-r--r--include/linux/lguest.h51
-rw-r--r--include/linux/lguest_bus.h5
-rw-r--r--include/linux/lguest_launcher.h60
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/mm.h38
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mod_devicetable.h6
-rw-r--r--include/linux/netfilter/xt_connlimit.h4
-rw-r--r--include/linux/pci.h1
-rw-r--r--include/linux/pci_ids.h23
-rw-r--r--include/linux/pm.h15
-rw-r--r--include/linux/pnp.h191
-rw-r--r--include/linux/pnpbios.h60
-rw-r--r--include/linux/preempt.h44
-rw-r--r--include/linux/raid/md_k.h4
-rw-r--r--include/linux/reiserfs_fs.h8
-rw-r--r--include/linux/sched.h23
-rw-r--r--include/linux/serial_8250.h2
-rw-r--r--include/linux/serial_core.h2
-rw-r--r--include/linux/suspend.h19
-rw-r--r--include/linux/time.h8
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h4
-rw-r--r--include/scsi/sd.h2
-rw-r--r--include/xen/page.h1
84 files changed, 798 insertions, 504 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 5e3dcf3299b..3d0fea235bf 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -131,7 +131,7 @@ struct acpi_device_ops {
131struct acpi_driver { 131struct acpi_driver {
132 char name[80]; 132 char name[80];
133 char class[80]; 133 char class[80];
134 char *ids; /* Supported Hardware IDs */ 134 const struct acpi_device_id *ids; /* Supported Hardware IDs */
135 struct acpi_device_ops ops; 135 struct acpi_device_ops ops;
136 struct device_driver drv; 136 struct device_driver drv;
137 struct module *owner; 137 struct module *owner;
@@ -341,7 +341,8 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
341int acpi_bus_trim(struct acpi_device *start, int rmdevice); 341int acpi_bus_trim(struct acpi_device *start, int rmdevice);
342int acpi_bus_start(struct acpi_device *device); 342int acpi_bus_start(struct acpi_device *device);
343acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); 343acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
344int acpi_match_ids(struct acpi_device *device, char *ids); 344int acpi_match_device_ids(struct acpi_device *device,
345 const struct acpi_device_id *ids);
345int acpi_create_dir(struct acpi_device *); 346int acpi_create_dir(struct acpi_device *);
346void acpi_remove_dir(struct acpi_device *); 347void acpi_remove_dir(struct acpi_device *);
347 348
@@ -365,6 +366,17 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer);
365acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); 366acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
366#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) 367#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
367 368
369#ifdef CONFIG_PM_SLEEP
370int acpi_pm_device_sleep_state(struct device *, int, int *);
371#else /* !CONFIG_PM_SLEEP */
372static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p)
373{
374 if (p)
375 *p = ACPI_STATE_D0;
376 return ACPI_STATE_D3;
377}
378#endif /* !CONFIG_PM_SLEEP */
379
368#endif /* CONFIG_ACPI */ 380#endif /* CONFIG_ACPI */
369 381
370#endif /*__ACPI_BUS_H__*/ 382#endif /*__ACPI_BUS_H__*/
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 553515912c0..202acb9ff4d 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -34,16 +34,21 @@
34#define ACPI_BUS_COMPONENT 0x00010000 34#define ACPI_BUS_COMPONENT 0x00010000
35#define ACPI_SYSTEM_COMPONENT 0x02000000 35#define ACPI_SYSTEM_COMPONENT 0x02000000
36 36
37/* _HID definitions */ 37/*
38 * _HID definitions
39 * HIDs must conform to ACPI spec(6.1.4)
40 * Linux specific HIDs do not apply to this and begin with LNX:
41 */
38 42
39#define ACPI_POWER_HID "power_resource" 43#define ACPI_POWER_HID "LNXPOWER"
40#define ACPI_PROCESSOR_HID "ACPI0007" 44#define ACPI_PROCESSOR_HID "ACPI0007"
41#define ACPI_SYSTEM_HID "acpi_system" 45#define ACPI_SYSTEM_HID "LNXSYSTM"
42#define ACPI_THERMAL_HID "thermal" 46#define ACPI_THERMAL_HID "LNXTHERM"
43#define ACPI_BUTTON_HID_POWERF "button_power" 47#define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
44#define ACPI_BUTTON_HID_SLEEPF "button_sleep" 48#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN"
45#define ACPI_VIDEO_HID "video" 49#define ACPI_VIDEO_HID "LNXVIDEO"
46#define ACPI_BAY_HID "bay" 50#define ACPI_BAY_HID "LNXIOBAY"
51
47/* -------------------------------------------------------------------------- 52/* --------------------------------------------------------------------------
48 PCI 53 PCI
49 -------------------------------------------------------------------------- */ 54 -------------------------------------------------------------------------- */
@@ -145,7 +150,7 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle)
145#ifdef CONFIG_ACPI_SLEEP 150#ifdef CONFIG_ACPI_SLEEP
146extern int acpi_sleep_init(void); 151extern int acpi_sleep_init(void);
147#else 152#else
148#define acpi_sleep_init() do {} while (0) 153static inline int acpi_sleep_init(void) { return 0; }
149#endif 154#endif
150 155
151#endif /*__ACPI_DRIVERS_H__*/ 156#endif /*__ACPI_DRIVERS_H__*/
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index fe8abc27643..e73a3893912 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
809 809
810/* Common string version of device HIDs and UIDs */ 810/* Common string version of device HIDs and UIDs */
811 811
812struct acpi_device_id { 812struct acpica_device_id {
813 char value[ACPI_DEVICE_ID_LENGTH]; 813 char value[ACPI_DEVICE_ID_LENGTH];
814}; 814};
815 815
@@ -859,8 +859,8 @@ struct acpi_device_info {
859 u32 valid; /* Indicates which fields below are valid */ 859 u32 valid; /* Indicates which fields below are valid */
860 u32 current_status; /* _STA value */ 860 u32 current_status; /* _STA value */
861 acpi_integer address; /* _ADR value if any */ 861 acpi_integer address; /* _ADR value if any */
862 struct acpi_device_id hardware_id; /* _HID value if any */ 862 struct acpica_device_id hardware_id; /* _HID value if any */
863 struct acpi_device_id unique_id; /* _UID value if any */ 863 struct acpica_device_id unique_id; /* _UID value if any */
864 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ 864 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
865 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ 865 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */
866}; 866};
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index a87ef1c8d46..a2918547c73 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name,
354 354
355acpi_status 355acpi_status
356acpi_ut_execute_HID(struct acpi_namespace_node *device_node, 356acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
357 struct acpi_device_id *hid); 357 struct acpica_device_id *hid);
358 358
359acpi_status 359acpi_status
360acpi_ut_execute_CID(struct acpi_namespace_node *device_node, 360acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
@@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node,
366 366
367acpi_status 367acpi_status
368acpi_ut_execute_UID(struct acpi_namespace_node *device_node, 368acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
369 struct acpi_device_id *uid); 369 struct acpica_device_id *uid);
370 370
371acpi_status 371acpi_status
372acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); 372acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 3a0cbeb03fa..9e71201000d 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -324,7 +324,7 @@ static inline int fls64(unsigned long x)
324{ 324{
325 unsigned long t, a, r; 325 unsigned long t, a, r;
326 326
327 t = __kernel_cmpbge (x, 0x0101010101010101); 327 t = __kernel_cmpbge (x, 0x0101010101010101UL);
328 a = __flsm1_tab[t]; 328 a = __flsm1_tab[t];
329 t = __kernel_extbl (x, a); 329 t = __kernel_extbl (x, a);
330 r = a*8 + __flsm1_tab[t] + (x != 0); 330 r = a*8 + __flsm1_tab[t] + (x != 0);
diff --git a/include/asm-arm/arch-mxc/uncompress.h b/include/asm-arm/arch-mxc/uncompress.h
index ec5787d0e78..42cc0cb3fef 100644
--- a/include/asm-arm/arch-mxc/uncompress.h
+++ b/include/asm-arm/arch-mxc/uncompress.h
@@ -26,7 +26,6 @@
26#define __MXC_BOOT_UNCOMPRESS 26#define __MXC_BOOT_UNCOMPRESS
27 27
28#include <asm/hardware.h> 28#include <asm/hardware.h>
29#include <asm/processor.h>
30 29
31#define UART(x) (*(volatile unsigned long *)(serial_port + (x))) 30#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
32 31
@@ -62,7 +61,7 @@ static void putc(int ch)
62 } 61 }
63 62
64 while (!(UART(USR2) & USR2_TXFE)) 63 while (!(UART(USR2) & USR2_TXFE))
65 cpu_relax(); 64 barrier();
66 65
67 UART(TXR) = ch; 66 UART(TXR) = ch;
68} 67}
diff --git a/include/asm-arm/arch-omap/mailbox.h b/include/asm-arm/arch-omap/mailbox.h
index 4bf0909461f..7cbed9332e1 100644
--- a/include/asm-arm/arch-omap/mailbox.h
+++ b/include/asm-arm/arch-omap/mailbox.h
@@ -37,7 +37,7 @@ struct omap_mbox_ops {
37 37
38struct omap_mbox_queue { 38struct omap_mbox_queue {
39 spinlock_t lock; 39 spinlock_t lock;
40 request_queue_t *queue; 40 struct request_queue *queue;
41 struct work_struct work; 41 struct work_struct work;
42 int (*callback)(void *); 42 int (*callback)(void *);
43 struct omap_mbox *mbox; 43 struct omap_mbox *mbox;
diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h
index 795b9e5b9e6..8431f6eed5c 100644
--- a/include/asm-arm/unaligned.h
+++ b/include/asm-arm/unaligned.h
@@ -60,24 +60,24 @@ extern int __bug_unaligned_x(const void *ptr);
60 __get_unaligned_4_be((__p+4))) 60 __get_unaligned_4_be((__p+4)))
61 61
62#define __get_unaligned_le(ptr) \ 62#define __get_unaligned_le(ptr) \
63 ({ \ 63 ((__force typeof(*(ptr)))({ \
64 const __u8 *__p = (const __u8 *)(ptr); \ 64 const __u8 *__p = (const __u8 *)(ptr); \
65 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \ 65 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
66 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_le(__p), \ 66 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_le(__p), \
67 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_le(__p), \ 67 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_le(__p), \
68 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_le(__p), \ 68 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_le(__p), \
69 (void)__bug_unaligned_x(__p))))); \ 69 (void)__bug_unaligned_x(__p))))); \
70 }) 70 }))
71 71
72#define __get_unaligned_be(ptr) \ 72#define __get_unaligned_be(ptr) \
73 ({ \ 73 ((__force typeof(*(ptr)))({ \
74 const __u8 *__p = (const __u8 *)(ptr); \ 74 const __u8 *__p = (const __u8 *)(ptr); \
75 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \ 75 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
76 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_be(__p), \ 76 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_be(__p), \
77 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_be(__p), \ 77 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_be(__p), \
78 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_be(__p), \ 78 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_be(__p), \
79 (void)__bug_unaligned_x(__p))))); \ 79 (void)__bug_unaligned_x(__p))))); \
80 }) 80 }))
81 81
82 82
83static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p) 83static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p)
@@ -131,15 +131,16 @@ static inline void __put_unaligned_8_be(const unsigned long long __v, register _
131 */ 131 */
132#define __put_unaligned_le(val,ptr) \ 132#define __put_unaligned_le(val,ptr) \
133 ({ \ 133 ({ \
134 (void)sizeof(*(ptr) = (val)); \
134 switch (sizeof(*(ptr))) { \ 135 switch (sizeof(*(ptr))) { \
135 case 1: \ 136 case 1: \
136 *(ptr) = (val); \ 137 *(ptr) = (val); \
137 break; \ 138 break; \
138 case 2: __put_unaligned_2_le((val),(__u8 *)(ptr)); \ 139 case 2: __put_unaligned_2_le((__force u16)(val),(__u8 *)(ptr)); \
139 break; \ 140 break; \
140 case 4: __put_unaligned_4_le((val),(__u8 *)(ptr)); \ 141 case 4: __put_unaligned_4_le((__force u32)(val),(__u8 *)(ptr)); \
141 break; \ 142 break; \
142 case 8: __put_unaligned_8_le((val),(__u8 *)(ptr)); \ 143 case 8: __put_unaligned_8_le((__force u64)(val),(__u8 *)(ptr)); \
143 break; \ 144 break; \
144 default: __bug_unaligned_x(ptr); \ 145 default: __bug_unaligned_x(ptr); \
145 break; \ 146 break; \
@@ -149,15 +150,16 @@ static inline void __put_unaligned_8_be(const unsigned long long __v, register _
149 150
150#define __put_unaligned_be(val,ptr) \ 151#define __put_unaligned_be(val,ptr) \
151 ({ \ 152 ({ \
153 (void)sizeof(*(ptr) = (val)); \
152 switch (sizeof(*(ptr))) { \ 154 switch (sizeof(*(ptr))) { \
153 case 1: \ 155 case 1: \
154 *(ptr) = (val); \ 156 *(ptr) = (val); \
155 break; \ 157 break; \
156 case 2: __put_unaligned_2_be((val),(__u8 *)(ptr)); \ 158 case 2: __put_unaligned_2_be((__force u16)(val),(__u8 *)(ptr)); \
157 break; \ 159 break; \
158 case 4: __put_unaligned_4_be((val),(__u8 *)(ptr)); \ 160 case 4: __put_unaligned_4_be((__force u32)(val),(__u8 *)(ptr)); \
159 break; \ 161 break; \
160 case 8: __put_unaligned_8_be((val),(__u8 *)(ptr)); \ 162 case 8: __put_unaligned_8_be((__force u64)(val),(__u8 *)(ptr)); \
161 break; \ 163 break; \
162 default: __bug_unaligned_x(ptr); \ 164 default: __bug_unaligned_x(ptr); \
163 break; \ 165 break; \
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h
index c4d6cbbf96d..a970781a0f9 100644
--- a/include/asm-blackfin/bfin-global.h
+++ b/include/asm-blackfin/bfin-global.h
@@ -61,6 +61,7 @@ extern void bfin_dcache_init(void);
61extern int read_iloc(void); 61extern int read_iloc(void);
62extern int bfin_console_init(void); 62extern int bfin_console_init(void);
63extern asmlinkage void lower_to_irq14(void); 63extern asmlinkage void lower_to_irq14(void);
64extern void init_exception_vectors(void);
64extern void init_dma(void); 65extern void init_dma(void);
65extern void program_IAR(void); 66extern void program_IAR(void);
66extern void evt14_softirq(void); 67extern void evt14_softirq(void);
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
index 98d35a92911..cdf29e75ea5 100644
--- a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
@@ -242,6 +242,39 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
242#define bfin_read_TWI0_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16) 242#define bfin_read_TWI0_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16)
243#define bfin_write_TWI0_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val) 243#define bfin_write_TWI0_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val)
244 244
245#define bfin_read_TWI_CLKDIV() bfin_read16(TWI0_CLKDIV)
246#define bfin_write_TWI_CLKDIV(val) bfin_write16(TWI0_CLKDIV, val)
247#define bfin_read_TWI_CONTROL() bfin_read16(TWI0_CONTROL)
248#define bfin_write_TWI_CONTROL(val) bfin_write16(TWI0_CONTROL, val)
249#define bfin_read_TWI_SLAVE_CTRL() bfin_read16(TWI0_SLAVE_CTRL)
250#define bfin_write_TWI_SLAVE_CTRL(val) bfin_write16(TWI0_SLAVE_CTRL, val)
251#define bfin_read_TWI_SLAVE_STAT() bfin_read16(TWI0_SLAVE_STAT)
252#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI0_SLAVE_STAT, val)
253#define bfin_read_TWI_SLAVE_ADDR() bfin_read16(TWI0_SLAVE_ADDR)
254#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI0_SLAVE_ADDR, val)
255#define bfin_read_TWI_MASTER_CTL() bfin_read16(TWI0_MASTER_CTRL)
256#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI0_MASTER_CTRL, val)
257#define bfin_read_TWI_MASTER_STAT() bfin_read16(TWI0_MASTER_STAT)
258#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI0_MASTER_STAT, val)
259#define bfin_read_TWI_MASTER_ADDR() bfin_read16(TWI0_MASTER_ADDR)
260#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI0_MASTER_ADDR, val)
261#define bfin_read_TWI_INT_STAT() bfin_read16(TWI0_INT_STAT)
262#define bfin_write_TWI_INT_STAT(val) bfin_write16(TWI0_INT_STAT, val)
263#define bfin_read_TWI_INT_MASK() bfin_read16(TWI0_INT_MASK)
264#define bfin_write_TWI_INT_MASK(val) bfin_write16(TWI0_INT_MASK, val)
265#define bfin_read_TWI_FIFO_CTL() bfin_read16(TWI0_FIFO_CTRL)
266#define bfin_write_TWI_FIFO_CTL(val) bfin_write16(TWI0_FIFO_CTRL, val)
267#define bfin_read_TWI_FIFO_STAT() bfin_read16(TWI0_FIFO_STAT)
268#define bfin_write_TWI_FIFO_STAT(val) bfin_write16(TWI0_FIFO_STAT, val)
269#define bfin_read_TWI_XMT_DATA8() bfin_read16(TWI0_XMT_DATA8)
270#define bfin_write_TWI_XMT_DATA8(val) bfin_write16(TWI0_XMT_DATA8, val)
271#define bfin_read_TWI_XMT_DATA16() bfin_read16(TWI0_XMT_DATA16)
272#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI0_XMT_DATA16, val)
273#define bfin_read_TWI_RCV_DATA8() bfin_read16(TWI0_RCV_DATA8)
274#define bfin_write_TWI_RCV_DATA8(val) bfin_write16(TWI0_RCV_DATA8, val)
275#define bfin_read_TWI_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16)
276#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val)
277
245/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */ 278/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */
246 279
247/* SPORT1 Registers */ 280/* SPORT1 Registers */
diff --git a/include/asm-blackfin/mach-bf548/irq.h b/include/asm-blackfin/mach-bf548/irq.h
index 0b3325bb1ff..e548d3cd81e 100644
--- a/include/asm-blackfin/mach-bf548/irq.h
+++ b/include/asm-blackfin/mach-bf548/irq.h
@@ -112,6 +112,7 @@ Events (highest priority) EMU 0
112#define IRQ_ATAPI_TX BFIN_IRQ(44) /* ATAPI TX (DMA11) Interrupt */ 112#define IRQ_ATAPI_TX BFIN_IRQ(44) /* ATAPI TX (DMA11) Interrupt */
113#define IRQ_TWI0 BFIN_IRQ(45) /* TWI0 Interrupt */ 113#define IRQ_TWI0 BFIN_IRQ(45) /* TWI0 Interrupt */
114#define IRQ_TWI1 BFIN_IRQ(46) /* TWI1 Interrupt */ 114#define IRQ_TWI1 BFIN_IRQ(46) /* TWI1 Interrupt */
115#define IRQ_TWI IRQ_TWI0 /* TWI Interrupt */
115#define IRQ_CAN0_RX BFIN_IRQ(47) /* CAN0 Receive Interrupt */ 116#define IRQ_CAN0_RX BFIN_IRQ(47) /* CAN0 Receive Interrupt */
116#define IRQ_CAN0_TX BFIN_IRQ(48) /* CAN0 Transmit Interrupt */ 117#define IRQ_CAN0_TX BFIN_IRQ(48) /* CAN0 Transmit Interrupt */
117#define IRQ_MDMAS2 BFIN_IRQ(49) /* MDMA Stream 2 Interrupt */ 118#define IRQ_MDMAS2 BFIN_IRQ(49) /* MDMA Stream 2 Interrupt */
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h b/include/asm-blackfin/mach-bf561/cdefBF561.h
index 1a8ec9e4692..6e87ab269ff 100644
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -81,6 +81,12 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
81#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val) 81#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
82#define bfin_read_CHIPID() bfin_read32(CHIPID) 82#define bfin_read_CHIPID() bfin_read32(CHIPID)
83 83
84/* For MMR's that are reserved on Core B, set up defines to better integrate with other ports */
85#define bfin_read_SWRST() bfin_read_SICA_SWRST()
86#define bfin_write_SWRST() bfin_write_SICA_SWRST()
87#define bfin_read_SYSCR() bfin_read_SICA_SYSCR()
88#define bfin_write_SYSCR() bfin_write_SICA_SYSCR()
89
84/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */ 90/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
85#define bfin_read_SICA_SWRST() bfin_read16(SICA_SWRST) 91#define bfin_read_SICA_SWRST() bfin_read16(SICA_SWRST)
86#define bfin_write_SICA_SWRST(val) bfin_write16(SICA_SWRST,val) 92#define bfin_write_SICA_SWRST(val) bfin_write16(SICA_SWRST,val)
diff --git a/include/asm-blackfin/mach-bf561/defBF561.h b/include/asm-blackfin/mach-bf561/defBF561.h
index 89150ecb909..0f2dc6e6335 100644
--- a/include/asm-blackfin/mach-bf561/defBF561.h
+++ b/include/asm-blackfin/mach-bf561/defBF561.h
@@ -52,6 +52,10 @@
52#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */ 52#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */
53#define CHIPID 0xFFC00014 /* Chip ID Register */ 53#define CHIPID 0xFFC00014 /* Chip ID Register */
54 54
55/* For MMR's that are reserved on Core B, set up defines to better integrate with other ports */
56#define SWRST SICA_SWRST
57#define SYSCR SICA_SYSCR
58
55/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */ 59/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
56#define SICA_SWRST 0xFFC00100 /* Software Reset register */ 60#define SICA_SWRST 0xFFC00100 /* Software Reset register */
57#define SICA_SYSCR 0xFFC00104 /* System Reset Configuration register */ 61#define SICA_SYSCR 0xFFC00104 /* System Reset Configuration register */
diff --git a/include/asm-blackfin/thread_info.h b/include/asm-blackfin/thread_info.h
index fa8f08cf283..34d3c2eec94 100644
--- a/include/asm-blackfin/thread_info.h
+++ b/include/asm-blackfin/thread_info.h
@@ -39,6 +39,11 @@
39 */ 39 */
40#define ALIGN_PAGE_MASK 0xffffe000 40#define ALIGN_PAGE_MASK 0xffffe000
41 41
42/*
43 * Size of kernel stack for each process. This must be a power of 2...
44 */
45#define THREAD_SIZE 8192 /* 2 pages */
46
42#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
43 48
44typedef unsigned long mm_segment_t; 49typedef unsigned long mm_segment_t;
@@ -76,11 +81,6 @@ struct thread_info {
76#define init_thread_info (init_thread_union.thread_info) 81#define init_thread_info (init_thread_union.thread_info)
77#define init_stack (init_thread_union.stack) 82#define init_stack (init_thread_union.stack)
78 83
79/*
80 * Size of kernel stack for each process. This must be a power of 2...
81 */
82#define THREAD_SIZE 8192 /* 2 pages */
83
84/* How to get the thread information struct from C */ 84/* How to get the thread information struct from C */
85 85
86static inline struct thread_info *current_thread_info(void) 86static inline struct thread_info *current_thread_info(void)
@@ -94,7 +94,7 @@ static inline struct thread_info *current_thread_info(void)
94 struct thread_info *ti; 94 struct thread_info *ti;
95 __asm__("%0 = sp;": "=&d"(ti): 95 __asm__("%0 = sp;": "=&d"(ti):
96 ); 96 );
97 return (struct thread_info *)((long)ti & ~8191UL); 97 return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1));
98} 98}
99 99
100/* thread information allocation */ 100/* thread information allocation */
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index 449f3f272e0..125179adf04 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -121,19 +121,6 @@ static inline void acpi_disable_pci(void)
121} 121}
122extern int acpi_irq_balance_set(char *str); 122extern int acpi_irq_balance_set(char *str);
123 123
124#else /* !CONFIG_ACPI */
125
126#define acpi_lapic 0
127#define acpi_ioapic 0
128static inline void acpi_noirq_set(void) { }
129static inline void acpi_disable_pci(void) { }
130static inline void disable_acpi(void) { }
131
132#endif /* !CONFIG_ACPI */
133
134
135#ifdef CONFIG_ACPI_SLEEP
136
137/* routines for saving/restoring kernel state */ 124/* routines for saving/restoring kernel state */
138extern int acpi_save_state_mem(void); 125extern int acpi_save_state_mem(void);
139extern void acpi_restore_state_mem(void); 126extern void acpi_restore_state_mem(void);
@@ -143,7 +130,15 @@ extern unsigned long acpi_wakeup_address;
143/* early initialization routine */ 130/* early initialization routine */
144extern void acpi_reserve_bootmem(void); 131extern void acpi_reserve_bootmem(void);
145 132
146#endif /*CONFIG_ACPI_SLEEP*/ 133#else /* !CONFIG_ACPI */
134
135#define acpi_lapic 0
136#define acpi_ioapic 0
137static inline void acpi_noirq_set(void) { }
138static inline void acpi_disable_pci(void) { }
139static inline void disable_acpi(void) { }
140
141#endif /* !CONFIG_ACPI */
147 142
148#define ARCH_HAS_POWER_INIT 1 143#define ARCH_HAS_POWER_INIT 1
149 144
diff --git a/include/asm-i386/bootparam.h b/include/asm-i386/bootparam.h
index 427d8652bfd..b91b01783e4 100644
--- a/include/asm-i386/bootparam.h
+++ b/include/asm-i386/bootparam.h
@@ -4,8 +4,9 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/screen_info.h> 5#include <linux/screen_info.h>
6#include <linux/apm_bios.h> 6#include <linux/apm_bios.h>
7#include <asm/e820.h>
8#include <linux/edd.h> 7#include <linux/edd.h>
8#include <asm/e820.h>
9#include <asm/ist.h>
9#include <video/edid.h> 10#include <video/edid.h>
10 11
11struct setup_header { 12struct setup_header {
@@ -48,9 +49,9 @@ struct efi_info {
48 u32 _pad1; 49 u32 _pad1;
49 u32 efi_systab; 50 u32 efi_systab;
50 u32 efi_memdesc_size; 51 u32 efi_memdesc_size;
51 u32 efi_memdec_version; 52 u32 efi_memdesc_version;
52 u32 efi_memmap; 53 u32 efi_memmap;
53 u32 fi_memmap_size; 54 u32 efi_memmap_size;
54 u32 _pad2[2]; 55 u32 _pad2[2];
55}; 56};
56 57
@@ -59,7 +60,7 @@ struct boot_params {
59 struct screen_info screen_info; /* 0x000 */ 60 struct screen_info screen_info; /* 0x000 */
60 struct apm_bios_info apm_bios_info; /* 0x040 */ 61 struct apm_bios_info apm_bios_info; /* 0x040 */
61 u8 _pad2[12]; /* 0x054 */ 62 u8 _pad2[12]; /* 0x054 */
62 u32 speedstep_info[4]; /* 0x060 */ 63 struct ist_info ist_info; /* 0x060 */
63 u8 _pad3[16]; /* 0x070 */ 64 u8 _pad3[16]; /* 0x070 */
64 u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ 65 u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
65 u8 hd1_info[16]; /* obsolete! */ /* 0x090 */ 66 u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h
index 43114c82460..cf67dbb1db7 100644
--- a/include/asm-i386/e820.h
+++ b/include/asm-i386/e820.h
@@ -47,7 +47,7 @@ extern void e820_register_memory(void);
47extern void limit_regions(unsigned long long size); 47extern void limit_regions(unsigned long long size);
48extern void print_memory_map(char *who); 48extern void print_memory_map(char *who);
49 49
50#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) 50#if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION)
51extern void e820_mark_nosave_regions(void); 51extern void e820_mark_nosave_regions(void);
52#else 52#else
53static inline void e820_mark_nosave_regions(void) 53static inline void e820_mark_nosave_regions(void)
diff --git a/include/asm-i386/ist.h b/include/asm-i386/ist.h
index d13d1e68afa..ef2003ebc6f 100644
--- a/include/asm-i386/ist.h
+++ b/include/asm-i386/ist.h
@@ -19,11 +19,13 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/types.h>
23
22struct ist_info { 24struct ist_info {
23 unsigned long signature; 25 u32 signature;
24 unsigned long command; 26 u32 command;
25 unsigned long event; 27 u32 event;
26 unsigned long perf_level; 28 u32 perf_level;
27}; 29};
28 30
29extern struct ist_info ist_info; 31extern struct ist_info ist_info;
diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
index 8dbaafe611f..a2520732ffd 100644
--- a/include/asm-i386/suspend.h
+++ b/include/asm-i386/suspend.h
@@ -21,7 +21,7 @@ struct saved_context {
21 unsigned long return_address; 21 unsigned long return_address;
22} __attribute__((packed)); 22} __attribute__((packed));
23 23
24#ifdef CONFIG_ACPI_SLEEP 24#ifdef CONFIG_ACPI
25extern unsigned long saved_eip; 25extern unsigned long saved_eip;
26extern unsigned long saved_esp; 26extern unsigned long saved_esp;
27extern unsigned long saved_ebp; 27extern unsigned long saved_ebp;
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 5b526357d17..49730ffbbae 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -100,6 +100,11 @@ const char *acpi_get_sysname (void);
100int acpi_request_vector (u32 int_type); 100int acpi_request_vector (u32 int_type);
101int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 101int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
102 102
103/* routines for saving/restoring kernel state */
104extern int acpi_save_state_mem(void);
105extern void acpi_restore_state_mem(void);
106extern unsigned long acpi_wakeup_address;
107
103/* 108/*
104 * Record the cpei override flag and current logical cpu. This is 109 * Record the cpei override flag and current logical cpu. This is
105 * useful for CPU removal. 110 * useful for CPU removal.
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h
index 5ff8d74c3e0..2390ee145aa 100644
--- a/include/asm-ia64/ia32.h
+++ b/include/asm-ia64/ia32.h
@@ -27,11 +27,12 @@ extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs)
27extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info, 27extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
28 sigset_t *set, struct pt_regs *regs); 28 sigset_t *set, struct pt_regs *regs);
29#if PAGE_SHIFT > IA32_PAGE_SHIFT 29#if PAGE_SHIFT > IA32_PAGE_SHIFT
30extern int ia32_copy_partial_page_list (struct task_struct *, unsigned long); 30extern int ia32_copy_ia64_partial_page_list(struct task_struct *,
31extern void ia32_drop_partial_page_list (struct task_struct *); 31 unsigned long);
32extern void ia32_drop_ia64_partial_page_list(struct task_struct *);
32#else 33#else
33# define ia32_copy_partial_page_list(a1, a2) 0 34# define ia32_copy_ia64_partial_page_list(a1, a2) 0
34# define ia32_drop_partial_page_list(a1) do { ; } while (0) 35# define ia32_drop_ia64_partial_page_list(a1) do { ; } while (0)
35#endif 36#endif
36 37
37#endif /* !__ASSEMBLY__ */ 38#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index ca33eb181ff..5cf8bf1e805 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -275,6 +275,7 @@ struct ia64_machine_vector {
275 275
276extern struct ia64_machine_vector ia64_mv; 276extern struct ia64_machine_vector ia64_mv;
277extern void machvec_init (const char *name); 277extern void machvec_init (const char *name);
278extern void machvec_init_from_cmdline(const char *cmdline);
278 279
279# else 280# else
280# error Unknown configuration. Update asm-ia64/machvec.h. 281# error Unknown configuration. Update asm-ia64/machvec.h.
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 6251c76437d..be3b0ae4327 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -220,7 +220,7 @@ struct desc_struct {
220 220
221#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) 221#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
222 222
223struct partial_page_list; 223struct ia64_partial_page_list;
224#endif 224#endif
225 225
226struct thread_struct { 226struct thread_struct {
@@ -242,7 +242,7 @@ struct thread_struct {
242 __u64 fdr; /* IA32 fp except. data reg */ 242 __u64 fdr; /* IA32 fp except. data reg */
243 __u64 old_k1; /* old value of ar.k1 */ 243 __u64 old_k1; /* old value of ar.k1 */
244 __u64 old_iob; /* old IOBase value */ 244 __u64 old_iob; /* old IOBase value */
245 struct partial_page_list *ppl; /* partial page list for 4K page size issue */ 245 struct ia64_partial_page_list *ppl; /* partial page list for 4K page size issue */
246 /* cached TLS descriptors. */ 246 /* cached TLS descriptors. */
247 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; 247 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
248 248
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index c60024989eb..6314b29e8c4 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -116,7 +116,6 @@ max_xtp (void)
116extern int __cpu_disable (void); 116extern int __cpu_disable (void);
117extern void __cpu_die (unsigned int cpu); 117extern void __cpu_die (unsigned int cpu);
118extern void cpu_die (void) __attribute__ ((noreturn)); 118extern void cpu_die (void) __attribute__ ((noreturn));
119extern int __cpu_up (unsigned int cpu);
120extern void __init smp_build_cpu_map(void); 119extern void __init smp_build_cpu_map(void);
121 120
122extern void __init init_smp_config (void); 121extern void __init init_smp_config (void);
diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h
index 91c623f0994..d9eb9834ccc 100644
--- a/include/asm-m68k/raw_io.h
+++ b/include/asm-m68k/raw_io.h
@@ -36,15 +36,15 @@ extern void __iounmap(void *addr, unsigned long size);
36#define in_be32(addr) \ 36#define in_be32(addr) \
37 ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) 37 ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; })
38#define in_le16(addr) \ 38#define in_le16(addr) \
39 ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) 39 ({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (addr)); __v; })
40#define in_le32(addr) \ 40#define in_le32(addr) \
41 ({ u32 __v = le32_to_cpu(*(__force volatile u32 *) (addr)); __v; }) 41 ({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (addr)); __v; })
42 42
43#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) 43#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b))
44#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w)) 44#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w))
45#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l)) 45#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l))
46#define out_le16(addr,w) (void)((*(__force volatile u16 *) (addr)) = cpu_to_le16(w)) 46#define out_le16(addr,w) (void)((*(__force volatile __le16 *) (addr)) = cpu_to_le16(w))
47#define out_le32(addr,l) (void)((*(__force volatile u32 *) (addr)) = cpu_to_le32(l)) 47#define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
48 48
49#define raw_inb in_8 49#define raw_inb in_8
50#define raw_inw in_be16 50#define raw_inw in_be16
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index 198878b53a6..caa9b1663e4 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -46,6 +46,22 @@ asmlinkage void resume(void);
46} while (0) 46} while (0)
47 47
48 48
49/*
50 * Force strict CPU ordering.
51 * Not really required on m68k...
52 */
53#define nop() do { asm volatile ("nop"); barrier(); } while (0)
54#define mb() barrier()
55#define rmb() barrier()
56#define wmb() barrier()
57#define read_barrier_depends() ((void)0)
58#define set_mb(var, value) ({ (var) = (value); wmb(); })
59
60#define smp_mb() barrier()
61#define smp_rmb() barrier()
62#define smp_wmb() barrier()
63#define smp_read_barrier_depends() ((void)0)
64
49/* interrupt control.. */ 65/* interrupt control.. */
50#if 0 66#if 0
51#define local_irq_enable() asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory") 67#define local_irq_enable() asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory")
@@ -70,23 +86,6 @@ static inline int irqs_disabled(void)
70/* For spinlocks etc */ 86/* For spinlocks etc */
71#define local_irq_save(x) ({ local_save_flags(x); local_irq_disable(); }) 87#define local_irq_save(x) ({ local_save_flags(x); local_irq_disable(); })
72 88
73/*
74 * Force strict CPU ordering.
75 * Not really required on m68k...
76 */
77#define nop() do { asm volatile ("nop"); barrier(); } while (0)
78#define mb() barrier()
79#define rmb() barrier()
80#define wmb() barrier()
81#define read_barrier_depends() ((void)0)
82#define set_mb(var, value) ({ (var) = (value); wmb(); })
83
84#define smp_mb() barrier()
85#define smp_rmb() barrier()
86#define smp_wmb() barrier()
87#define smp_read_barrier_depends() ((void)0)
88
89
90#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 89#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
91 90
92struct __xchg_dummy { unsigned long a[100]; }; 91struct __xchg_dummy { unsigned long a[100]; };
diff --git a/include/asm-m68knommu/hardirq.h b/include/asm-m68knommu/hardirq.h
index 980075bab79..bfad28149a4 100644
--- a/include/asm-m68knommu/hardirq.h
+++ b/include/asm-m68knommu/hardirq.h
@@ -22,4 +22,6 @@ typedef struct {
22# error HARDIRQ_BITS is too low! 22# error HARDIRQ_BITS is too low!
23#endif 23#endif
24 24
25void ack_bad_irq(unsigned int irq);
26
25#endif /* __M68K_HARDIRQ_H */ 27#endif /* __M68K_HARDIRQ_H */
diff --git a/include/asm-m68knommu/hw_irq.h b/include/asm-m68knommu/hw_irq.h
new file mode 100644
index 00000000000..f3ec9e5ae04
--- /dev/null
+++ b/include/asm-m68knommu/hw_irq.h
@@ -0,0 +1,4 @@
1#ifndef __M68KNOMMU_HW_IRQ_H__
2#define __M68KNOMMU_HW_IRQ_H__
3
4#endif /* __M68KNOMMU_HW_IRQ_H__ */
diff --git a/include/asm-m68knommu/machdep.h b/include/asm-m68knommu/machdep.h
index 6ce28f8e0ea..708d7863ba6 100644
--- a/include/asm-m68knommu/machdep.h
+++ b/include/asm-m68knommu/machdep.h
@@ -1,53 +1,21 @@
1#ifndef _M68KNOMMU_MACHDEP_H 1#ifndef _M68KNOMMU_MACHDEP_H
2#define _M68KNOMMU_MACHDEP_H 2#define _M68KNOMMU_MACHDEP_H
3 3
4#include <linux/seq_file.h>
5#include <linux/interrupt.h> 4#include <linux/interrupt.h>
6 5
7struct pt_regs; 6extern void (*mach_sched_init) (irq_handler_t handler);
8struct kbd_repeat;
9struct mktime;
10struct hwclk_time;
11struct gendisk;
12struct buffer_head;
13
14extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *));
15/* machine dependent keyboard functions */
16extern int (*mach_keyb_init) (void);
17extern int (*mach_kbdrate) (struct kbd_repeat *);
18extern void (*mach_kbd_leds) (unsigned int);
19/* machine dependent irq functions */
20extern void (*mach_init_IRQ) (void);
21extern irq_handler_t mach_default_handler;
22extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
23 unsigned long flags, const char *devname, void *dev_id);
24extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
25extern void (*mach_get_model) (char *model);
26extern int (*mach_get_hardware_list) (char *buffer);
27extern int (*mach_get_irq_list) (struct seq_file *p, void *v);
28extern void (*mach_process_int) (int irq, struct pt_regs *fp);
29/* machine dependent timer functions */ 7/* machine dependent timer functions */
30extern unsigned long (*mach_gettimeoffset)(void); 8extern unsigned long (*mach_gettimeoffset)(void);
31extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour, 9extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
32 int *min, int *sec); 10 int *min, int *sec);
33extern int (*mach_hwclk)(int, struct hwclk_time*);
34extern int (*mach_set_clock_mmss)(unsigned long); 11extern int (*mach_set_clock_mmss)(unsigned long);
12
13/* machine dependent power off functions */
35extern void (*mach_reset)( void ); 14extern void (*mach_reset)( void );
36extern void (*mach_halt)( void ); 15extern void (*mach_halt)( void );
37extern void (*mach_power_off)( void ); 16extern void (*mach_power_off)( void );
38extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
39extern void (*mach_hd_setup)(char *, int *);
40extern long mach_max_dma_address;
41extern void (*mach_floppy_eject)(void);
42extern void (*mach_heartbeat) (int);
43extern void (*mach_l2_flush) (int);
44extern int mach_sysrq_key;
45extern int mach_sysrq_shift_state;
46extern int mach_sysrq_shift_mask;
47extern char *mach_sysrq_xlate;
48 17
49extern void config_BSP(char *command, int len); 18extern void config_BSP(char *command, int len);
50extern void (*mach_tick)(void); 19extern void (*mach_tick)(void);
51extern void (*mach_trap_init)(void);
52 20
53#endif /* _M68KNOMMU_MACHDEP_H */ 21#endif /* _M68KNOMMU_MACHDEP_H */
diff --git a/include/asm-m68knommu/mcfdma.h b/include/asm-m68knommu/mcfdma.h
index ea729e81a6b..705c52c79cd 100644
--- a/include/asm-m68knommu/mcfdma.h
+++ b/include/asm-m68knommu/mcfdma.h
@@ -133,7 +133,7 @@
133#define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */ 133#define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */
134#define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */ 134#define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */
135#define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */ 135#define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */
136#define MCFDMA_DIR_INV 0x1000 /* Invalid Combination */ 136#define MCFDMA_DIR_INV 0x0010 /* Invalid Combination */
137#define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */ 137#define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */
138#define MCFDMA_DIR_TE 0x0002 /* Transfer Error */ 138#define MCFDMA_DIR_TE 0x0002 /* Transfer Error */
139#define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */ 139#define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 5e5ed18bb78..5da43a5d12a 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -296,7 +296,7 @@ cmpxchg(volatile int *p, int old, int new)
296({ \ 296({ \
297 unsigned char volatile *reset; \ 297 unsigned char volatile *reset; \
298 asm("move.w #0x2700, %sr"); \ 298 asm("move.w #0x2700, %sr"); \
299 reset = ((volatile unsigned short *)(MCF_IPSBAR + 0x110000)); \ 299 reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000)); \
300 while(1) \ 300 while(1) \
301 *reset |= (0x01 << 7);\ 301 *reset |= (0x01 << 7);\
302}) 302})
@@ -318,7 +318,7 @@ cmpxchg(volatile int *p, int old, int new)
318({ \ 318({ \
319 unsigned char volatile *reset; \ 319 unsigned char volatile *reset; \
320 asm("move.w #0x2700, %sr"); \ 320 asm("move.w #0x2700, %sr"); \
321 reset = ((volatile unsigned short *)(MCF_IPSBAR + 0xA0000)); \ 321 reset = ((volatile unsigned char *)(MCF_IPSBAR + 0xA0000)); \
322 while(1) \ 322 while(1) \
323 *reset |= 0x80; \ 323 *reset |= 0x80; \
324}) 324})
diff --git a/include/asm-m68knommu/timex.h b/include/asm-m68knommu/timex.h
index 85069998db5..109050f3fe9 100644
--- a/include/asm-m68knommu/timex.h
+++ b/include/asm-m68knommu/timex.h
@@ -1 +1,23 @@
1#include <asm-m68k/timex.h> 1/*
2 * linux/include/asm-m68knommu/timex.h
3 *
4 * m68knommu architecture timex specifications
5 */
6#ifndef _ASM_M68KNOMMU_TIMEX_H
7#define _ASM_M68KNOMMU_TIMEX_H
8
9#ifdef CONFIG_COLDFIRE
10#include <asm/coldfire.h>
11#define CLOCK_TICK_RATE MCF_CLK
12#else
13#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
14#endif
15
16typedef unsigned long cycles_t;
17
18static inline cycles_t get_cycles(void)
19{
20 return 0;
21}
22
23#endif
diff --git a/include/asm-mips/edac.h b/include/asm-mips/edac.h
new file mode 100644
index 00000000000..83719eee2d1
--- /dev/null
+++ b/include/asm-mips/edac.h
@@ -0,0 +1,35 @@
1#ifndef ASM_EDAC_H
2#define ASM_EDAC_H
3
4/* ECC atomic, DMA, SMP and interrupt safe scrub function */
5
6static inline void atomic_scrub(void *va, u32 size)
7{
8 unsigned long *virt_addr = va;
9 unsigned long temp;
10 u32 i;
11
12 for (i = 0; i < size / sizeof(unsigned long); i++, virt_addr++) {
13
14 /*
15 * Very carefully read and write to memory atomically
16 * so we are interrupt, DMA and SMP safe.
17 *
18 * Intel: asm("lock; addl $0, %0"::"m"(*virt_addr));
19 */
20
21 __asm__ __volatile__ (
22 " .set mips3 \n"
23 "1: ll %0, %1 # atomic_add \n"
24 " ll %0, %1 # atomic_add \n"
25 " addu %0, $0 \n"
26 " sc %0, %1 \n"
27 " beqz %0, 1b \n"
28 " .set mips0 \n"
29 : "=&r" (temp), "=m" (*virt_addr)
30 : "m" (*virt_addr));
31
32 }
33}
34
35#endif
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index 9de52a5b0f3..2883ccc69ed 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -188,7 +188,6 @@
188#define ICACHE_REFILLS_WORKAROUND_WAR 1 188#define ICACHE_REFILLS_WORKAROUND_WAR 1
189#endif 189#endif
190 190
191
192/* 191/*
193 * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that 192 * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that
194 * may cause ll / sc and lld / scd sequences to execute non-atomically. 193 * may cause ll / sc and lld / scd sequences to execute non-atomically.
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index f6fa3947484..a248b8bd4d7 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -79,7 +79,7 @@
79 _EMIT_BUG_ENTRY \ 79 _EMIT_BUG_ENTRY \
80 : : "i" (__FILE__), "i" (__LINE__), "i" (0), \ 80 : : "i" (__FILE__), "i" (__LINE__), "i" (0), \
81 "i" (sizeof(struct bug_entry)), \ 81 "i" (sizeof(struct bug_entry)), \
82 "r" ((long)(x))); \ 82 "r" ((__force long)(x))); \
83 } \ 83 } \
84} while (0) 84} while (0)
85 85
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index 10c51f457d4..236a9210e5f 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -190,7 +190,6 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr,
190extern int page_is_ram(unsigned long pfn); 190extern int page_is_ram(unsigned long pfn);
191 191
192struct vm_area_struct; 192struct vm_area_struct;
193extern const char *arch_vma_name(struct vm_area_struct *vma);
194 193
195#include <asm-generic/memory_model.h> 194#include <asm-generic/memory_model.h>
196#endif /* __ASSEMBLY__ */ 195#endif /* __ASSEMBLY__ */
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index e72c2a60853..e909769b641 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -45,10 +45,17 @@ struct pci_controller {
45 * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS 45 * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS
46 * to determine which bus number to match on when generating type0 46 * to determine which bus number to match on when generating type0
47 * config cycles 47 * config cycles
48 * NO_PCIE_LINK - the Freescale PCI-e controllers have issues with
49 * hanging if we don't have link and try to do config cycles to
50 * anything but the PHB. Only allow talking to the PHB if this is
51 * set.
52 * BIG_ENDIAN - cfg_addr is a big endian register
48 */ 53 */
49#define PPC_INDIRECT_TYPE_SET_CFG_TYPE (0x00000001) 54#define PPC_INDIRECT_TYPE_SET_CFG_TYPE (0x00000001)
50#define PPC_INDIRECT_TYPE_EXT_REG (0x00000002) 55#define PPC_INDIRECT_TYPE_EXT_REG (0x00000002)
51#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004) 56#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
57#define PPC_INDIRECT_TYPE_NO_PCIE_LINK (0x00000008)
58#define PPC_INDIRECT_TYPE_BIG_ENDIAN (0x00000010)
52 u32 indirect_type; 59 u32 indirect_type;
53 60
54 /* Currently, we limit ourselves to 1 IO range and 3 mem 61 /* Currently, we limit ourselves to 1 IO range and 3 mem
@@ -64,6 +71,14 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
64 return bus->sysdata; 71 return bus->sysdata;
65} 72}
66 73
74static inline int isa_vaddr_is_ioport(void __iomem *address)
75{
76 /* No specific ISA handling on ppc32 at this stage, it
77 * all goes through PCI
78 */
79 return 0;
80}
81
67/* These are used for config access before all the PCI probing 82/* These are used for config access before all the PCI probing
68 has been done. */ 83 has been done. */
69int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, 84int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
@@ -79,11 +94,14 @@ int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
79int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn, 94int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
80 int where, u32 val); 95 int where, u32 val);
81 96
82extern void setup_indirect_pci_nomap(struct pci_controller* hose, 97extern int early_find_capability(struct pci_controller *hose, int bus,
83 void __iomem *cfg_addr, void __iomem *cfg_data); 98 int dev_fn, int cap);
99
84extern void setup_indirect_pci(struct pci_controller* hose, 100extern void setup_indirect_pci(struct pci_controller* hose,
85 u32 cfg_addr, u32 cfg_data); 101 u32 cfg_addr, u32 cfg_data, u32 flags);
86extern void setup_grackle(struct pci_controller *hose); 102extern void setup_grackle(struct pci_controller *hose);
103extern void __init update_bridge_resource(struct pci_dev *dev,
104 struct resource *res);
87 105
88#else 106#else
89 107
@@ -231,6 +249,13 @@ extern void pcibios_free_controller(struct pci_controller *phb);
231 249
232extern void isa_bridge_find_early(struct pci_controller *hose); 250extern void isa_bridge_find_early(struct pci_controller *hose);
233 251
252static inline int isa_vaddr_is_ioport(void __iomem *address)
253{
254 /* Check if address hits the reserved legacy IO range */
255 unsigned long ea = (unsigned long)address;
256 return ea >= ISA_IO_BASE && ea < ISA_IO_END;
257}
258
234extern int pcibios_unmap_io_space(struct pci_bus *bus); 259extern int pcibios_unmap_io_space(struct pci_bus *bus);
235extern int pcibios_map_io_space(struct pci_bus *bus); 260extern int pcibios_map_io_space(struct pci_bus *bus);
236 261
@@ -261,11 +286,16 @@ extern struct pci_controller *
261pcibios_alloc_controller(struct device_node *dev); 286pcibios_alloc_controller(struct device_node *dev);
262#ifdef CONFIG_PCI 287#ifdef CONFIG_PCI
263extern unsigned long pci_address_to_pio(phys_addr_t address); 288extern unsigned long pci_address_to_pio(phys_addr_t address);
289extern int pcibios_vaddr_is_ioport(void __iomem *address);
264#else 290#else
265static inline unsigned long pci_address_to_pio(phys_addr_t address) 291static inline unsigned long pci_address_to_pio(phys_addr_t address)
266{ 292{
267 return (unsigned long)-1; 293 return (unsigned long)-1;
268} 294}
295static inline int pcibios_vaddr_is_ioport(void __iomem *address)
296{
297 return 0;
298}
269#endif 299#endif
270 300
271 301
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index fa083d8e466..65325721446 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -181,6 +181,18 @@ name: \
181 .type GLUE(.,name),@function; \ 181 .type GLUE(.,name),@function; \
182GLUE(.,name): 182GLUE(.,name):
183 183
184#define _INIT_STATIC(name) \
185 .section ".text.init.refok"; \
186 .align 2 ; \
187 .section ".opd","aw"; \
188name: \
189 .quad GLUE(.,name); \
190 .quad .TOC.@tocbase; \
191 .quad 0; \
192 .previous; \
193 .type GLUE(.,name),@function; \
194GLUE(.,name):
195
184#else /* 32-bit */ 196#else /* 32-bit */
185 197
186#define _GLOBAL(n) \ 198#define _GLOBAL(n) \
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 0117b544ecb..3a0975e2ada 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -80,6 +80,11 @@ extern const void *vio_get_attribute(struct vio_dev *vdev, char *which,
80extern struct vio_dev *vio_find_node(struct device_node *vnode); 80extern struct vio_dev *vio_find_node(struct device_node *vnode);
81extern int vio_enable_interrupts(struct vio_dev *dev); 81extern int vio_enable_interrupts(struct vio_dev *dev);
82extern int vio_disable_interrupts(struct vio_dev *dev); 82extern int vio_disable_interrupts(struct vio_dev *dev);
83#else
84static inline int vio_enable_interrupts(struct vio_dev *dev)
85{
86 return 0;
87}
83#endif 88#endif
84 89
85static inline struct vio_driver *to_vio_driver(struct device_driver *drv) 90static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 4c2e1710f15..1aeda27d5a8 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -165,11 +165,6 @@ extern int ccw_device_resume(struct ccw_device *);
165extern int ccw_device_halt(struct ccw_device *, unsigned long); 165extern int ccw_device_halt(struct ccw_device *, unsigned long);
166extern int ccw_device_clear(struct ccw_device *, unsigned long); 166extern int ccw_device_clear(struct ccw_device *, unsigned long);
167 167
168extern int __deprecated read_dev_chars(struct ccw_device *cdev, void **buffer, int length);
169extern int __deprecated read_conf_data(struct ccw_device *cdev, void **buffer, int *length);
170extern int __deprecated read_conf_data_lpm(struct ccw_device *cdev, void **buffer,
171 int *length, __u8 lpm);
172
173extern int ccw_device_set_online(struct ccw_device *cdev); 168extern int ccw_device_set_online(struct ccw_device *cdev);
174extern int ccw_device_set_offline(struct ccw_device *cdev); 169extern int ccw_device_set_offline(struct ccw_device *cdev);
175 170
diff --git a/include/asm-s390/s390_ext.h b/include/asm-s390/s390_ext.h
index df9b1017b70..1e72362cad7 100644
--- a/include/asm-s390/s390_ext.h
+++ b/include/asm-s390/s390_ext.h
@@ -10,6 +10,8 @@
10 * Martin Schwidefsky (schwidefsky@de.ibm.com) 10 * Martin Schwidefsky (schwidefsky@de.ibm.com)
11 */ 11 */
12 12
13#include <linux/types.h>
14
13typedef void (*ext_int_handler_t)(__u16 code); 15typedef void (*ext_int_handler_t)(__u16 code);
14 16
15/* 17/*
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 76e424f718c..07708c07701 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -36,8 +36,7 @@ extern void machine_halt_smp(void);
36extern void machine_power_off_smp(void); 36extern void machine_power_off_smp(void);
37 37
38extern void smp_setup_cpu_possible_map(void); 38extern void smp_setup_cpu_possible_map(void);
39extern int smp_call_function_on(void (*func) (void *info), void *info, 39
40 int nonatomic, int wait, int cpu);
41#define NO_PROC_ID 0xFF /* No processor magic marker */ 40#define NO_PROC_ID 0xFF /* No processor magic marker */
42 41
43/* 42/*
@@ -96,14 +95,6 @@ extern int __cpu_up (unsigned int cpu);
96#endif 95#endif
97 96
98#ifndef CONFIG_SMP 97#ifndef CONFIG_SMP
99static inline int
100smp_call_function_on(void (*func) (void *info), void *info,
101 int nonatomic, int wait, int cpu)
102{
103 func(info);
104 return 0;
105}
106
107static inline void smp_send_stop(void) 98static inline void smp_send_stop(void)
108{ 99{
109 /* Disable all interrupts/machine checks */ 100 /* Disable all interrupts/machine checks */
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 790c1c55741..f04acb2670a 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -251,7 +251,7 @@
251#define __NR_getcpu 311 251#define __NR_getcpu 311
252#define __NR_epoll_pwait 312 252#define __NR_epoll_pwait 312
253#define __NR_utimes 313 253#define __NR_utimes 313
254/* Number 314 is reserved for new sys_fallocate */ 254#define __NR_fallocate 314
255#define __NR_utimensat 315 255#define __NR_utimensat 315
256#define __NR_signalfd 316 256#define __NR_signalfd 316
257#define __NR_timerfd 317 257#define __NR_timerfd 317
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index 1da8f49c0fe..98173357dd8 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -108,6 +108,15 @@ static inline void acpi_disable_pci(void)
108} 108}
109extern int acpi_irq_balance_set(char *str); 109extern int acpi_irq_balance_set(char *str);
110 110
111/* routines for saving/restoring kernel state */
112extern int acpi_save_state_mem(void);
113extern void acpi_restore_state_mem(void);
114
115extern unsigned long acpi_wakeup_address;
116
117/* early initialization routine */
118extern void acpi_reserve_bootmem(void);
119
111#else /* !CONFIG_ACPI */ 120#else /* !CONFIG_ACPI */
112 121
113#define acpi_lapic 0 122#define acpi_lapic 0
@@ -121,19 +130,6 @@ extern int acpi_numa;
121extern int acpi_scan_nodes(unsigned long start, unsigned long end); 130extern int acpi_scan_nodes(unsigned long start, unsigned long end);
122#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) 131#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
123 132
124#ifdef CONFIG_ACPI_SLEEP
125
126/* routines for saving/restoring kernel state */
127extern int acpi_save_state_mem(void);
128extern void acpi_restore_state_mem(void);
129
130extern unsigned long acpi_wakeup_address;
131
132/* early initialization routine */
133extern void acpi_reserve_bootmem(void);
134
135#endif /*CONFIG_ACPI_SLEEP*/
136
137extern int acpi_disabled; 133extern int acpi_disabled;
138extern int acpi_pci_disabled; 134extern int acpi_pci_disabled;
139 135
diff --git a/include/asm-x86_64/ist.h b/include/asm-x86_64/ist.h
new file mode 100644
index 00000000000..338857ecbc6
--- /dev/null
+++ b/include/asm-x86_64/ist.h
@@ -0,0 +1 @@
#include <asm-i386/ist.h>
diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h
index 9c3f8de90d2..b897e8cb55f 100644
--- a/include/asm-x86_64/suspend.h
+++ b/include/asm-x86_64/suspend.h
@@ -44,7 +44,6 @@ extern unsigned long saved_context_eflags;
44 44
45extern void fix_processor_context(void); 45extern void fix_processor_context(void);
46 46
47#ifdef CONFIG_ACPI_SLEEP
48extern unsigned long saved_rip; 47extern unsigned long saved_rip;
49extern unsigned long saved_rsp; 48extern unsigned long saved_rsp;
50extern unsigned long saved_rbp; 49extern unsigned long saved_rbp;
@@ -54,4 +53,3 @@ extern unsigned long saved_rdi;
54 53
55/* routines for saving/restoring kernel state */ 54/* routines for saving/restoring kernel state */
56extern int acpi_save_state_mem(void); 55extern int acpi_save_state_mem(void);
57#endif
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 9df30b939c4..f4ce8768ad4 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -100,7 +100,7 @@ struct exception_table_entry
100 case 8: __get_user_x(8,__ret_gu,__val_gu,ptr); break; \ 100 case 8: __get_user_x(8,__ret_gu,__val_gu,ptr); break; \
101 default: __get_user_bad(); break; \ 101 default: __get_user_bad(); break; \
102 } \ 102 } \
103 (x) = (typeof(*(ptr)))__val_gu; \ 103 (x) = (__force typeof(*(ptr)))__val_gu; \
104 __ret_gu; \ 104 __ret_gu; \
105}) 105})
106 106
@@ -192,7 +192,7 @@ struct __large_struct { unsigned long buf[100]; };
192 int __gu_err; \ 192 int __gu_err; \
193 unsigned long __gu_val; \ 193 unsigned long __gu_val; \
194 __get_user_size(__gu_val,(ptr),(size),__gu_err); \ 194 __get_user_size(__gu_val,(ptr),(size),__gu_err); \
195 (x) = (typeof(*(ptr)))__gu_val; \ 195 (x) = (__force typeof(*(ptr)))__gu_val; \
196 __gu_err; \ 196 __gu_err; \
197}) 197})
198 198
diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h
index 31ffc3f119c..0faa614d969 100644
--- a/include/asm-xtensa/io.h
+++ b/include/asm-xtensa/io.h
@@ -13,6 +13,7 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15#include <asm/byteorder.h> 15#include <asm/byteorder.h>
16#include <asm/page.h>
16 17
17#include <linux/types.h> 18#include <linux/types.h>
18 19
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d5680cd7746..bf5e0009de7 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 290aef32681..5f921c84827 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
28struct apm_bios_info { 30struct 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 695e34964cb..b126c6f68e2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -37,7 +37,7 @@
37struct scsi_ioctl_command; 37struct scsi_ioctl_command;
38 38
39struct request_queue; 39struct request_queue;
40typedef struct request_queue request_queue_t; 40typedef struct request_queue request_queue_t __deprecated;
41struct elevator_queue; 41struct elevator_queue;
42typedef struct elevator_queue elevator_t; 42typedef struct elevator_queue elevator_t;
43struct request_pm_state; 43struct 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
340typedef void (request_fn_proc) (request_queue_t *q); 340typedef void (request_fn_proc) (struct request_queue *q);
341typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); 341typedef int (make_request_fn) (struct request_queue *q, struct bio *bio);
342typedef int (prep_rq_fn) (request_queue_t *, struct request *); 342typedef int (prep_rq_fn) (struct request_queue *, struct request *);
343typedef void (unplug_fn) (request_queue_t *); 343typedef void (unplug_fn) (struct request_queue *);
344 344
345struct bio_vec; 345struct bio_vec;
346typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); 346typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *);
347typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); 347typedef int (issue_flush_fn) (struct request_queue *, struct gendisk *, sector_t *);
348typedef void (prepare_flush_fn) (request_queue_t *, struct request *); 348typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
349typedef void (softirq_done_fn)(struct request *); 349typedef void (softirq_done_fn)(struct request *);
350 350
351enum blk_queue_state { 351enum 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
628extern int init_emergency_isa_pool(void); 628extern int init_emergency_isa_pool(void);
629extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); 629extern void blk_queue_bounce(struct request_queue *q, struct bio **bio);
630#else 630#else
631static inline int init_emergency_isa_pool(void) 631static inline int init_emergency_isa_pool(void)
632{ 632{
633 return 0; 633 return 0;
634} 634}
635static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) 635static 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);
646extern void register_disk(struct gendisk *dev); 646extern void register_disk(struct gendisk *dev);
647extern void generic_make_request(struct bio *bio); 647extern void generic_make_request(struct bio *bio);
648extern void blk_put_request(struct request *); 648extern void blk_put_request(struct request *);
649extern void __blk_put_request(request_queue_t *, struct request *); 649extern void __blk_put_request(struct request_queue *, struct request *);
650extern void blk_end_sync_rq(struct request *rq, int error); 650extern void blk_end_sync_rq(struct request *rq, int error);
651extern struct request *blk_get_request(request_queue_t *, int, gfp_t); 651extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
652extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 652extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
653extern void blk_requeue_request(request_queue_t *, struct request *); 653extern void blk_requeue_request(struct request_queue *, struct request *);
654extern void blk_plug_device(request_queue_t *); 654extern void blk_plug_device(struct request_queue *);
655extern int blk_remove_plug(request_queue_t *); 655extern int blk_remove_plug(struct request_queue *);
656extern void blk_recount_segments(request_queue_t *, struct bio *); 656extern void blk_recount_segments(struct request_queue *, struct bio *);
657extern int scsi_cmd_ioctl(struct file *, struct request_queue *, 657extern int scsi_cmd_ioctl(struct file *, struct request_queue *,
658 struct gendisk *, unsigned int, void __user *); 658 struct gendisk *, unsigned int, void __user *);
659extern int sg_scsi_ioctl(struct file *, struct request_queue *, 659extern 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 */
665extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *); 665extern 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 */
672static inline void blk_clear_queue_congested(request_queue_t *q, int rw) 673static 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 */
681static inline void blk_set_queue_congested(request_queue_t *q, int rw) 682static 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
686extern void blk_start_queue(request_queue_t *q); 687extern void blk_start_queue(struct request_queue *q);
687extern void blk_stop_queue(request_queue_t *q); 688extern void blk_stop_queue(struct request_queue *q);
688extern void blk_sync_queue(struct request_queue *q); 689extern void blk_sync_queue(struct request_queue *q);
689extern void __blk_stop_queue(request_queue_t *q); 690extern void __blk_stop_queue(struct request_queue *q);
690extern void blk_run_queue(request_queue_t *); 691extern void blk_run_queue(struct request_queue *);
691extern void blk_start_queueing(request_queue_t *); 692extern void blk_start_queueing(struct request_queue *);
692extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); 693extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long);
693extern int blk_rq_unmap_user(struct bio *); 694extern int blk_rq_unmap_user(struct bio *);
694extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); 695extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
695extern int blk_rq_map_user_iov(request_queue_t *, struct request *, 696extern 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);
697extern int blk_execute_rq(request_queue_t *, struct gendisk *, 698extern int blk_execute_rq(struct request_queue *, struct gendisk *,
698 struct request *, int); 699 struct request *, int);
699extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, 700extern 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 *);
701extern int blk_verify_command(unsigned char *, int); 702extern int blk_verify_command(unsigned char *, int);
702 703
703static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 704static 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 */
752extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, 753extern 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);
754extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *); 755extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
755extern void blk_cleanup_queue(request_queue_t *); 756extern void blk_cleanup_queue(struct request_queue *);
756extern void blk_queue_make_request(request_queue_t *, make_request_fn *); 757extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
757extern void blk_queue_bounce_limit(request_queue_t *, u64); 758extern void blk_queue_bounce_limit(struct request_queue *, u64);
758extern void blk_queue_max_sectors(request_queue_t *, unsigned int); 759extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
759extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); 760extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short);
760extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); 761extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short);
761extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); 762extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
762extern void blk_queue_hardsect_size(request_queue_t *, unsigned short); 763extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
763extern void blk_queue_stack_limits(request_queue_t *t, request_queue_t *b); 764extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
764extern void blk_queue_segment_boundary(request_queue_t *, unsigned long); 765extern void blk_queue_segment_boundary(struct request_queue *, unsigned long);
765extern void blk_queue_prep_rq(request_queue_t *, prep_rq_fn *pfn); 766extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn);
766extern void blk_queue_merge_bvec(request_queue_t *, merge_bvec_fn *); 767extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *);
767extern void blk_queue_dma_alignment(request_queue_t *, int); 768extern void blk_queue_dma_alignment(struct request_queue *, int);
768extern void blk_queue_softirq_done(request_queue_t *, softirq_done_fn *); 769extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *);
769extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 770extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
770extern int blk_queue_ordered(request_queue_t *, unsigned, prepare_flush_fn *); 771extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *);
771extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); 772extern void blk_queue_issue_flush_fn(struct request_queue *, issue_flush_fn *);
772extern int blk_do_ordered(request_queue_t *, struct request **); 773extern int blk_do_ordered(struct request_queue *, struct request **);
773extern unsigned blk_ordered_cur_seq(request_queue_t *); 774extern unsigned blk_ordered_cur_seq(struct request_queue *);
774extern unsigned blk_ordered_req_seq(struct request *); 775extern unsigned blk_ordered_req_seq(struct request *);
775extern void blk_ordered_complete_seq(request_queue_t *, unsigned, int); 776extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int);
776 777
777extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *); 778extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
778extern void blk_dump_rq_flags(struct request *, char *); 779extern void blk_dump_rq_flags(struct request *, char *);
779extern void generic_unplug_device(request_queue_t *); 780extern void generic_unplug_device(struct request_queue *);
780extern void __generic_unplug_device(request_queue_t *); 781extern void __generic_unplug_device(struct request_queue *);
781extern long nr_blockdev_pages(void); 782extern long nr_blockdev_pages(void);
782 783
783int blk_get_queue(request_queue_t *); 784int blk_get_queue(struct request_queue *);
784request_queue_t *blk_alloc_queue(gfp_t); 785struct request_queue *blk_alloc_queue(gfp_t);
785request_queue_t *blk_alloc_queue_node(gfp_t, int); 786struct request_queue *blk_alloc_queue_node(gfp_t, int);
786extern void blk_put_queue(request_queue_t *); 787extern 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)
794extern int blk_queue_start_tag(request_queue_t *, struct request *); 795extern int blk_queue_start_tag(struct request_queue *, struct request *);
795extern struct request *blk_queue_find_tag(request_queue_t *, int); 796extern struct request *blk_queue_find_tag(struct request_queue *, int);
796extern void blk_queue_end_tag(request_queue_t *, struct request *); 797extern void blk_queue_end_tag(struct request_queue *, struct request *);
797extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *); 798extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *);
798extern void blk_queue_free_tags(request_queue_t *); 799extern void blk_queue_free_tags(struct request_queue *);
799extern int blk_queue_resize_tags(request_queue_t *, int); 800extern int blk_queue_resize_tags(struct request_queue *, int);
800extern void blk_queue_invalidate_tags(request_queue_t *); 801extern void blk_queue_invalidate_tags(struct request_queue *);
801extern struct blk_queue_tag *blk_init_tags(int); 802extern struct blk_queue_tag *blk_init_tags(int);
802extern void blk_free_tags(struct blk_queue_tag *); 803extern 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
812extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); 813extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *);
813extern int blkdev_issue_flush(struct block_device *, sector_t *); 814extern 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
824static inline int queue_hardsect_size(request_queue_t *q) 825static 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
839static inline int queue_dma_alignment(request_queue_t *q) 840static 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 3680ff9a30e..90874a5d7d7 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)
146extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); 146extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
147extern void blk_trace_shutdown(request_queue_t *); 147extern void blk_trace_shutdown(struct request_queue *);
148extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); 148extern 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 12a1291855e..86f9a3a6137 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)
18extern void __chk_user_ptr(const void __user *); 18extern void __chk_user_ptr(const volatile void __user *);
19extern void __chk_io_ptr(const void __iomem *); 19extern 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 d9f0a57f5a2..3a38d1f70cb 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 */
552extern void device_shutdown(void); 552extern void device_shutdown(void);
553 553
554/* drivers/base/sys.c */
555extern void sysdev_shutdown(void);
556
554 557
555/* drivers/base/firmware.c */ 558/* drivers/base/firmware.c */
556extern int __must_check firmware_register(struct kset *); 559extern int __must_check firmware_register(struct kset *);
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index e88fcbc77f8..e8f42133a61 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
8typedef int (elevator_merge_fn) (request_queue_t *, struct request **, 8typedef int (elevator_merge_fn) (struct request_queue *, struct request **,
9 struct bio *); 9 struct bio *);
10 10
11typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); 11typedef void (elevator_merge_req_fn) (struct request_queue *, struct request *, struct request *);
12 12
13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); 13typedef void (elevator_merged_fn) (struct request_queue *, struct request *, int);
14 14
15typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *); 15typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *);
16 16
17typedef int (elevator_dispatch_fn) (request_queue_t *, int); 17typedef int (elevator_dispatch_fn) (struct request_queue *, int);
18 18
19typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); 19typedef void (elevator_add_req_fn) (struct request_queue *, struct request *);
20typedef int (elevator_queue_empty_fn) (request_queue_t *); 20typedef int (elevator_queue_empty_fn) (struct request_queue *);
21typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 21typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *);
22typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *);
23typedef int (elevator_may_queue_fn) (request_queue_t *, int); 23typedef int (elevator_may_queue_fn) (struct request_queue *, int);
24 24
25typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); 25typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t);
26typedef void (elevator_put_req_fn) (struct request *); 26typedef void (elevator_put_req_fn) (struct request *);
27typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 27typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *);
28typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 28typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *);
29 29
30typedef void *(elevator_init_fn) (request_queue_t *); 30typedef void *(elevator_init_fn) (struct request_queue *);
31typedef void (elevator_exit_fn) (elevator_t *); 31typedef void (elevator_exit_fn) (elevator_t *);
32 32
33struct elevator_ops 33struct elevator_ops
@@ -94,27 +94,27 @@ struct elevator_queue
94/* 94/*
95 * block elevator interface 95 * block elevator interface
96 */ 96 */
97extern void elv_dispatch_sort(request_queue_t *, struct request *); 97extern void elv_dispatch_sort(struct request_queue *, struct request *);
98extern void elv_dispatch_add_tail(request_queue_t *, struct request *); 98extern void elv_dispatch_add_tail(struct request_queue *, struct request *);
99extern void elv_add_request(request_queue_t *, struct request *, int, int); 99extern void elv_add_request(struct request_queue *, struct request *, int, int);
100extern void __elv_add_request(request_queue_t *, struct request *, int, int); 100extern void __elv_add_request(struct request_queue *, struct request *, int, int);
101extern void elv_insert(request_queue_t *, struct request *, int); 101extern void elv_insert(struct request_queue *, struct request *, int);
102extern int elv_merge(request_queue_t *, struct request **, struct bio *); 102extern int elv_merge(struct request_queue *, struct request **, struct bio *);
103extern void elv_merge_requests(request_queue_t *, struct request *, 103extern void elv_merge_requests(struct request_queue *, struct request *,
104 struct request *); 104 struct request *);
105extern void elv_merged_request(request_queue_t *, struct request *, int); 105extern void elv_merged_request(struct request_queue *, struct request *, int);
106extern void elv_dequeue_request(request_queue_t *, struct request *); 106extern void elv_dequeue_request(struct request_queue *, struct request *);
107extern void elv_requeue_request(request_queue_t *, struct request *); 107extern void elv_requeue_request(struct request_queue *, struct request *);
108extern int elv_queue_empty(request_queue_t *); 108extern int elv_queue_empty(struct request_queue *);
109extern struct request *elv_next_request(struct request_queue *q); 109extern struct request *elv_next_request(struct request_queue *q);
110extern struct request *elv_former_request(request_queue_t *, struct request *); 110extern struct request *elv_former_request(struct request_queue *, struct request *);
111extern struct request *elv_latter_request(request_queue_t *, struct request *); 111extern struct request *elv_latter_request(struct request_queue *, struct request *);
112extern int elv_register_queue(request_queue_t *q); 112extern int elv_register_queue(struct request_queue *q);
113extern void elv_unregister_queue(request_queue_t *q); 113extern void elv_unregister_queue(struct request_queue *q);
114extern int elv_may_queue(request_queue_t *, int); 114extern int elv_may_queue(struct request_queue *, int);
115extern void elv_completed_request(request_queue_t *, struct request *); 115extern void elv_completed_request(struct request_queue *, struct request *);
116extern int elv_set_request(request_queue_t *, struct request *, gfp_t); 116extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
117extern void elv_put_request(request_queue_t *, struct request *); 117extern 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 */
128extern ssize_t elv_iosched_show(request_queue_t *, char *); 128extern ssize_t elv_iosched_show(struct request_queue *, char *);
129extern ssize_t elv_iosched_store(request_queue_t *, const char *, size_t); 129extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t);
130 130
131extern int elevator_init(request_queue_t *, char *); 131extern int elevator_init(struct request_queue *, char *);
132extern void elevator_exit(elevator_t *); 132extern void elevator_exit(elevator_t *);
133extern int elv_rq_merge_ok(struct request *, struct bio *); 133extern int elv_rq_merge_ok(struct request *, struct bio *);
134 134
135/* 135/*
136 * Helper functions. 136 * Helper functions.
137 */ 137 */
138extern struct request *elv_rb_former_request(request_queue_t *, struct request *); 138extern struct request *elv_rb_former_request(struct request_queue *, struct request *);
139extern struct request *elv_rb_latter_request(request_queue_t *, struct request *); 139extern 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 c8e02de737f..efded00ad08 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 */
130static inline int frozen(struct task_struct *p) { return 0; } 130static inline int frozen(struct task_struct *p) { return 0; }
131static inline int freezing(struct task_struct *p) { return 0; } 131static inline int freezing(struct task_struct *p) { return 0; }
132static inline void set_freeze_flag(struct task_struct *p) {} 132static inline void set_freeze_flag(struct task_struct *p) {}
@@ -143,6 +143,6 @@ static inline void freezer_do_not_count(void) {}
143static inline void freezer_count(void) {} 143static inline void freezer_count(void) {}
144static inline int freezer_should_skip(struct task_struct *p) { return 0; } 144static inline int freezer_should_skip(struct task_struct *p) { return 0; }
145static inline void set_freezable(void) {} 145static 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 49b7053043a..e6a71c82d20 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 5f5daad8bc5..d71d0121b7f 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);
1206extern int ide_spin_wait_hwgroup(ide_drive_t *); 1206extern int ide_spin_wait_hwgroup(ide_drive_t *);
1207extern void ide_timer_expiry(unsigned long); 1207extern void ide_timer_expiry(unsigned long);
1208extern irqreturn_t ide_intr(int irq, void *dev_id); 1208extern irqreturn_t ide_intr(int irq, void *dev_id);
1209extern void do_ide_request(request_queue_t *); 1209extern void do_ide_request(struct request_queue *);
1210 1210
1211void ide_init_disk(struct gendisk *, ide_drive_t *); 1211void ide_init_disk(struct gendisk *, ide_drive_t *);
1212 1212
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 0a3c2ebf200..5523f19d88d 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 *);
98extern void free_irq(unsigned int, void *); 96extern void free_irq(unsigned int, void *);
99 97
98struct device;
99
100extern int __must_check devm_request_irq(struct device *dev, unsigned int irq, 100extern 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 500aace21ca..157ad64aa7c 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
32static inline unsigned long 44static inline unsigned long
33hcall(unsigned long call, 45hcall(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
43void async_hcall(unsigned long call, 62void 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. :*/
56struct lguest_data 77struct 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 c9b4e05fee4..d27853ddc64 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). */
19static inline int lgdev_irq(const struct lguest_device *dev) 21static 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! */
25void lguest_send_dma(unsigned long key, struct lguest_dma *dma); 28void 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 0ba414a40c8..64167057944 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. */
12struct lguest_dma 37struct 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. */
20struct lguest_block_page 51struct 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": */
32struct lguest_net 65struct 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 */
42struct lguest_device_desc { 87struct 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. */
66enum lguest_req 120enum lguest_req
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 9aa6c10f7bb..41978a55731 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 0b99b31f017..26a0a103898 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 c456c3a1c28..655094dc944 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
19struct mempolicy; 18struct mempolicy;
20struct anon_vma; 19struct anon_vma;
20struct file_ra_state;
21struct user_struct; 21struct user_struct;
22struct 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 */
24extern unsigned long max_mapnr; 25extern unsigned long max_mapnr;
@@ -861,38 +862,7 @@ struct shrinker {
861extern void register_shrinker(struct shrinker *); 862extern void register_shrinker(struct shrinker *);
862extern void unregister_shrinker(struct shrinker *); 863extern void unregister_shrinker(struct shrinker *);
863 864
864/* 865int 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 */
870static 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
897extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); 867extern 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);
1246extern int randomize_va_space; 1216extern int randomize_va_space;
1247#endif 1217#endif
1248 1218
1249__attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma); 1219const 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 04bbe12fae8..63a80ea6112 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -99,7 +99,7 @@ struct mmc_request {
99struct mmc_host; 99struct mmc_host;
100struct mmc_card; 100struct mmc_card;
101 101
102extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 102extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
103extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 103extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
104extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, 104extern 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 af04a555b52..2ada8ee316b 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
164struct 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 90ae8b474cb..37e933c9987 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
6struct xt_connlimit_info { 6struct 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 5e84f2e8d54..d8f8a3a9664 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
535int __must_check pci_enable_device(struct pci_dev *dev); 535int __must_check pci_enable_device(struct pci_dev *dev);
536int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); 536int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
537int __must_check __pci_reenable_device(struct pci_dev *);
537int __must_check pcim_enable_device(struct pci_dev *pdev); 538int __must_check pcim_enable_device(struct pci_dev *pdev);
538void pcim_pin_device(struct pci_dev *pdev); 539void pcim_pin_device(struct pci_dev *pdev);
539 540
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index cbabb9c675c..69d68117bda 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 ad3cc2eb0d3..e52f6f83c06 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
168extern struct pm_ops *pm_ops; 169extern struct pm_ops *pm_ops;
169 170
170/** 171/**
@@ -193,6 +194,12 @@ extern void arch_suspend_disable_irqs(void);
193extern void arch_suspend_enable_irqs(void); 194extern void arch_suspend_enable_irqs(void);
194 195
195extern int pm_suspend(suspend_state_t state); 196extern int pm_suspend(suspend_state_t state);
197#else /* !CONFIG_SUSPEND */
198#define suspend_valid_only_mem NULL
199
200static inline void pm_set_ops(struct pm_ops *pm_ops) {}
201static 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 {
266struct dev_pm_info { 273struct 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);
276extern void device_power_up(void); 283extern void device_power_up(void);
277extern void device_resume(void); 284extern void device_resume(void);
278 285
279#ifdef CONFIG_PM 286#ifdef CONFIG_PM_SLEEP
280extern int device_suspend(pm_message_t state); 287extern int device_suspend(pm_message_t state);
281extern int device_prepare_suspend(pm_message_t state); 288extern 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
311static inline int device_suspend(pm_message_t state) 318static 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 2a1897e6f93..16b46aace34 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 @@
23struct pnp_protocol; 22struct pnp_protocol;
24struct pnp_dev; 23struct 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
75struct pnp_port { 73struct 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
86struct pnp_irq { 84struct 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
93struct pnp_dma { 91struct 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
99struct pnp_mem { 97struct 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
161struct pnp_card_link { 158struct 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
168static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) 165static 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
173static inline void pnp_set_card_drvdata (struct pnp_card_link *pcard, void *data) 170static 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
223static inline void *pnp_get_drvdata (struct pnp_dev *pdev) 220static 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
228static inline void pnp_set_drvdata (struct pnp_dev *pdev, void *data) 225static 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
233struct pnp_fixup { 230struct 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
288struct pnp_id { 284struct 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
293struct pnp_driver { 289struct 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
306struct pnp_card_driver { 302struct 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
329struct pnp_protocol { 325struct 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
356extern struct bus_type pnp_bus_type; 355extern 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);
372int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); 371int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
373void pnp_remove_card_device(struct pnp_dev *dev); 372void pnp_remove_card_device(struct pnp_dev *dev);
374int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); 373int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card);
375struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from); 374struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
376void pnp_release_card_device(struct pnp_dev * dev); 375 const char *id, struct pnp_dev *from);
377int pnp_register_card_driver(struct pnp_card_driver * drv); 376void pnp_release_card_device(struct pnp_dev *dev);
378void pnp_unregister_card_driver(struct pnp_card_driver * drv); 377int pnp_register_card_driver(struct pnp_card_driver *drv);
378void pnp_unregister_card_driver(struct pnp_card_driver *drv);
379extern struct list_head pnp_cards; 379extern struct list_head pnp_cards;
380 380
381/* resource management */ 381/* resource management */
382struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev); 382struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
383struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority); 383struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
384 int priority);
384int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); 385int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data);
385int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); 386int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data);
386int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data); 387int pnp_register_port_resource(struct pnp_option *option,
388 struct pnp_port *data);
387int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); 389int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
388void pnp_init_resource_table(struct pnp_resource_table *table); 390void pnp_init_resource_table(struct pnp_resource_table *table);
389int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); 391int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
392 int mode);
390int pnp_auto_config_dev(struct pnp_dev *dev); 393int pnp_auto_config_dev(struct pnp_dev *dev);
391int pnp_validate_config(struct pnp_dev *dev); 394int pnp_validate_config(struct pnp_dev *dev);
392int pnp_start_dev(struct pnp_dev *dev); 395int pnp_start_dev(struct pnp_dev *dev);
@@ -394,11 +397,11 @@ int pnp_stop_dev(struct pnp_dev *dev);
394int pnp_activate_dev(struct pnp_dev *dev); 397int pnp_activate_dev(struct pnp_dev *dev);
395int pnp_disable_dev(struct pnp_dev *dev); 398int pnp_disable_dev(struct pnp_dev *dev);
396void pnp_resource_change(struct resource *resource, resource_size_t start, 399void 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 */
400int pnp_is_active(struct pnp_dev * dev); 403int pnp_is_active(struct pnp_dev *dev);
401int compare_pnp_id(struct pnp_id * pos, const char * id); 404int compare_pnp_id(struct pnp_id *pos, const char *id);
402int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); 405int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
403int pnp_register_driver(struct pnp_driver *drv); 406int pnp_register_driver(struct pnp_driver *drv);
404void pnp_unregister_driver(struct pnp_driver *drv); 407void pnp_unregister_driver(struct pnp_driver *drv);
@@ -411,23 +414,24 @@ static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
411static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } 414static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
412static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } 415static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
413static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 416static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
414static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } 417static 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 */
418static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } 422static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; }
419static inline void pnp_remove_card(struct pnp_card *card) { ; } 423static inline void pnp_remove_card(struct pnp_card *card) { }
420static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; } 424static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; }
421static inline void pnp_remove_card_device(struct pnp_dev *dev) { ; } 425static inline void pnp_remove_card_device(struct pnp_dev *dev) { }
422static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; } 426static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; }
423static inline struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from) { return NULL; } 427static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; }
424static inline void pnp_release_card_device(struct pnp_dev * dev) { ; } 428static inline void pnp_release_card_device(struct pnp_dev *dev) { }
425static inline int pnp_register_card_driver(struct pnp_card_driver * drv) { return -ENODEV; } 429static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; }
426static inline void pnp_unregister_card_driver(struct pnp_card_driver * drv) { ; } 430static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { }
427 431
428/* resource management */ 432/* resource management */
429static inline struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev) { return NULL; } 433static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev) { return NULL; }
430static inline struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; } 434static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; }
431static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; } 435static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; }
432static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } 436static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; }
433static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } 437static 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; }
440static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 444static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
441static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 445static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
442static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 446static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
443static inline void pnp_resource_change(struct resource *resource, 447static 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 */
448static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } 450static inline int pnp_is_active(struct pnp_dev *dev) { return 0; }
449static inline int compare_pnp_id(struct pnp_id * pos, const char * id) { return -ENODEV; } 451static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; }
450static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } 452static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; }
451static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } 453static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
452static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } 454static 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 0a282ac1f6b..329192adc9d 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)
101struct pnp_dev_node_info { 101struct pnp_dev_node_info {
102 __u16 no_nodes; 102 __u16 no_nodes;
103 __u16 max_node_size; 103 __u16 max_node_size;
104}; 104};
105struct pnp_docking_station_info { 105struct 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};
110struct pnp_isa_config_struc { 110struct 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};
116struct escd_info_struc { 116struct 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};
121struct pnp_bios_node { 121struct 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 */
134extern struct pnp_dev_node_info node_info; 134extern struct pnp_dev_node_info node_info;
135 135
136extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data); 136extern int pnp_bios_dev_node_info(struct pnp_dev_node_info *data);
137extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data); 137extern int pnp_bios_get_dev_node(u8 *nodenum, char config,
138extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data); 138 struct pnp_bios_node *data);
139extern int pnp_bios_get_stat_res (char *info); 139extern int pnp_bios_set_dev_node(u8 nodenum, char config,
140extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data); 140 struct pnp_bios_node *data);
141extern int pnp_bios_escd_info (struct escd_info_struc *data); 141extern int pnp_bios_get_stat_res(char *info);
142extern int pnp_bios_read_escd (char *data, u32 nvram_base); 142extern int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data);
143extern int pnp_bios_escd_info(struct escd_info_struc *data);
144extern int pnp_bios_read_escd(char *data, u32 nvram_base);
143extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data); 145extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data);
144#define needed 0
145#if needed
146extern int pnp_bios_get_event (u16 *message);
147extern int pnp_bios_send_message (u16 message);
148extern int pnp_bios_set_stat_res (char *info);
149extern int pnp_bios_apm_id_table (char *table, u16 *size);
150extern 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 d0926d63406..484988ed301 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
66struct 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 */
77struct 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 */
90struct preempt_notifier {
91 struct hlist_node link;
92 struct preempt_ops *ops;
93};
94
95void preempt_notifier_register(struct preempt_notifier *notifier);
96void preempt_notifier_unregister(struct preempt_notifier *notifier);
97
98static inline void preempt_notifier_init(struct preempt_notifier *notifier,
99 struct preempt_ops *ops)
100{
101 INIT_HLIST_NODE(&notifier->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 28ac632b42d..dcb729244f4 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 965d5b3ea9e..180a9d832dd 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... ) \
85if( !( cond ) ) \ 85if( !( 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 33b9b4841ee..2e490271acf 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 */
795static 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
790struct io_context; /* See blkdev.h */ 806struct io_context; /* See blkdev.h */
791struct cpuset; 807struct 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 8518fa2a6f8..afe0f6d9b9b 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -20,7 +20,7 @@
20struct plat_serial8250_port { 20struct 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 773d8d8828a..09d17b06bf0 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 e8e6da394c9..388cace9751 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -24,7 +24,7 @@ struct pbe {
24extern void drain_local_pages(void); 24extern void drain_local_pages(void);
25extern void mark_free_pages(struct zone *zone); 25extern 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)
28extern int pm_prepare_console(void); 28extern int pm_prepare_console(void);
29extern void pm_restore_console(void); 29extern 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 */
60extern void __register_nosave_region(unsigned long b, unsigned long e, int km); 59extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
61static inline void register_nosave_region(unsigned long b, unsigned long e) 60static 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
74extern void hibernation_set_ops(struct hibernation_ops *ops); 73extern void hibernation_set_ops(struct hibernation_ops *ops);
75extern int hibernate(void); 74extern int hibernate(void);
76#else /* CONFIG_SOFTWARE_SUSPEND */ 75#else /* CONFIG_HIBERNATION */
77static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } 76static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
78static inline void swsusp_set_page_free(struct page *p) {} 77static inline void swsusp_set_page_free(struct page *p) {}
79static inline void swsusp_unset_page_free(struct page *p) {} 78static inline void swsusp_unset_page_free(struct page *p) {}
80 79
81static inline void hibernation_set_ops(struct hibernation_ops *ops) {} 80static inline void hibernation_set_ops(struct hibernation_ops *ops) {}
82static inline int hibernate(void) { return -ENOSYS; } 81static inline int hibernate(void) { return -ENOSYS; }
83#endif /* CONFIG_SOFTWARE_SUSPEND */ 82#endif /* CONFIG_HIBERNATION */
84 83
84#ifdef CONFIG_PM_SLEEP
85void save_processor_state(void); 85void save_processor_state(void);
86void restore_processor_state(void); 86void restore_processor_state(void);
87struct saved_context; 87struct 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
111static inline int register_pm_notifier(struct notifier_block *nb) 111static 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
125static inline void register_nosave_region(unsigned long b, unsigned long e) 125static inline void register_nosave_region(unsigned long b, unsigned long e)
126{ 126{
127} 127}
128static 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 e6aea5146e5..6a5f503b4f1 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -99,15 +99,11 @@ extern int update_persistent_clock(struct timespec now);
99extern int no_sync_cmos_clock __read_mostly; 99extern int no_sync_cmos_clock __read_mostly;
100void timekeeping_init(void); 100void timekeeping_init(void);
101 101
102static inline unsigned long get_seconds(void) 102unsigned long get_seconds(void);
103{
104 return xtime.tv_sec;
105}
106
107struct timespec current_kernel_time(void); 103struct 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
112extern void do_gettimeofday(struct timeval *tv); 108extern void do_gettimeofday(struct timeval *tv);
113extern int do_settimeofday(struct timespec *tv); 109extern int do_settimeofday(struct timespec *tv);
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 040dae5f0c9..c48e390f4b0 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -35,7 +35,7 @@ union nf_conntrack_address {
35union nf_conntrack_man_proto 35union nf_conntrack_man_proto
36{ 36{
37 /* Add other protocols here. */ 37 /* Add other protocols here. */
38 u_int16_t all; 38 __be16 all;
39 39
40 struct { 40 struct {
41 __be16 port; 41 __be16 port;
@@ -73,7 +73,7 @@ struct nf_conntrack_tuple
73 union nf_conntrack_address u3; 73 union nf_conntrack_address u3;
74 union { 74 union {
75 /* Add other protocols here. */ 75 /* Add other protocols here. */
76 u_int16_t all; 76 __be16 all;
77 77
78 struct { 78 struct {
79 __be16 port; 79 __be16 port;
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index 5261488e110..78583fee0ab 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -57,7 +57,7 @@ static int sd_resume(struct device *dev);
57static void sd_rescan(struct device *); 57static void sd_rescan(struct device *);
58static int sd_init_command(struct scsi_cmnd *); 58static int sd_init_command(struct scsi_cmnd *);
59static int sd_issue_flush(struct device *, sector_t *); 59static int sd_issue_flush(struct device *, sector_t *);
60static void sd_prepare_flush(request_queue_t *, struct request *); 60static void sd_prepare_flush(struct request_queue *, struct request *);
61static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer); 61static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
62static void scsi_disk_release(struct class_device *cdev); 62static void scsi_disk_release(struct class_device *cdev);
63static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); 63static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
diff --git a/include/xen/page.h b/include/xen/page.h
index 1df6c193057..c0c8fcb2789 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -4,6 +4,7 @@
4#include <linux/pfn.h> 4#include <linux/pfn.h>
5 5
6#include <asm/uaccess.h> 6#include <asm/uaccess.h>
7#include <asm/pgtable.h>
7 8
8#include <xen/features.h> 9#include <xen/features.h>
9 10