aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h24
-rw-r--r--include/acpi/acdebug.h2
-rw-r--r--include/acpi/acdisasm.h81
-rw-r--r--include/acpi/acdispat.h5
-rw-r--r--include/acpi/acevents.h8
-rw-r--r--include/acpi/acexcep.h2
-rw-r--r--include/acpi/acglobal.h23
-rw-r--r--include/acpi/achware.h2
-rw-r--r--include/acpi/acinterp.h48
-rw-r--r--include/acpi/aclocal.h112
-rw-r--r--include/acpi/acmacros.h201
-rw-r--r--include/acpi/acnames.h2
-rw-r--r--include/acpi/acnamesp.h4
-rw-r--r--include/acpi/acobject.h4
-rw-r--r--include/acpi/acopcode.h2
-rw-r--r--include/acpi/acoutput.h12
-rw-r--r--include/acpi/acparser.h2
-rw-r--r--include/acpi/acpi.h2
-rw-r--r--include/acpi/acpi_drivers.h4
-rw-r--r--include/acpi/acpiosxf.h6
-rw-r--r--include/acpi/acpixf.h13
-rw-r--r--include/acpi/acresrc.h390
-rw-r--r--include/acpi/acstruct.h2
-rw-r--r--include/acpi/actables.h2
-rw-r--r--include/acpi/actbl.h8
-rw-r--r--include/acpi/actbl1.h2
-rw-r--r--include/acpi/actbl2.h2
-rw-r--r--include/acpi/actypes.h613
-rw-r--r--include/acpi/acutils.h82
-rw-r--r--include/acpi/amlcode.h2
-rw-r--r--include/acpi/amlresrc.h271
-rw-r--r--include/acpi/pdc_intel.h4
-rw-r--r--include/acpi/platform/acenv.h24
-rw-r--r--include/acpi/platform/acgcc.h10
-rw-r--r--include/acpi/platform/aclinux.h8
-rw-r--r--include/acpi/processor.h28
-rw-r--r--include/asm-alpha/dma-mapping.h1
-rw-r--r--include/asm-arm/arch-s3c2410/debug-macro.S6
-rw-r--r--include/asm-arm/arch-s3c2410/hardware.h7
-rw-r--r--include/asm-arm/arch-s3c2410/map.h38
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h22
-rw-r--r--include/asm-arm/arch-s3c2410/regs-serial.h6
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h6
-rw-r--r--include/asm-arm/checksum.h2
-rw-r--r--include/asm-arm/mach/map.h1
-rw-r--r--include/asm-arm/pgtable.h1
-rw-r--r--include/asm-arm26/bitops.h4
-rw-r--r--include/asm-arm26/hardirq.h8
-rw-r--r--include/asm-arm26/posix_types.h1
-rw-r--r--include/asm-arm26/system.h5
-rw-r--r--include/asm-cris/bitops.h2
-rw-r--r--include/asm-frv/bitops.h2
-rw-r--r--include/asm-h8300/bitops.h2
-rw-r--r--include/asm-i386/acpi.h2
-rw-r--r--include/asm-i386/page.h4
-rw-r--r--include/asm-i386/system.h2
-rw-r--r--include/asm-i386/topology.h9
-rw-r--r--include/asm-ia64/ide.h8
-rw-r--r--include/asm-ia64/processor.h17
-rw-r--r--include/asm-ia64/sal.h10
-rw-r--r--include/asm-ia64/sn/bte.h23
-rw-r--r--include/asm-ia64/sn/intr.h38
-rw-r--r--include/asm-ia64/sn/sn_feature_sets.h14
-rw-r--r--include/asm-ia64/system.h25
-rw-r--r--include/asm-ia64/topology.h7
-rw-r--r--include/asm-parisc/atomic.h84
-rw-r--r--include/asm-parisc/cacheflush.h6
-rw-r--r--include/asm-parisc/compat_ucontext.h3
-rw-r--r--include/asm-parisc/grfioctl.h2
-rw-r--r--include/asm-parisc/pci.h17
-rw-r--r--include/asm-parisc/pgalloc.h1
-rw-r--r--include/asm-parisc/pgtable.h2
-rw-r--r--include/asm-parisc/rt_sigframe.h4
-rw-r--r--include/asm-parisc/unistd.h21
-rw-r--r--include/asm-powerpc/kexec.h4
-rw-r--r--include/asm-powerpc/pmac_pfunc.h5
-rw-r--r--include/asm-s390/dasd.h15
-rw-r--r--include/asm-s390/io.h6
-rw-r--r--include/asm-s390/qdio.h2
-rw-r--r--include/asm-s390/thread_info.h6
-rw-r--r--include/asm-s390/timer.h8
-rw-r--r--include/asm-s390/unistd.h24
-rw-r--r--include/asm-sh/bus-sh.h66
-rw-r--r--include/asm-sh/cpu-sh3/mmu_context.h10
-rw-r--r--include/asm-sh/cpu-sh4/mmu_context.h8
-rw-r--r--include/asm-sh/ioctls.h2
-rw-r--r--include/asm-sh/irq-sh73180.h36
-rw-r--r--include/asm-sh/irq-sh7780.h23
-rw-r--r--include/asm-sh/irq.h10
-rw-r--r--include/asm-sh/microdev.h (renamed from include/asm-sh/microdev/irq.h)60
-rw-r--r--include/asm-sh/microdev/io.h53
-rw-r--r--include/asm-sh/processor.h36
-rw-r--r--include/asm-sh64/ioctls.h2
-rw-r--r--include/asm-sparc64/spinlock.h24
-rw-r--r--include/asm-um/ldt-x86_64.h12
-rw-r--r--include/asm-um/smp.h2
-rw-r--r--include/asm-v850/bitops.h2
-rw-r--r--include/asm-x86_64/apic.h1
-rw-r--r--include/asm-x86_64/cpufeature.h2
-rw-r--r--include/asm-x86_64/hardirq.h21
-rw-r--r--include/asm-x86_64/ia32_unistd.h2
-rw-r--r--include/asm-x86_64/kexec.h3
-rw-r--r--include/asm-x86_64/mpspec.h2
-rw-r--r--include/asm-x86_64/proto.h11
-rw-r--r--include/asm-x86_64/system.h2
-rw-r--r--include/asm-x86_64/topology.h9
-rw-r--r--include/asm-xtensa/futex.h1
-rw-r--r--include/linux/acpi.h2
-rw-r--r--include/linux/agpgart.h3
-rw-r--r--include/linux/bitops.h2
-rw-r--r--include/linux/blkdev.h6
-rw-r--r--include/linux/configfs.h2
-rw-r--r--include/linux/cpufreq.h3
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/device-mapper.h2
-rw-r--r--include/linux/elfcore.h1
-rw-r--r--include/linux/fs.h8
-rw-r--r--include/linux/fuse.h16
-rw-r--r--include/linux/hrtimer.h6
-rw-r--r--include/linux/i2o.h6
-rw-r--r--include/linux/ide.h2
-rw-r--r--include/linux/io.h25
-rw-r--r--include/linux/jbd.h4
-rw-r--r--include/linux/kbd_kern.h5
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/ktime.h6
-rw-r--r--include/linux/list.h14
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--include/linux/mmc/mmc.h35
-rw-r--r--include/linux/mmc/protocol.h2
-rw-r--r--include/linux/mmzone.h13
-rw-r--r--include/linux/netfilter/x_tables.h16
-rw-r--r--include/linux/netfilter_ipv4/ipt_connbytes.h4
-rw-r--r--include/linux/netfilter_ipv4/ipt_policy.h22
-rw-r--r--include/linux/netfilter_ipv6/ip6t_policy.h22
-rw-r--r--include/linux/parport.h6
-rw-r--r--include/linux/pci.h2
-rw-r--r--include/linux/pci_ids.h21
-rw-r--r--include/linux/pktcdvd.h8
-rw-r--r--include/linux/posix-timers.h1
-rw-r--r--include/linux/quotaops.h1
-rw-r--r--include/linux/rcupdate.h5
-rw-r--r--include/linux/reboot.h3
-rw-r--r--include/linux/reiserfs_acl.h6
-rw-r--r--include/linux/reiserfs_fs.h16
-rw-r--r--include/linux/reiserfs_fs_sb.h1
-rw-r--r--include/linux/reiserfs_xattr.h2
-rw-r--r--include/linux/rmap.h5
-rw-r--r--include/linux/security.h23
-rw-r--r--include/linux/serial_8250.h2
-rw-r--r--include/linux/serial_core.h72
-rw-r--r--include/linux/slab.h7
-rw-r--r--include/linux/sunrpc/auth.h10
-rw-r--r--include/linux/suspend.h4
-rw-r--r--include/linux/swap.h9
-rw-r--r--include/linux/syscalls.h33
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/time.h2
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/tty_flip.h7
-rw-r--r--include/linux/types.h2
-rw-r--r--include/linux/ufs_fs.h14
-rw-r--r--include/linux/ufs_fs_sb.h2
-rw-r--r--include/linux/usb_ch9.h6
-rw-r--r--include/linux/videodev2.h1
-rw-r--r--include/net/ieee80211.h4
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h15
-rw-r--r--include/net/route.h5
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/sock.h8
-rw-r--r--include/scsi/scsi_device.h2
-rw-r--r--include/scsi/scsi_host.h1
172 files changed, 2052 insertions, 1383 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 427cff1a3f83..e27dc8f29972 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,9 +61,9 @@
61 * 61 *
62 */ 62 */
63 63
64/* Version string */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20050902 66#define ACPI_CA_VERSION 0x20060127
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -83,7 +83,7 @@
83#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ 83#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
84 84
85/* 85/*
86 * Should the subystem abort the loading of an ACPI table if the 86 * Should the subsystem abort the loading of an ACPI table if the
87 * table checksum is incorrect? 87 * table checksum is incorrect?
88 */ 88 */
89#define ACPI_CHECKSUM_ABORT FALSE 89#define ACPI_CHECKSUM_ABORT FALSE
@@ -98,11 +98,6 @@
98 98
99#define ACPI_CA_SUPPORT_LEVEL 3 99#define ACPI_CA_SUPPORT_LEVEL 3
100 100
101/* String size constants */
102
103#define ACPI_MAX_STRING_LENGTH 512
104#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */
105
106/* Maximum count for a semaphore object */ 101/* Maximum count for a semaphore object */
107 102
108#define ACPI_MAX_SEMAPHORE_COUNT 256 103#define ACPI_MAX_SEMAPHORE_COUNT 256
@@ -115,6 +110,10 @@
115 110
116#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 111#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096
117 112
113/* owner_id tracking. 8 entries allows for 255 owner_ids */
114
115#define ACPI_NUM_OWNERID_MASKS 8
116
118/****************************************************************************** 117/******************************************************************************
119 * 118 *
120 * ACPI Specification constants (Do not change unless the specification changes) 119 * ACPI Specification constants (Do not change unless the specification changes)
@@ -134,14 +133,11 @@
134#define ACPI_METHOD_NUM_ARGS 7 133#define ACPI_METHOD_NUM_ARGS 7
135#define ACPI_METHOD_MAX_ARG 6 134#define ACPI_METHOD_MAX_ARG 6
136 135
137/* Maximum length of resulting string when converting from a buffer */ 136/* Length of _HID, _UID, _CID, and UUID values */
138
139#define ACPI_MAX_STRING_CONVERSION 200
140
141/* Length of _HID, _UID, and _CID values */
142 137
143#define ACPI_DEVICE_ID_LENGTH 0x09 138#define ACPI_DEVICE_ID_LENGTH 0x09
144#define ACPI_MAX_CID_LENGTH 48 139#define ACPI_MAX_CID_LENGTH 48
140#define ACPI_UUID_LENGTH 16
145 141
146/* 142/*
147 * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG 143 * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index 70ce3b4d006e..d8167095caf3 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 3d96dcb1bb4b..11a8fe39cb04 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -57,26 +57,11 @@ struct acpi_external_list {
57}; 57};
58 58
59extern struct acpi_external_list *acpi_gbl_external_list; 59extern struct acpi_external_list *acpi_gbl_external_list;
60extern const char *acpi_gbl_io_decode[2]; 60
61/* Strings used for decoding flags to ASL keywords */
62
61extern const char *acpi_gbl_word_decode[4]; 63extern const char *acpi_gbl_word_decode[4];
62extern const char *acpi_gbl_consume_decode[2];
63extern const char *acpi_gbl_min_decode[2];
64extern const char *acpi_gbl_max_decode[2];
65extern const char *acpi_gbl_DECdecode[2];
66extern const char *acpi_gbl_RNGdecode[4];
67extern const char *acpi_gbl_MEMdecode[4];
68extern const char *acpi_gbl_RWdecode[2];
69extern const char *acpi_gbl_irq_decode[2]; 64extern const char *acpi_gbl_irq_decode[2];
70extern const char *acpi_gbl_HEdecode[2];
71extern const char *acpi_gbl_LLdecode[2];
72extern const char *acpi_gbl_SHRdecode[2];
73extern const char *acpi_gbl_TYPdecode[4];
74extern const char *acpi_gbl_BMdecode[2];
75extern const char *acpi_gbl_SIZdecode[4];
76extern const char *acpi_gbl_TTPdecode[2];
77extern const char *acpi_gbl_MTPdecode[4];
78extern const char *acpi_gbl_TRSdecode[2];
79
80extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; 65extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
81extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; 66extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
82extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; 67extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
@@ -171,11 +156,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
171/* 156/*
172 * dmresrc 157 * dmresrc
173 */ 158 */
159void acpi_dm_dump_integer8(u8 value, char *name);
160
161void acpi_dm_dump_integer16(u16 value, char *name);
162
163void acpi_dm_dump_integer32(u32 value, char *name);
164
165void acpi_dm_dump_integer64(u64 value, char *name);
166
174void 167void
175acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, 168acpi_dm_resource_template(struct acpi_op_walk_info *info,
176 u8 * byte_data, u32 byte_count); 169 u8 * byte_data, u32 byte_count);
177 170
178u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); 171u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
179 172
180void acpi_dm_indent(u32 level); 173void acpi_dm_indent(u32 level);
181 174
@@ -187,73 +180,69 @@ void acpi_dm_decode_attribute(u8 attribute);
187 * dmresrcl 180 * dmresrcl
188 */ 181 */
189void 182void
190acpi_dm_word_descriptor(struct asl_word_address_desc *resource, 183acpi_dm_word_descriptor(union aml_resource *resource, u32 length, u32 level);
191 u32 length, u32 level);
192 184
193void 185void
194acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource, 186acpi_dm_dword_descriptor(union aml_resource *resource, u32 length, u32 level);
195 u32 length, u32 level);
196 187
197void 188void
198acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource, 189acpi_dm_extended_descriptor(union aml_resource *resource,
199 u32 length, u32 level); 190 u32 length, u32 level);
200 191
201void 192void
202acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource, 193acpi_dm_qword_descriptor(union aml_resource *resource, u32 length, u32 level);
203 u32 length, u32 level);
204 194
205void 195void
206acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource, 196acpi_dm_memory24_descriptor(union aml_resource *resource,
207 u32 length, u32 level); 197 u32 length, u32 level);
208 198
209void 199void
210acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource, 200acpi_dm_memory32_descriptor(union aml_resource *resource,
211 u32 length, u32 level); 201 u32 length, u32 level);
212 202
213void 203void
214acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource, 204acpi_dm_fixed_memory32_descriptor(union aml_resource *resource,
215 u32 length, u32 level); 205 u32 length, u32 level);
216 206
217void 207void
218acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource, 208acpi_dm_generic_register_descriptor(union aml_resource *resource,
219 u32 length, u32 level); 209 u32 length, u32 level);
220 210
221void 211void
222acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource, 212acpi_dm_interrupt_descriptor(union aml_resource *resource,
223 u32 length, u32 level); 213 u32 length, u32 level);
224 214
225void 215void
226acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource, 216acpi_dm_vendor_large_descriptor(union aml_resource *resource,
227 u32 length, u32 level); 217 u32 length, u32 level);
228 218
219void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level);
220
229/* 221/*
230 * dmresrcs 222 * dmresrcs
231 */ 223 */
232void 224void
233acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource, 225acpi_dm_irq_descriptor(union aml_resource *resource, u32 length, u32 level);
234 u32 length, u32 level);
235 226
236void 227void
237acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource, 228acpi_dm_dma_descriptor(union aml_resource *resource, u32 length, u32 level);
238 u32 length, u32 level);
239 229
240void 230void acpi_dm_io_descriptor(union aml_resource *resource, u32 length, u32 level);
241acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level);
242 231
243void 232void
244acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource, 233acpi_dm_fixed_io_descriptor(union aml_resource *resource,
245 u32 length, u32 level); 234 u32 length, u32 level);
246 235
247void 236void
248acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource, 237acpi_dm_start_dependent_descriptor(union aml_resource *resource,
249 u32 length, u32 level); 238 u32 length, u32 level);
250 239
251void 240void
252acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource, 241acpi_dm_end_dependent_descriptor(union aml_resource *resource,
253 u32 length, u32 level); 242 u32 length, u32 level);
254 243
255void 244void
256acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource, 245acpi_dm_vendor_small_descriptor(union aml_resource *resource,
257 u32 length, u32 level); 246 u32 length, u32 level);
258 247
259/* 248/*
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 065f24a77cfc..c41a926ff317 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -201,6 +201,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
201 union acpi_operand_object *obj_desc, 201 union acpi_operand_object *obj_desc,
202 struct acpi_namespace_node *calling_method_node); 202 struct acpi_namespace_node *calling_method_node);
203 203
204acpi_status
205acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
206
204/* 207/*
205 * dsinit 208 * dsinit
206 */ 209 */
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index bfa54600ecd9..f2717be4fe0d 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,8 @@ acpi_status acpi_ev_initialize_events(void);
51 51
52acpi_status acpi_ev_install_xrupt_handlers(void); 52acpi_status acpi_ev_install_xrupt_handlers(void);
53 53
54acpi_status acpi_ev_install_fadt_gpes(void);
55
54u32 acpi_ev_fixed_event_detect(void); 56u32 acpi_ev_fixed_event_detect(void);
55 57
56/* 58/*
@@ -105,6 +107,10 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
105 u32 interrupt_number, 107 u32 interrupt_number,
106 struct acpi_gpe_block_info **return_gpe_block); 108 struct acpi_gpe_block_info **return_gpe_block);
107 109
110acpi_status
111acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
112 struct acpi_gpe_block_info *gpe_block);
113
108acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); 114acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block);
109 115
110u32 116u32
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 4f005eb65928..dc768aa580e4 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 4ab2ca18b8df..734cc77bf2c7 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -80,6 +80,15 @@ extern u32 acpi_dbg_layer;
80 80
81extern u32 acpi_gbl_nesting_level; 81extern u32 acpi_gbl_nesting_level;
82 82
83/* Support for dynamic control method tracing mechanism */
84
85ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
86ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
87ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
88ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
89ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
90ACPI_EXTERN u32 acpi_gbl_trace_flags;
91
83/***************************************************************************** 92/*****************************************************************************
84 * 93 *
85 * Runtime configuration (static defaults that can be overriden at runtime) 94 * Runtime configuration (static defaults that can be overriden at runtime)
@@ -89,11 +98,15 @@ extern u32 acpi_gbl_nesting_level;
89/* 98/*
90 * Enable "slack" in the AML interpreter? Default is FALSE, and the 99 * Enable "slack" in the AML interpreter? Default is FALSE, and the
91 * interpreter strictly follows the ACPI specification. Setting to TRUE 100 * interpreter strictly follows the ACPI specification. Setting to TRUE
92 * allows the interpreter to forgive certain bad AML constructs. Currently: 101 * allows the interpreter to ignore certain errors and/or bad AML constructs.
102 *
103 * Currently, these features are enabled by this flag:
104 *
93 * 1) Allow "implicit return" of last value in a control method 105 * 1) Allow "implicit return" of last value in a control method
94 * 2) Allow access beyond end of operation region 106 * 2) Allow access beyond the end of an operation region
95 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 107 * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
96 * 4) Allow ANY object type to be a source operand for the Store() operator 108 * 4) Allow ANY object type to be a source operand for the Store() operator
109 * 5) Allow unresolved references (invalid target name) in package objects
97 */ 110 */
98ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); 111ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
99 112
@@ -211,9 +224,11 @@ ACPI_EXTERN u32 acpi_gbl_original_mode;
211ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 224ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
212ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 225ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
213ACPI_EXTERN u32 acpi_gbl_ps_find_count; 226ACPI_EXTERN u32 acpi_gbl_ps_find_count;
214ACPI_EXTERN u64 acpi_gbl_owner_id_mask; 227ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
215ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; 228ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
216ACPI_EXTERN u16 acpi_gbl_global_lock_handle; 229ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
230ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
231ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
217ACPI_EXTERN u8 acpi_gbl_debugger_configuration; 232ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
218ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; 233ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
219ACPI_EXTERN u8 acpi_gbl_step_to_next_call; 234ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 3644d7248e7e..29b60a8c0593 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 2c9c1a1d1b7f..9f22cfcb624b 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,49 @@
44#ifndef __ACINTERP_H__ 44#ifndef __ACINTERP_H__
45#define __ACINTERP_H__ 45#define __ACINTERP_H__
46 46
47#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) 47#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
48
49/* Macros for tables used for debug output */
50
51#define ACPI_EXD_OFFSET(f) (u8) ACPI_OFFSET (union acpi_operand_object,f)
52#define ACPI_EXD_NSOFFSET(f) (u8) ACPI_OFFSET (struct acpi_namespace_node,f)
53#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info))
54
55/*
56 * If possible, pack the following structure to byte alignment, since we
57 * don't care about performance for debug output
58 */
59#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
60#pragma pack(1)
61#endif
62
63typedef const struct acpi_exdump_info {
64 u8 opcode;
65 u8 offset;
66 char *name;
67
68} acpi_exdump_info;
69
70/* Values for the Opcode field above */
71
72#define ACPI_EXD_INIT 0
73#define ACPI_EXD_TYPE 1
74#define ACPI_EXD_UINT8 2
75#define ACPI_EXD_UINT16 3
76#define ACPI_EXD_UINT32 4
77#define ACPI_EXD_UINT64 5
78#define ACPI_EXD_LITERAL 6
79#define ACPI_EXD_POINTER 7
80#define ACPI_EXD_ADDRESS 8
81#define ACPI_EXD_STRING 9
82#define ACPI_EXD_BUFFER 10
83#define ACPI_EXD_PACKAGE 11
84#define ACPI_EXD_FIELD 12
85#define ACPI_EXD_REFERENCE 13
86
87/* restore default alignment */
88
89#pragma pack()
48 90
49/* 91/*
50 * exconvrt - object conversion 92 * exconvrt - object conversion
@@ -327,7 +369,7 @@ acpi_ex_dump_operands(union acpi_operand_object **operands,
327void 369void
328acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags); 370acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags);
329 371
330void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags); 372void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags);
331#endif /* ACPI_FUTURE_USAGE */ 373#endif /* ACPI_FUTURE_USAGE */
332 374
333/* 375/*
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 9fba0fddda90..8361820d2970 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -276,6 +276,37 @@ struct acpi_create_field_info {
276 u8 field_type; 276 u8 field_type;
277}; 277};
278 278
279/*
280 * Bitmapped ACPI types. Used internally only
281 */
282#define ACPI_BTYPE_ANY 0x00000000
283#define ACPI_BTYPE_INTEGER 0x00000001
284#define ACPI_BTYPE_STRING 0x00000002
285#define ACPI_BTYPE_BUFFER 0x00000004
286#define ACPI_BTYPE_PACKAGE 0x00000008
287#define ACPI_BTYPE_FIELD_UNIT 0x00000010
288#define ACPI_BTYPE_DEVICE 0x00000020
289#define ACPI_BTYPE_EVENT 0x00000040
290#define ACPI_BTYPE_METHOD 0x00000080
291#define ACPI_BTYPE_MUTEX 0x00000100
292#define ACPI_BTYPE_REGION 0x00000200
293#define ACPI_BTYPE_POWER 0x00000400
294#define ACPI_BTYPE_PROCESSOR 0x00000800
295#define ACPI_BTYPE_THERMAL 0x00001000
296#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
297#define ACPI_BTYPE_DDB_HANDLE 0x00004000
298#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
299#define ACPI_BTYPE_REFERENCE 0x00010000
300#define ACPI_BTYPE_RESOURCE 0x00020000
301
302#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
303
304#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
305#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
306#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
307#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
308#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
309
279/***************************************************************************** 310/*****************************************************************************
280 * 311 *
281 * Event typedefs and structs 312 * Event typedefs and structs
@@ -385,13 +416,13 @@ struct acpi_field_info {
385#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 416#define ACPI_CONTROL_PREDICATE_FALSE 0xC3
386#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 417#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
387 418
388#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ 419#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
389 u8 data_type; /* To differentiate various internal objs */\ 420 u8 data_type; /* To differentiate various internal objs */\
390 u8 flags; \ 421 u8 flags; \
391 u16 value; \ 422 u16 value; \
392 u16 state; \ 423 u16 state; \
393 u16 reserved; \ 424 u16 reserved; \
394 void *next; \ 425 void *next;
395 426
396struct acpi_common_state { 427struct acpi_common_state {
397ACPI_STATE_COMMON}; 428ACPI_STATE_COMMON};
@@ -544,8 +575,7 @@ union acpi_parse_value {
544 char aml_op_name[16]) /* Op name (debug only) */\ 575 char aml_op_name[16]) /* Op name (debug only) */\
545 /* NON-DEBUG members below: */\ 576 /* NON-DEBUG members below: */\
546 struct acpi_namespace_node *node; /* For use by interpreter */\ 577 struct acpi_namespace_node *node; /* For use by interpreter */\
547 union acpi_parse_value value; /* Value or args associated with the opcode */\ 578 union acpi_parse_value value; /* Value or args associated with the opcode */
548
549 579
550#define ACPI_DASM_BUFFER 0x00 580#define ACPI_DASM_BUFFER 0x00
551#define ACPI_DASM_RESOURCE 0x01 581#define ACPI_DASM_RESOURCE 0x01
@@ -573,6 +603,8 @@ struct acpi_parse_obj_named {
573 603
574/* The parse node is the fundamental element of the parse tree */ 604/* The parse node is the fundamental element of the parse tree */
575 605
606#define ACPI_MAX_PARSEOP_NAME 20
607
576struct acpi_parse_obj_asl { 608struct acpi_parse_obj_asl {
577 ACPI_PARSE_COMMON union acpi_parse_object *child; 609 ACPI_PARSE_COMMON union acpi_parse_object *child;
578 union acpi_parse_object *parent_method; 610 union acpi_parse_object *parent_method;
@@ -597,7 +629,7 @@ struct acpi_parse_obj_asl {
597 u8 aml_opcode_length; 629 u8 aml_opcode_length;
598 u8 aml_pkg_len_bytes; 630 u8 aml_pkg_len_bytes;
599 u8 extra; 631 u8 extra;
600 char parse_op_name[12]; 632 char parse_op_name[ACPI_MAX_PARSEOP_NAME];
601}; 633};
602 634
603union acpi_parse_object { 635union acpi_parse_object {
@@ -735,44 +767,52 @@ struct acpi_bit_register_info {
735 767
736/* resource_type values */ 768/* resource_type values */
737 769
738#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 770#define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
739#define ACPI_RESOURCE_TYPE_IO_RANGE 1 771#define ACPI_ADDRESS_TYPE_IO_RANGE 1
740#define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2 772#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
741 773
742/* Resource descriptor types and masks */ 774/* Resource descriptor types and masks */
743 775
744#define ACPI_RDESC_TYPE_LARGE 0x80 776#define ACPI_RESOURCE_NAME_LARGE 0x80
745#define ACPI_RDESC_TYPE_SMALL 0x00 777#define ACPI_RESOURCE_NAME_SMALL 0x00
746 778
747#define ACPI_RDESC_TYPE_MASK 0x80 779#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
748#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ 780#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
781#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
749 782
750/* 783/*
751 * Small resource descriptor types 784 * Small resource descriptor "names" as defined by the ACPI specification.
752 * Note: The 3 length bits (2:0) must be zero 785 * Note: Bits 2:0 are used for the descriptor length
753 */ 786 */
754#define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20 787#define ACPI_RESOURCE_NAME_IRQ 0x20
755#define ACPI_RDESC_TYPE_DMA_FORMAT 0x28 788#define ACPI_RESOURCE_NAME_DMA 0x28
756#define ACPI_RDESC_TYPE_START_DEPENDENT 0x30 789#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
757#define ACPI_RDESC_TYPE_END_DEPENDENT 0x38 790#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
758#define ACPI_RDESC_TYPE_IO_PORT 0x40 791#define ACPI_RESOURCE_NAME_IO 0x40
759#define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48 792#define ACPI_RESOURCE_NAME_FIXED_IO 0x48
760#define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70 793#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50
761#define ACPI_RDESC_TYPE_END_TAG 0x78 794#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
795#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
796#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
797#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
798#define ACPI_RESOURCE_NAME_END_TAG 0x78
762 799
763/* 800/*
764 * Large resource descriptor types 801 * Large resource descriptor "names" as defined by the ACPI specification.
802 * Note: includes the Large Descriptor bit in bit[7]
765 */ 803 */
766#define ACPI_RDESC_TYPE_MEMORY_24 0x81 804#define ACPI_RESOURCE_NAME_MEMORY24 0x81
767#define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82 805#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
768#define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84 806#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
769#define ACPI_RDESC_TYPE_MEMORY_32 0x85 807#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
770#define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86 808#define ACPI_RESOURCE_NAME_MEMORY32 0x85
771#define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87 809#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
772#define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88 810#define ACPI_RESOURCE_NAME_ADDRESS32 0x87
773#define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89 811#define ACPI_RESOURCE_NAME_ADDRESS16 0x88
774#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A 812#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
775#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B 813#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
814#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
815#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B
776 816
777/***************************************************************************** 817/*****************************************************************************
778 * 818 *
@@ -780,7 +820,7 @@ struct acpi_bit_register_info {
780 * 820 *
781 ****************************************************************************/ 821 ****************************************************************************/
782 822
783#define ACPI_ASCII_ZERO 0x30 823#define ACPI_ASCII_ZERO 0x30
784 824
785/***************************************************************************** 825/*****************************************************************************
786 * 826 *
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 702cc4e57f5f..f2be2a881730 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -60,7 +60,7 @@
60 60
61/* 61/*
62 * For 16-bit addresses, we have to assume that the upper 32 bits 62 * For 16-bit addresses, we have to assume that the upper 32 bits
63 * are zero. 63 * (out of 64) are zero.
64 */ 64 */
65#define ACPI_LODWORD(l) ((u32)(l)) 65#define ACPI_LODWORD(l) ((u32)(l))
66#define ACPI_HIDWORD(l) ((u32)(0)) 66#define ACPI_HIDWORD(l) ((u32)(0))
@@ -104,30 +104,38 @@
104#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) 104#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i)
105 105
106/* 106/*
107 * Extract a byte of data using a pointer. Any more than a byte and we 107 * Extract data using a pointer. Any more than a byte and we
108 * get into potential aligment issues -- see the STORE macros below 108 * get into potential aligment issues -- see the STORE macros below.
109 * Use with care.
109 */ 110 */
110#define ACPI_GET8(addr) (*(u8*)(addr)) 111#define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr)
112#define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr)
113#define ACPI_GET32(ptr) *ACPI_CAST_PTR (u32, ptr)
114#define ACPI_GET64(ptr) *ACPI_CAST_PTR (u64, ptr)
115#define ACPI_SET8(ptr) *ACPI_CAST_PTR (u8, ptr)
116#define ACPI_SET16(ptr) *ACPI_CAST_PTR (u16, ptr)
117#define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr)
118#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr)
111 119
112/* Pointer arithmetic */ 120/*
113 121 * Pointer manipulation
114#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (acpi_native_uint)(b)) 122 */
115#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) 123#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
124#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
125#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b)))
126#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b)))
116 127
117/* Pointer/Integer type conversions */ 128/* Pointer/Integer type conversions */
118 129
119#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i) 130#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
120#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 131#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
121#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 132#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
122#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) 133#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f)
123 134
124#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p))
125#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p))
126
127#if ACPI_MACHINE_WIDTH == 16 135#if ACPI_MACHINE_WIDTH == 16
128#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) 136#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
129#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) 137#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i)
130#define ACPI_PTR_TO_PHYSADDR(i) (u32) (char *)(i) 138#define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i))
131#else 139#else
132#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 140#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
133#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 141#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
@@ -202,7 +210,7 @@
202 210
203#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) 211#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset)
204 212
205#ifdef ACPI_MISALIGNED_TRANSFERS 213#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
206 214
207/* The hardware supports unaligned transfers, just do the little-endian move */ 215/* The hardware supports unaligned transfers, just do the little-endian move */
208 216
@@ -326,11 +334,19 @@
326#define ACPI_MUL_16(a) _ACPI_MUL(a,4) 334#define ACPI_MUL_16(a) _ACPI_MUL(a,4)
327#define ACPI_MOD_16(a) _ACPI_MOD(a,16) 335#define ACPI_MOD_16(a) _ACPI_MOD(a,16)
328 336
337#define ACPI_DIV_32(a) _ACPI_DIV(a,5)
338#define ACPI_MUL_32(a) _ACPI_MUL(a,5)
339#define ACPI_MOD_32(a) _ACPI_MOD(a,32)
340
329/* 341/*
330 * Rounding macros (Power of two boundaries only) 342 * Rounding macros (Power of two boundaries only)
331 */ 343 */
332#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & (~(((acpi_native_uint) boundary)-1))) 344#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \
333#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + (((acpi_native_uint) boundary)-1)) & (~(((acpi_native_uint) boundary)-1))) 345 (~(((acpi_native_uint) boundary)-1)))
346
347#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \
348 (((acpi_native_uint) boundary)-1)) & \
349 (~(((acpi_native_uint) boundary)-1)))
334 350
335#define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) 351#define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4)
336#define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) 352#define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8)
@@ -365,6 +381,14 @@
365#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) 381#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask)
366#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) 382#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask)
367 383
384/* Generate a UUID */
385
386#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
387 (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \
388 (b) & 0xFF, ((b) >> 8) & 0xFF, \
389 (c) & 0xFF, ((c) >> 8) & 0xFF, \
390 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)
391
368/* 392/*
369 * An struct acpi_namespace_node * can appear in some contexts, 393 * An struct acpi_namespace_node * can appear in some contexts,
370 * where a pointer to an union acpi_operand_object can also 394 * where a pointer to an union acpi_operand_object can also
@@ -423,57 +447,52 @@
423#define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) 447#define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F))
424#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) 448#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH))
425 449
450#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
426/* 451/*
427 * Reporting macros that are never compiled out 452 * Module name is include in both debug and non-debug versions primarily for
453 * error messages. The __FILE__ macro is not very useful for this, because it
454 * often includes the entire pathname to the module
428 */ 455 */
429#define ACPI_PARAM_LIST(pl) pl 456#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
457#else
458#define ACPI_MODULE_NAME(name)
459#endif
430 460
431/* 461/*
432 * Error reporting. These versions add callers module and line#. 462 * Ascii error messages can be configured out
433 *
434 * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT
435 * isn't defined, only use it in debug mode.
436 */ 463 */
437#ifdef ACPI_DEBUG_OUTPUT 464#ifndef ACPI_NO_ERROR_MESSAGES
465#define AE_INFO _acpi_module_name, __LINE__
438 466
439#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \ 467/*
440 acpi_os_printf ACPI_PARAM_LIST(fp);} 468 * Error reporting. Callers module and line number are inserted by AE_INFO,
441#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \ 469 * the plist contains a set of parens to allow variable-length lists.
442 acpi_os_printf ACPI_PARAM_LIST(fp);} 470 * These macros are used for both the debug and non-debug versions of the code.
443#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \ 471 */
444 acpi_os_printf ACPI_PARAM_LIST(fp);} 472#define ACPI_INFO(plist) acpi_ut_info plist
445#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e); 473#define ACPI_WARNING(plist) acpi_ut_warning plist
446 474#define ACPI_EXCEPTION(plist) acpi_ut_exception plist
447#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e); 475#define ACPI_ERROR(plist) acpi_ut_error plist
476#define ACPI_ERROR_NAMESPACE(s,e) acpi_ns_report_error (AE_INFO, s, e);
477#define ACPI_ERROR_METHOD(s,n,p,e) acpi_ns_report_method_error (AE_INFO, s, n, p, e);
448 478
449#else 479#else
450 480
451#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ 481/* No error messages */
452 acpi_os_printf ACPI_PARAM_LIST(fp);}
453#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \
454 acpi_os_printf ACPI_PARAM_LIST(fp);}
455#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \
456 acpi_os_printf ACPI_PARAM_LIST(fp);}
457#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e);
458 482
459#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error("ACPI",__LINE__,_COMPONENT, s, n, p, e); 483#define ACPI_INFO(plist)
484#define ACPI_WARNING(plist)
485#define ACPI_EXCEPTION(plist)
486#define ACPI_ERROR(plist)
487#define ACPI_ERROR_NAMESPACE(s,e)
488#define ACPI_ERROR_METHOD(s,n,p,e)
460 489
461#endif 490#endif
462 491
463/* Error reporting. These versions pass thru the module and line# */
464
465#define _ACPI_REPORT_INFO(a,b,c,fp) {acpi_ut_report_info(a,b,c); \
466 acpi_os_printf ACPI_PARAM_LIST(fp);}
467#define _ACPI_REPORT_ERROR(a,b,c,fp) {acpi_ut_report_error(a,b,c); \
468 acpi_os_printf ACPI_PARAM_LIST(fp);}
469#define _ACPI_REPORT_WARNING(a,b,c,fp) {acpi_ut_report_warning(a,b,c); \
470 acpi_os_printf ACPI_PARAM_LIST(fp);}
471
472/* 492/*
473 * Debug macros that are conditionally compiled 493 * Debug macros that are conditionally compiled
474 */ 494 */
475#ifdef ACPI_DEBUG_OUTPUT 495#ifdef ACPI_DEBUG_OUTPUT
476#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
477 496
478/* 497/*
479 * Common parameters used for debug output functions: 498 * Common parameters used for debug output functions:
@@ -509,7 +528,7 @@
509#endif 528#endif
510 529
511#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 530#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
512 acpi_ut_trace(ACPI_DEBUG_PARAMETERS) 531 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
513#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 532#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
514 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) 533 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
515#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ 534#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
@@ -525,6 +544,9 @@
525 * bad form, but having a separate exit macro is very ugly and difficult to maintain. 544 * bad form, but having a separate exit macro is very ugly and difficult to maintain.
526 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros 545 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
527 * so that "_acpi_function_name" is defined. 546 * so that "_acpi_function_name" is defined.
547 *
548 * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
549 * about these constructs.
528 */ 550 */
529#ifdef ACPI_USE_DO_WHILE_0 551#ifdef ACPI_USE_DO_WHILE_0
530#define ACPI_DO_WHILE0(a) do a while(0) 552#define ACPI_DO_WHILE0(a) do a while(0)
@@ -532,10 +554,55 @@
532#define ACPI_DO_WHILE0(a) a 554#define ACPI_DO_WHILE0(a) a
533#endif 555#endif
534 556
535#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;}) 557#define return_VOID ACPI_DO_WHILE0 ({ \
536#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));}) 558 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
537#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));}) 559 return;})
538#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));}) 560/*
561 * There are two versions of most of the return macros. The default version is
562 * safer, since it avoids side-effects by guaranteeing that the argument will
563 * not be evaluated twice.
564 *
565 * A less-safe version of the macros is provided for optional use if the
566 * compiler uses excessive CPU stack (for example, this may happen in the
567 * debug case if code optimzation is disabled.)
568 */
569#ifndef ACPI_SIMPLE_RETURN_MACROS
570
571#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
572 register acpi_status _s = (s); \
573 acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, _s); \
574 return (_s); })
575#define return_PTR(s) ACPI_DO_WHILE0 ({ \
576 register void *_s = (void *) (s); \
577 acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \
578 return (_s); })
579#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
580 register acpi_integer _s = (s); \
581 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \
582 return (_s); })
583#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
584 register u8 _s = (u8) (s); \
585 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
586 return (_s); })
587#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
588 register u32 _s = (u32) (s); \
589 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
590 return (_s); })
591#else /* Use original less-safe macros */
592
593#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
594 acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, (s)); \
595 return((s)); })
596#define return_PTR(s) ACPI_DO_WHILE0 ({ \
597 acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \
598 return((s)); })
599#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
600 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) (s)); \
601 return((s)); })
602#define return_UINT8(s) return_VALUE(s)
603#define return_UINT32(s) return_VALUE(s)
604
605#endif /* ACPI_SIMPLE_RETURN_MACROS */
539 606
540/* Conditional execution */ 607/* Conditional execution */
541 608
@@ -555,18 +622,6 @@
555#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) 622#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d)
556#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) 623#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a)
557#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) 624#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
558#define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a))
559
560/*
561 * Generate INT3 on ACPI_ERROR (Debug only!)
562 */
563#define ACPI_ERROR_BREAK
564#ifdef ACPI_ERROR_BREAK
565#define ACPI_BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) \
566 acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n")
567#else
568#define ACPI_BREAK_ON_ERROR(lvl)
569#endif
570 625
571/* 626/*
572 * Master debug print macros 627 * Master debug print macros
@@ -574,17 +629,14 @@
574 * 1) Debug print for the current component is enabled 629 * 1) Debug print for the current component is enabled
575 * 2) Debug error level or trace level for the print statement is enabled 630 * 2) Debug error level or trace level for the print statement is enabled
576 */ 631 */
577#define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) 632#define ACPI_DEBUG_PRINT(plist) acpi_ut_debug_print plist
578#define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) 633#define ACPI_DEBUG_PRINT_RAW(plist) acpi_ut_debug_print_raw plist
579 634
580#else 635#else
581/* 636/*
582 * This is the non-debug case -- make everything go away, 637 * This is the non-debug case -- make everything go away,
583 * leaving no executable debug code! 638 * leaving no executable debug code!
584 */ 639 */
585#define ACPI_MODULE_NAME(name)
586#define _acpi_module_name ""
587
588#define ACPI_DEBUG_EXEC(a) 640#define ACPI_DEBUG_EXEC(a)
589#define ACPI_NORMAL_EXEC(a) a; 641#define ACPI_NORMAL_EXEC(a) a;
590 642
@@ -607,11 +659,12 @@
607#define ACPI_DUMP_BUFFER(a,b) 659#define ACPI_DUMP_BUFFER(a,b)
608#define ACPI_DEBUG_PRINT(pl) 660#define ACPI_DEBUG_PRINT(pl)
609#define ACPI_DEBUG_PRINT_RAW(pl) 661#define ACPI_DEBUG_PRINT_RAW(pl)
610#define ACPI_BREAK_MSG(a)
611 662
612#define return_VOID return 663#define return_VOID return
613#define return_ACPI_STATUS(s) return(s) 664#define return_ACPI_STATUS(s) return(s)
614#define return_VALUE(s) return(s) 665#define return_VALUE(s) return(s)
666#define return_UINT8(s) return(s)
667#define return_UINT32(s) return(s)
615#define return_PTR(s) return(s) 668#define return_PTR(s) return(s)
616 669
617#endif 670#endif
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 4f9063f3e951..b67da3636899 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index dd3501f7e5d6..b667a804fc8a 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -263,13 +263,11 @@ u32 acpi_ns_local(acpi_object_type type);
263void 263void
264acpi_ns_report_error(char *module_name, 264acpi_ns_report_error(char *module_name,
265 u32 line_number, 265 u32 line_number,
266 u32 component_id,
267 char *internal_name, acpi_status lookup_status); 266 char *internal_name, acpi_status lookup_status);
268 267
269void 268void
270acpi_ns_report_method_error(char *module_name, 269acpi_ns_report_method_error(char *module_name,
271 u32 line_number, 270 u32 line_number,
272 u32 component_id,
273 char *message, 271 char *message,
274 struct acpi_namespace_node *node, 272 struct acpi_namespace_node *node,
275 char *path, acpi_status lookup_status); 273 char *path, acpi_status lookup_status);
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 4a326ba6d482..d130cfed8d55 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -69,7 +69,7 @@
69 u8 type; /* acpi_object_type */\ 69 u8 type; /* acpi_object_type */\
70 u16 reference_count; /* For object deletion management */\ 70 u16 reference_count; /* For object deletion management */\
71 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ 71 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\
72 u8 flags; \ 72 u8 flags;
73 73
74/* Values for flag byte above */ 74/* Values for flag byte above */
75 75
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index 64da42992199..e6d78bd9e90a 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 68d7edf0f697..7785d481dc3e 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -137,13 +137,19 @@
137 137
138/* Exception level -- used in the global "debug_level" */ 138/* Exception level -- used in the global "debug_level" */
139 139
140#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
141#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
142#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) 140#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
143#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) 141#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
144#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) 142#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
145#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) 143#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
146 144
145/*
146 * These two levels are essentially obsolete, all instances in the
147 * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING
148 * (Kept here because some drivers may still use them)
149 */
150#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
151#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
152
147/* Trace level -- also used in the global "debug_level" */ 153/* Trace level -- also used in the global "debug_level" */
148 154
149#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) 155#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index d352d40de1f3..5a1ff484af33 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index ccf34f9dac64..b9a39d1009bd 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index c1b4e1f882e4..b425f9bb6d43 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -52,8 +52,8 @@
52/* ACPI PCI Interrupt Link (pci_link.c) */ 52/* ACPI PCI Interrupt Link (pci_link.c) */
53 53
54int acpi_irq_penalty_init(void); 54int acpi_irq_penalty_init(void);
55int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *edge_level, 55int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
56 int *active_high_low, char **name); 56 int *polarity, char **name);
57int acpi_pci_link_free_irq(acpi_handle handle); 57int acpi_pci_link_free_irq(acpi_handle handle);
58 58
59/* ACPI PCI Interrupt Routing (pci_irq.c) */ 59/* ACPI PCI Interrupt Routing (pci_irq.c) */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 98e0b8cd14ed..970e9a6372c3 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -8,7 +8,7 @@
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
10/* 10/*
11 * Copyright (C) 2000 - 2005, R. Byron Moore 11 * Copyright (C) 2000 - 2006, R. Byron Moore
12 * All rights reserved. 12 * All rights reserved.
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
@@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle);
108 108
109void acpi_os_delete_lock(acpi_handle handle); 109void acpi_os_delete_lock(acpi_handle handle);
110 110
111unsigned long acpi_os_acquire_lock(acpi_handle handle); 111acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle);
112 112
113void acpi_os_release_lock(acpi_handle handle, unsigned long flags); 113void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags);
114 114
115/* 115/*
116 * Memory allocation and mapping 116 * Memory allocation and mapping
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 2a9dbc13b0f2..66cf2ecef57a 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -149,6 +149,9 @@ acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler);
149acpi_status 149acpi_status
150acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); 150acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data);
151 151
152acpi_status
153acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags);
154
152/* 155/*
153 * Object manipulation and enumeration 156 * Object manipulation and enumeration
154 */ 157 */
@@ -269,6 +272,12 @@ acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource,
269 void *context); 272 void *context);
270 273
271acpi_status 274acpi_status
275acpi_get_vendor_resource(acpi_handle device_handle,
276 char *name,
277 struct acpi_vendor_uuid *uuid,
278 struct acpi_buffer *ret_buffer);
279
280acpi_status
272acpi_get_current_resources(acpi_handle device_handle, 281acpi_get_current_resources(acpi_handle device_handle,
273 struct acpi_buffer *ret_buffer); 282 struct acpi_buffer *ret_buffer);
274 283
@@ -280,7 +289,7 @@ acpi_get_possible_resources(acpi_handle device_handle,
280 289
281acpi_status 290acpi_status
282acpi_walk_resources(acpi_handle device_handle, 291acpi_walk_resources(acpi_handle device_handle,
283 char *path, 292 char *name,
284 ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); 293 ACPI_WALK_RESOURCE_CALLBACK user_function, void *context);
285 294
286acpi_status 295acpi_status
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 38e798b05d08..fa02e8083381 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -44,216 +44,284 @@
44#ifndef __ACRESRC_H__ 44#ifndef __ACRESRC_H__
45#define __ACRESRC_H__ 45#define __ACRESRC_H__
46 46
47/* 47/* Need the AML resource descriptor structs */
48 * Function prototypes called from Acpi* APIs
49 */
50acpi_status
51acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
52 48
53acpi_status 49#include "amlresrc.h"
54acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
55 50
56#ifdef ACPI_FUTURE_USAGE 51/*
57acpi_status 52 * If possible, pack the following structures to byte alignment, since we
58acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 53 * don't care about performance for debug output
59#endif /* ACPI_FUTURE_USAGE */ 54 */
60 55#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
61acpi_status 56#pragma pack(1)
62acpi_rs_get_method_data(acpi_handle handle, 57#endif
63 char *path, struct acpi_buffer *ret_buffer);
64 58
65acpi_status 59/*
66acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 60 * Individual entry for the resource conversion tables
61 */
62typedef const struct acpi_rsconvert_info {
63 u8 opcode;
64 u8 resource_offset;
65 u8 aml_offset;
66 u8 value;
67
68} acpi_rsconvert_info;
69
70/* Resource conversion opcodes */
71
72#define ACPI_RSC_INITGET 0
73#define ACPI_RSC_INITSET 1
74#define ACPI_RSC_FLAGINIT 2
75#define ACPI_RSC_1BITFLAG 3
76#define ACPI_RSC_2BITFLAG 4
77#define ACPI_RSC_COUNT 5
78#define ACPI_RSC_COUNT16 6
79#define ACPI_RSC_LENGTH 7
80#define ACPI_RSC_MOVE8 8
81#define ACPI_RSC_MOVE16 9
82#define ACPI_RSC_MOVE32 10
83#define ACPI_RSC_MOVE64 11
84#define ACPI_RSC_SET8 12
85#define ACPI_RSC_DATA8 13
86#define ACPI_RSC_ADDRESS 14
87#define ACPI_RSC_SOURCE 15
88#define ACPI_RSC_SOURCEX 16
89#define ACPI_RSC_BITMASK 17
90#define ACPI_RSC_BITMASK16 18
91#define ACPI_RSC_EXIT_NE 19
92#define ACPI_RSC_EXIT_LE 20
93
94/* Resource Conversion sub-opcodes */
95
96#define ACPI_RSC_COMPARE_AML_LENGTH 0
97#define ACPI_RSC_COMPARE_VALUE 1
98
99#define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (struct acpi_rsconvert_info))
100
101#define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f)
102#define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f)
103
104typedef const struct acpi_rsdump_info {
105 u8 opcode;
106 u8 offset;
107 char *name;
108 const char **pointer;
109
110} acpi_rsdump_info;
111
112/* Values for the Opcode field above */
113
114#define ACPI_RSD_TITLE 0
115#define ACPI_RSD_LITERAL 1
116#define ACPI_RSD_STRING 2
117#define ACPI_RSD_UINT8 3
118#define ACPI_RSD_UINT16 4
119#define ACPI_RSD_UINT32 5
120#define ACPI_RSD_UINT64 6
121#define ACPI_RSD_1BITFLAG 7
122#define ACPI_RSD_2BITFLAG 8
123#define ACPI_RSD_SHORTLIST 9
124#define ACPI_RSD_LONGLIST 10
125#define ACPI_RSD_DWORDLIST 11
126#define ACPI_RSD_ADDRESS 12
127#define ACPI_RSD_SOURCE 13
128
129/* restore default alignment */
130
131#pragma pack()
132
133/* Resource tables indexed by internal resource type */
134
135extern const u8 acpi_gbl_aml_resource_sizes[];
136extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[];
137
138/* Resource tables indexed by raw AML resource descriptor type */
139
140extern const u8 acpi_gbl_resource_struct_sizes[];
141extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[];
142
143struct acpi_vendor_walk_info {
144 struct acpi_vendor_uuid *uuid;
145 struct acpi_buffer *buffer;
146 acpi_status status;
147};
67 148
149/*
150 * rscreate
151 */
68acpi_status 152acpi_status
69acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer, 153acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
70 struct acpi_buffer *output_buffer); 154 struct acpi_buffer *output_buffer);
71 155
72acpi_status 156acpi_status
73acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer, 157acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
74 struct acpi_buffer *output_buffer); 158 struct acpi_buffer *output_buffer);
75 159
76acpi_status 160acpi_status
77acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, 161acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
78 struct acpi_buffer *output_buffer); 162 struct acpi_buffer *output_buffer);
79 163
80/* 164/*
81 * rsdump 165 * rsutils
82 */ 166 */
83#ifdef ACPI_FUTURE_USAGE
84void acpi_rs_dump_resource_list(struct acpi_resource *resource);
85
86void acpi_rs_dump_irq_list(u8 * route_table);
87#endif /* ACPI_FUTURE_USAGE */
88
89/*
90 * rscalc
91 */
92acpi_status
93acpi_rs_get_byte_stream_start(u8 * byte_stream_buffer,
94 u8 ** byte_stream_start, u32 * size);
95
96acpi_status
97acpi_rs_get_list_length(u8 * byte_stream_buffer,
98 u32 byte_stream_buffer_length, acpi_size * size_needed);
99
100acpi_status
101acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list_buffer,
102 acpi_size * size_needed);
103
104acpi_status
105acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
106 acpi_size * buffer_size_needed);
107
108acpi_status
109acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer,
110 u32 byte_stream_buffer_length, u8 * output_buffer);
111
112acpi_status
113acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list,
114 acpi_size byte_stream_size_needed,
115 u8 * output_buffer);
116
117acpi_status
118acpi_rs_io_resource(u8 * byte_stream_buffer,
119 acpi_size * bytes_consumed,
120 u8 ** output_buffer, acpi_size * structure_size);
121
122acpi_status
123acpi_rs_fixed_io_resource(u8 * byte_stream_buffer,
124 acpi_size * bytes_consumed,
125 u8 ** output_buffer, acpi_size * structure_size);
126
127acpi_status 167acpi_status
128acpi_rs_io_stream(struct acpi_resource *linked_list, 168acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
129 u8 ** output_buffer, acpi_size * bytes_consumed);
130
131acpi_status
132acpi_rs_fixed_io_stream(struct acpi_resource *linked_list,
133 u8 ** output_buffer, acpi_size * bytes_consumed);
134
135acpi_status
136acpi_rs_irq_resource(u8 * byte_stream_buffer,
137 acpi_size * bytes_consumed,
138 u8 ** output_buffer, acpi_size * structure_size);
139
140acpi_status
141acpi_rs_irq_stream(struct acpi_resource *linked_list,
142 u8 ** output_buffer, acpi_size * bytes_consumed);
143
144acpi_status
145acpi_rs_dma_resource(u8 * byte_stream_buffer,
146 acpi_size * bytes_consumed,
147 u8 ** output_buffer, acpi_size * structure_size);
148 169
149acpi_status 170acpi_status
150acpi_rs_dma_stream(struct acpi_resource *linked_list, 171acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
151 u8 ** output_buffer, acpi_size * bytes_consumed);
152 172
173#ifdef ACPI_FUTURE_USAGE
153acpi_status 174acpi_status
154acpi_rs_address16_resource(u8 * byte_stream_buffer, 175acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
155 acpi_size * bytes_consumed, 176#endif /* ACPI_FUTURE_USAGE */
156 u8 ** output_buffer, acpi_size * structure_size);
157 177
158acpi_status 178acpi_status
159acpi_rs_address16_stream(struct acpi_resource *linked_list, 179acpi_rs_get_method_data(acpi_handle handle,
160 u8 ** output_buffer, acpi_size * bytes_consumed); 180 char *path, struct acpi_buffer *ret_buffer);
161 181
162acpi_status 182acpi_status
163acpi_rs_address32_resource(u8 * byte_stream_buffer, 183acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
164 acpi_size * bytes_consumed,
165 u8 ** output_buffer, acpi_size * structure_size);
166 184
185/*
186 * rscalc
187 */
167acpi_status 188acpi_status
168acpi_rs_address32_stream(struct acpi_resource *linked_list, 189acpi_rs_get_list_length(u8 * aml_buffer,
169 u8 ** output_buffer, acpi_size * bytes_consumed); 190 u32 aml_buffer_length, acpi_size * size_needed);
170 191
171acpi_status 192acpi_status
172acpi_rs_address64_resource(u8 * byte_stream_buffer, 193acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer,
173 acpi_size * bytes_consumed, 194 acpi_size * size_needed);
174 u8 ** output_buffer, acpi_size * structure_size);
175 195
176acpi_status 196acpi_status
177acpi_rs_address64_stream(struct acpi_resource *linked_list, 197acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
178 u8 ** output_buffer, acpi_size * bytes_consumed); 198 acpi_size * buffer_size_needed);
179 199
180acpi_status 200acpi_status
181acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer, 201acpi_rs_convert_aml_to_resources(u8 * aml_buffer,
182 acpi_size * bytes_consumed, 202 u32 aml_buffer_length, u8 * output_buffer);
183 u8 ** output_buffer,
184 acpi_size * structure_size);
185 203
186acpi_status 204acpi_status
187acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, 205acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
188 acpi_size * bytes_consumed, 206 acpi_size aml_size_needed, u8 * output_buffer);
189 u8 ** output_buffer,
190 acpi_size * structure_size);
191 207
192acpi_status 208/*
193acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list, 209 * rsaddr
194 u8 ** output_buffer, 210 */
195 acpi_size * bytes_consumed); 211void
212acpi_rs_set_address_common(union aml_resource *aml,
213 struct acpi_resource *resource);
196 214
197acpi_status 215u8
198acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list, 216acpi_rs_get_address_common(struct acpi_resource *resource,
199 u8 ** output_buffer, acpi_size * bytes_consumed); 217 union aml_resource *aml);
200 218
219/*
220 * rsmisc
221 */
201acpi_status 222acpi_status
202acpi_rs_memory24_resource(u8 * byte_stream_buffer, 223acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
203 acpi_size * bytes_consumed, 224 union aml_resource *aml,
204 u8 ** output_buffer, acpi_size * structure_size); 225 struct acpi_rsconvert_info *info);
205 226
206acpi_status 227acpi_status
207acpi_rs_memory24_stream(struct acpi_resource *linked_list, 228acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
208 u8 ** output_buffer, acpi_size * bytes_consumed); 229 union aml_resource *aml,
230 struct acpi_rsconvert_info *info);
209 231
210acpi_status 232/*
211acpi_rs_memory32_range_resource(u8 * byte_stream_buffer, 233 * rsutils
212 acpi_size * bytes_consumed, 234 */
213 u8 ** output_buffer, 235void
214 acpi_size * structure_size); 236acpi_rs_move_data(void *destination,
237 void *source, u16 item_count, u8 move_type);
215 238
216acpi_status 239u8 acpi_rs_decode_bitmask(u16 mask, u8 * list);
217acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
218 acpi_size * bytes_consumed,
219 u8 ** output_buffer,
220 acpi_size * structure_size);
221 240
222acpi_status 241u16 acpi_rs_encode_bitmask(u8 * list, u8 count);
223acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
224 u8 ** output_buffer, acpi_size * bytes_consumed);
225 242
226acpi_status 243acpi_rs_length
227acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list, 244acpi_rs_get_resource_source(acpi_rs_length resource_length,
228 u8 ** output_buffer, acpi_size * bytes_consumed); 245 acpi_rs_length minimum_length,
246 struct acpi_resource_source *resource_source,
247 union aml_resource *aml, char *string_ptr);
229 248
230acpi_status 249acpi_rsdesc_size
231acpi_rs_extended_irq_resource(u8 * byte_stream_buffer, 250acpi_rs_set_resource_source(union aml_resource *aml,
232 acpi_size * bytes_consumed, 251 acpi_rs_length minimum_length,
233 u8 ** output_buffer, acpi_size * structure_size); 252 struct acpi_resource_source *resource_source);
234 253
235acpi_status 254void
236acpi_rs_extended_irq_stream(struct acpi_resource *linked_list, 255acpi_rs_set_resource_header(u8 descriptor_type,
237 u8 ** output_buffer, acpi_size * bytes_consumed); 256 acpi_rsdesc_size total_length,
257 union aml_resource *aml);
238 258
239acpi_status 259void
240acpi_rs_end_tag_resource(u8 * byte_stream_buffer, 260acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
241 acpi_size * bytes_consumed, 261 union aml_resource *aml);
242 u8 ** output_buffer, acpi_size * structure_size);
243 262
244acpi_status 263/*
245acpi_rs_end_tag_stream(struct acpi_resource *linked_list, 264 * rsdump
246 u8 ** output_buffer, acpi_size * bytes_consumed); 265 */
266void acpi_rs_dump_resource_list(struct acpi_resource *resource);
247 267
248acpi_status 268void acpi_rs_dump_irq_list(u8 * route_table);
249acpi_rs_vendor_resource(u8 * byte_stream_buffer,
250 acpi_size * bytes_consumed,
251 u8 ** output_buffer, acpi_size * structure_size);
252 269
253acpi_status 270/*
254acpi_rs_vendor_stream(struct acpi_resource *linked_list, 271 * Resource conversion tables
255 u8 ** output_buffer, acpi_size * bytes_consumed); 272 */
273extern struct acpi_rsconvert_info acpi_rs_convert_dma[];
274extern struct acpi_rsconvert_info acpi_rs_convert_end_dpf[];
275extern struct acpi_rsconvert_info acpi_rs_convert_io[];
276extern struct acpi_rsconvert_info acpi_rs_convert_fixed_io[];
277extern struct acpi_rsconvert_info acpi_rs_convert_end_tag[];
278extern struct acpi_rsconvert_info acpi_rs_convert_memory24[];
279extern struct acpi_rsconvert_info acpi_rs_convert_generic_reg[];
280extern struct acpi_rsconvert_info acpi_rs_convert_memory32[];
281extern struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[];
282extern struct acpi_rsconvert_info acpi_rs_convert_address32[];
283extern struct acpi_rsconvert_info acpi_rs_convert_address16[];
284extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[];
285extern struct acpi_rsconvert_info acpi_rs_convert_address64[];
286extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[];
287
288/* These resources require separate get/set tables */
289
290extern struct acpi_rsconvert_info acpi_rs_get_irq[];
291extern struct acpi_rsconvert_info acpi_rs_get_start_dpf[];
292extern struct acpi_rsconvert_info acpi_rs_get_vendor_small[];
293extern struct acpi_rsconvert_info acpi_rs_get_vendor_large[];
294
295extern struct acpi_rsconvert_info acpi_rs_set_irq[];
296extern struct acpi_rsconvert_info acpi_rs_set_start_dpf[];
297extern struct acpi_rsconvert_info acpi_rs_set_vendor[];
298
299#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
300/*
301 * rsinfo
302 */
303extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[];
256 304
257u8 acpi_rs_get_resource_type(u8 resource_start_byte); 305/*
306 * rsdump
307 */
308extern struct acpi_rsdump_info acpi_rs_dump_irq[];
309extern struct acpi_rsdump_info acpi_rs_dump_dma[];
310extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[];
311extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[];
312extern struct acpi_rsdump_info acpi_rs_dump_io[];
313extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[];
314extern struct acpi_rsdump_info acpi_rs_dump_vendor[];
315extern struct acpi_rsdump_info acpi_rs_dump_end_tag[];
316extern struct acpi_rsdump_info acpi_rs_dump_memory24[];
317extern struct acpi_rsdump_info acpi_rs_dump_memory32[];
318extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[];
319extern struct acpi_rsdump_info acpi_rs_dump_address16[];
320extern struct acpi_rsdump_info acpi_rs_dump_address32[];
321extern struct acpi_rsdump_info acpi_rs_dump_address64[];
322extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[];
323extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[];
324extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[];
325#endif
258 326
259#endif /* __ACRESRC_H__ */ 327#endif /* __ACRESRC_H__ */
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 99d235339801..d8c1c2cdac0c 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index f92c1858b808..30a47542e1c8 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index a46f406e1c94..ed53f842dad4 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,12 @@
45#define __ACTBL_H__ 45#define __ACTBL_H__
46 46
47/* 47/*
48 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
49 * This is the only type that is even remotely portable. Anything else is not
50 * portable, so do not use any other bitfield types.
51 */
52
53/*
48 * Values for description table header signatures 54 * Values for description table header signatures
49 */ 55 */
50#define RSDP_NAME "RSDP" 56#define RSDP_NAME "RSDP"
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 67312c3a915a..cd428d57add0 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 50305ce2681a..dfc7ac1094bb 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 6213b27516e8..7ca89cde706e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,15 @@
44#ifndef __ACTYPES_H__ 44#ifndef __ACTYPES_H__
45#define __ACTYPES_H__ 45#define __ACTYPES_H__
46 46
47/*! [Begin] no source code translation (keep the typedefs) */ 47/*
48 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
49 * and must be either 16, 32, or 64
50 */
51#ifndef ACPI_MACHINE_WIDTH
52#error ACPI_MACHINE_WIDTH not defined
53#endif
54
55/*! [Begin] no source code translation */
48 56
49/* 57/*
50 * Data type ranges 58 * Data type ranges
@@ -58,87 +66,150 @@
58#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ 66#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
59#define ACPI_ASCII_MAX 0x7F 67#define ACPI_ASCII_MAX 0x7F
60 68
61#ifdef DEFINE_ALTERNATE_TYPES
62/* 69/*
63 * Types used only in translated source, defined here to enable 70 * Architecture-specific ACPICA Subsystem Data Types
64 * cross-platform compilation only. 71 *
72 * The goal of these types is to provide source code portability across
73 * 16-bit, 32-bit, and 64-bit targets.
74 *
75 * 1) The following types are of fixed size for all targets (16/32/64):
76 *
77 * BOOLEAN Logical boolean
78 *
79 * UINT8 8-bit (1 byte) unsigned value
80 * UINT16 16-bit (2 byte) unsigned value
81 * UINT32 32-bit (4 byte) unsigned value
82 * UINT64 64-bit (8 byte) unsigned value
83 *
84 * INT16 16-bit (2 byte) signed value
85 * INT32 32-bit (4 byte) signed value
86 * INT64 64-bit (8 byte) signed value
87 *
88 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
89 * compiler-dependent header(s) and were introduced because there is no common
90 * 64-bit integer type across the various compilation models, as shown in
91 * the table below.
92 *
93 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit
94 * char 8 8 8 8 8 8
95 * short 16 16 16 16 16 16
96 * _int32 32
97 * int 32 64 32 32 16 16
98 * long 64 64 32 32 32 32
99 * long long 64 64
100 * pointer 64 64 64 32 32 32
101 *
102 * Note: ILP64 and LP32 are currently not supported.
103 *
104 *
105 * 2) These types represent the native word size of the target mode of the
106 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
107 * usually used for memory allocation, efficient loop counters, and array
108 * indexes. The types are similar to the size_t type in the C library and are
109 * required because there is no C type that consistently represents the native
110 * data width.
111 *
112 * ACPI_SIZE 16/32/64-bit unsigned value
113 * ACPI_NATIVE_UINT 16/32/64-bit unsigned value
114 * ACPI_NATIVE_INT 16/32/64-bit signed value
115 *
65 */ 116 */
66typedef int s32;
67typedef unsigned char u8;
68typedef unsigned short u16;
69typedef unsigned int u32;
70typedef COMPILER_DEPENDENT_UINT64 u64;
71
72#endif
73 117
74/* 118/*******************************************************************************
75 * Data types - Fixed across all compilation models (16/32/64)
76 * 119 *
77 * BOOLEAN Logical Boolean. 120 * Common types for all compilers, all targets
78 * INT8 8-bit (1 byte) signed value 121 *
79 * UINT8 8-bit (1 byte) unsigned value 122 ******************************************************************************/
80 * INT16 16-bit (2 byte) signed value
81 * UINT16 16-bit (2 byte) unsigned value
82 * INT32 32-bit (4 byte) signed value
83 * UINT32 32-bit (4 byte) unsigned value
84 * INT64 64-bit (8 byte) signed value
85 * UINT64 64-bit (8 byte) unsigned value
86 * ACPI_NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value
87 * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value
88 */
89 123
90#ifndef ACPI_MACHINE_WIDTH 124typedef unsigned char BOOLEAN;
91#error ACPI_MACHINE_WIDTH not defined 125typedef unsigned char UINT8;
92#endif 126typedef unsigned short UINT16;
127typedef COMPILER_DEPENDENT_UINT64 UINT64;
128typedef COMPILER_DEPENDENT_INT64 INT64;
129
130/*! [End] no source code translation !*/
131
132/*******************************************************************************
133 *
134 * Types specific to 64-bit targets
135 *
136 ******************************************************************************/
93 137
94#if ACPI_MACHINE_WIDTH == 64 138#if ACPI_MACHINE_WIDTH == 64
95 139
96/*! [Begin] no source code translation (keep the typedefs) */ 140/*! [Begin] no source code translation (keep the typedefs as-is) */
97 141
98/*
99 * 64-bit type definitions
100 */
101typedef unsigned char UINT8;
102typedef unsigned char BOOLEAN;
103typedef unsigned short UINT16;
104typedef int INT32;
105typedef unsigned int UINT32; 142typedef unsigned int UINT32;
106typedef COMPILER_DEPENDENT_INT64 INT64; 143typedef int INT32;
107typedef COMPILER_DEPENDENT_UINT64 UINT64;
108 144
109/*! [End] no source code translation !*/ 145/*! [End] no source code translation !*/
110 146
111typedef s64 acpi_native_int;
112typedef u64 acpi_native_uint; 147typedef u64 acpi_native_uint;
148typedef s64 acpi_native_int;
113 149
114typedef u64 acpi_table_ptr; 150typedef u64 acpi_table_ptr;
115typedef u64 acpi_io_address; 151typedef u64 acpi_io_address;
116typedef u64 acpi_physical_address; 152typedef u64 acpi_physical_address;
117typedef u64 acpi_size;
118 153
119#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */
120#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */
121#define ACPI_MAX_PTR ACPI_UINT64_MAX 154#define ACPI_MAX_PTR ACPI_UINT64_MAX
122#define ACPI_SIZE_MAX ACPI_UINT64_MAX 155#define ACPI_SIZE_MAX ACPI_UINT64_MAX
123 156
124#elif ACPI_MACHINE_WIDTH == 16 157#define ALIGNED_ADDRESS_BOUNDARY 0x00000008
125 158#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
126/*! [Begin] no source code translation (keep the typedefs) */
127 159
128/* 160/*
129 * 16-bit type definitions 161 * In the case of the Itanium Processor Family (IPF), the hardware does not
162 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
163 * to indicate that special precautions must be taken to avoid alignment faults.
164 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
165 *
166 * Note: Em64_t and other X86-64 processors support misaligned transfers,
167 * so there is no need to define this flag.
130 */ 168 */
131typedef unsigned char UINT8; 169#if defined (__IA64__) || defined (__ia64__)
132typedef unsigned char BOOLEAN; 170#define ACPI_MISALIGNMENT_NOT_SUPPORTED
133typedef unsigned int UINT16; 171#endif
134typedef long INT32;
135typedef int INT16;
136typedef unsigned long UINT32;
137 172
138struct { 173/*******************************************************************************
139 UINT32 Lo; 174 *
140 UINT32 Hi; 175 * Types specific to 32-bit targets
141}; 176 *
177 ******************************************************************************/
178
179#elif ACPI_MACHINE_WIDTH == 32
180
181/*! [Begin] no source code translation (keep the typedefs as-is) */
182
183typedef unsigned int UINT32;
184typedef int INT32;
185
186/*! [End] no source code translation !*/
187
188typedef u32 acpi_native_uint;
189typedef s32 acpi_native_int;
190
191typedef u64 acpi_table_ptr;
192typedef u32 acpi_io_address;
193typedef u64 acpi_physical_address;
194
195#define ACPI_MAX_PTR ACPI_UINT32_MAX
196#define ACPI_SIZE_MAX ACPI_UINT32_MAX
197
198#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
199
200/*******************************************************************************
201 *
202 * Types specific to 16-bit targets
203 *
204 ******************************************************************************/
205
206#elif ACPI_MACHINE_WIDTH == 16
207
208/*! [Begin] no source code translation (keep the typedefs as-is) */
209
210typedef unsigned long UINT32;
211typedef short INT16;
212typedef long INT32;
142 213
143/*! [End] no source code translation !*/ 214/*! [End] no source code translation !*/
144 215
@@ -148,61 +219,84 @@ typedef s16 acpi_native_int;
148typedef u32 acpi_table_ptr; 219typedef u32 acpi_table_ptr;
149typedef u32 acpi_io_address; 220typedef u32 acpi_io_address;
150typedef char *acpi_physical_address; 221typedef char *acpi_physical_address;
151typedef u16 acpi_size;
152 222
153#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
154#define ACPI_MISALIGNED_TRANSFERS
155#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
156#define ACPI_MAX_PTR ACPI_UINT16_MAX 223#define ACPI_MAX_PTR ACPI_UINT16_MAX
157#define ACPI_SIZE_MAX ACPI_UINT16_MAX 224#define ACPI_SIZE_MAX ACPI_UINT16_MAX
158 225
159/* 226#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
160 * (16-bit only) internal integers must be 32-bits, so 227#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
161 * 64-bit integers cannot be supported 228
162 */ 229/* 64-bit integers cannot be supported */
230
163#define ACPI_NO_INTEGER64_SUPPORT 231#define ACPI_NO_INTEGER64_SUPPORT
164 232
165#elif ACPI_MACHINE_WIDTH == 32 233#else
166 234
167/*! [Begin] no source code translation (keep the typedefs) */ 235/* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */
168 236
169/* 237#error unknown ACPI_MACHINE_WIDTH
170 * 32-bit type definitions (default) 238#endif
171 */
172typedef unsigned char UINT8;
173typedef unsigned char BOOLEAN;
174typedef unsigned short UINT16;
175typedef int INT32;
176typedef unsigned int UINT32;
177typedef COMPILER_DEPENDENT_INT64 INT64;
178typedef COMPILER_DEPENDENT_UINT64 UINT64;
179 239
180/*! [End] no source code translation !*/ 240/* Variable-width type, used instead of clib size_t */
181 241
182typedef s32 acpi_native_int; 242typedef acpi_native_uint acpi_size;
183typedef u32 acpi_native_uint;
184 243
185typedef u64 acpi_table_ptr; 244/*******************************************************************************
186typedef u32 acpi_io_address; 245 *
187typedef u64 acpi_physical_address; 246 * OS- or compiler-dependent types
188typedef u32 acpi_size; 247 *
248 * If the defaults below are not appropriate for the host system, they can
249 * be defined in the compiler-specific or OS-specific header, and this will
250 * take precedence.
251 *
252 ******************************************************************************/
189 253
190#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 254/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
191#define ACPI_MISALIGNED_TRANSFERS
192#define ACPI_MAX_PTR ACPI_UINT32_MAX
193#define ACPI_SIZE_MAX ACPI_UINT32_MAX
194 255
195#else 256#ifndef acpi_uintptr_t
196#error unknown ACPI_MACHINE_WIDTH 257#define acpi_uintptr_t void *
197#endif 258#endif
198 259
199/* 260/*
200 * This type is used for bitfields in ACPI tables. The only type that is 261 * If acpi_cache_t was not defined in the OS-dependent header,
201 * even remotely portable is u8. Anything else is not portable, so 262 * define it now. This is typically the case where the local cache
202 * do not add any more bitfield types. 263 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
264 */
265#ifndef acpi_cache_t
266#define acpi_cache_t struct acpi_memory_list
267#endif
268
269/*
270 * Allow the CPU flags word to be defined per-OS to simplify the use of the
271 * lock and unlock OSL interfaces.
272 */
273#ifndef acpi_cpu_flags
274#define acpi_cpu_flags acpi_native_uint
275#endif
276
277/*
278 * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
279 * some compilers can catch printf format string problems
203 */ 280 */
204typedef u8 UINT8_BIT; 281#ifndef ACPI_PRINTF_LIKE
205typedef acpi_native_uint ACPI_PTRDIFF; 282#define ACPI_PRINTF_LIKE(c)
283#endif
284
285/*
286 * Some compilers complain about unused variables. Sometimes we don't want to
287 * use all the variables (for example, _acpi_module_name). This allows us
288 * to to tell the compiler in a per-variable manner that a variable
289 * is unused
290 */
291#ifndef ACPI_UNUSED_VAR
292#define ACPI_UNUSED_VAR
293#endif
294
295/*******************************************************************************
296 *
297 * Independent types
298 *
299 ******************************************************************************/
206 300
207/* 301/*
208 * Pointer overlays to avoid lots of typecasting for 302 * Pointer overlays to avoid lots of typecasting for
@@ -234,18 +328,8 @@ struct acpi_pointer {
234#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER 328#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
235#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER 329#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
236 330
237/* 331/* Logical defines and NULL */
238 * If acpi_cache_t was not defined in the OS-dependent header,
239 * define it now. This is typically the case where the local cache
240 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
241 */
242#ifndef acpi_cache_t
243#define acpi_cache_t struct acpi_memory_list
244#endif
245 332
246/*
247 * Useful defines
248 */
249#ifdef FALSE 333#ifdef FALSE
250#undef FALSE 334#undef FALSE
251#endif 335#endif
@@ -261,12 +345,12 @@ struct acpi_pointer {
261#endif 345#endif
262 346
263/* 347/*
264 * Local datatypes 348 * Mescellaneous types
265 */ 349 */
266typedef u32 acpi_status; /* All ACPI Exceptions */ 350typedef u32 acpi_status; /* All ACPI Exceptions */
267typedef u32 acpi_name; /* 4-byte ACPI name */ 351typedef u32 acpi_name; /* 4-byte ACPI name */
268typedef char *acpi_string; /* Null terminated ASCII string */ 352typedef char *acpi_string; /* Null terminated ASCII string */
269typedef void *acpi_handle; /* Actually a ptr to an Node */ 353typedef void *acpi_handle; /* Actually a ptr to a NS Node */
270 354
271struct uint64_struct { 355struct uint64_struct {
272 u32 lo; 356 u32 lo;
@@ -323,7 +407,7 @@ typedef u64 acpi_integer;
323/* 407/*
324 * Constants with special meanings 408 * Constants with special meanings
325 */ 409 */
326#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) 410#define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR)
327 411
328/* 412/*
329 * Initialization sequence 413 * Initialization sequence
@@ -470,37 +554,6 @@ typedef u32 acpi_object_type;
470#define ACPI_TYPE_NOT_FOUND 0xFF 554#define ACPI_TYPE_NOT_FOUND 0xFF
471 555
472/* 556/*
473 * Bitmapped ACPI types. Used internally only
474 */
475#define ACPI_BTYPE_ANY 0x00000000
476#define ACPI_BTYPE_INTEGER 0x00000001
477#define ACPI_BTYPE_STRING 0x00000002
478#define ACPI_BTYPE_BUFFER 0x00000004
479#define ACPI_BTYPE_PACKAGE 0x00000008
480#define ACPI_BTYPE_FIELD_UNIT 0x00000010
481#define ACPI_BTYPE_DEVICE 0x00000020
482#define ACPI_BTYPE_EVENT 0x00000040
483#define ACPI_BTYPE_METHOD 0x00000080
484#define ACPI_BTYPE_MUTEX 0x00000100
485#define ACPI_BTYPE_REGION 0x00000200
486#define ACPI_BTYPE_POWER 0x00000400
487#define ACPI_BTYPE_PROCESSOR 0x00000800
488#define ACPI_BTYPE_THERMAL 0x00001000
489#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
490#define ACPI_BTYPE_DDB_HANDLE 0x00004000
491#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
492#define ACPI_BTYPE_REFERENCE 0x00010000
493#define ACPI_BTYPE_RESOURCE 0x00020000
494
495#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
496
497#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
498#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
499#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
500#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
501#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
502
503/*
504 * All I/O 557 * All I/O
505 */ 558 */
506#define ACPI_READ 0 559#define ACPI_READ 0
@@ -853,6 +906,14 @@ struct acpi_compatible_id_list {
853#define ACPI_VALID_CID 0x0010 906#define ACPI_VALID_CID 0x0010
854#define ACPI_VALID_SXDS 0x0020 907#define ACPI_VALID_SXDS 0x0020
855 908
909/* Flags for _STA method */
910
911#define ACPI_STA_DEVICE_PRESENT 0x01
912#define ACPI_STA_DEVICE_ENABLED 0x02
913#define ACPI_STA_DEVICE_UI 0x04
914#define ACPI_STA_DEVICE_OK 0x08
915#define ACPI_STA_BATTERY_PRESENT 0x10
916
856#define ACPI_COMMON_OBJ_INFO \ 917#define ACPI_COMMON_OBJ_INFO \
857 acpi_object_type type; /* ACPI object type */ \ 918 acpi_object_type type; /* ACPI object type */ \
858 acpi_name name /* ACPI object Name */ 919 acpi_name name /* ACPI object Name */
@@ -895,6 +956,8 @@ struct acpi_mem_space_context {
895/* 956/*
896 * Definitions for Resource Attributes 957 * Definitions for Resource Attributes
897 */ 958 */
959typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */
960typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */
898 961
899/* 962/*
900 * Memory Attributes 963 * Memory Attributes
@@ -916,7 +979,9 @@ struct acpi_mem_space_context {
916#define ACPI_ISA_ONLY_RANGES (u8) 0x02 979#define ACPI_ISA_ONLY_RANGES (u8) 0x02
917#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) 980#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
918 981
919#define ACPI_SPARSE_TRANSLATION (u8) 0x03 982/* Type of translation - 1=Sparse, 0=Dense */
983
984#define ACPI_SPARSE_TRANSLATION (u8) 0x01
920 985
921/* 986/*
922 * IO Port Descriptor Decode 987 * IO Port Descriptor Decode
@@ -927,8 +992,8 @@ struct acpi_mem_space_context {
927/* 992/*
928 * IRQ Attributes 993 * IRQ Attributes
929 */ 994 */
930#define ACPI_EDGE_SENSITIVE (u8) 0x00 995#define ACPI_LEVEL_SENSITIVE (u8) 0x00
931#define ACPI_LEVEL_SENSITIVE (u8) 0x01 996#define ACPI_EDGE_SENSITIVE (u8) 0x01
932 997
933#define ACPI_ACTIVE_HIGH (u8) 0x00 998#define ACPI_ACTIVE_HIGH (u8) 0x00
934#define ACPI_ACTIVE_LOW (u8) 0x01 999#define ACPI_ACTIVE_LOW (u8) 0x01
@@ -975,27 +1040,45 @@ struct acpi_mem_space_context {
975#define ACPI_CONSUMER (u8) 0x01 1040#define ACPI_CONSUMER (u8) 0x01
976 1041
977/* 1042/*
1043 * If possible, pack the following structures to byte alignment
1044 */
1045#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
1046#pragma pack(1)
1047#endif
1048
1049/* UUID data structures for use in vendor-defined resource descriptors */
1050
1051struct acpi_uuid {
1052 u8 data[ACPI_UUID_LENGTH];
1053};
1054
1055struct acpi_vendor_uuid {
1056 u8 subtype;
1057 u8 data[ACPI_UUID_LENGTH];
1058};
1059
1060/*
978 * Structures used to describe device resources 1061 * Structures used to describe device resources
979 */ 1062 */
980struct acpi_resource_irq { 1063struct acpi_resource_irq {
981 u32 edge_level; 1064 u8 triggering;
982 u32 active_high_low; 1065 u8 polarity;
983 u32 shared_exclusive; 1066 u8 sharable;
984 u32 number_of_interrupts; 1067 u8 interrupt_count;
985 u32 interrupts[1]; 1068 u8 interrupts[1];
986}; 1069};
987 1070
988struct acpi_resource_dma { 1071struct acpi_resource_dma {
989 u32 type; 1072 u8 type;
990 u32 bus_master; 1073 u8 bus_master;
991 u32 transfer; 1074 u8 transfer;
992 u32 number_of_channels; 1075 u8 channel_count;
993 u32 channels[1]; 1076 u8 channels[1];
994}; 1077};
995 1078
996struct acpi_resource_start_dpf { 1079struct acpi_resource_start_dependent {
997 u32 compatibility_priority; 1080 u8 compatibility_priority;
998 u32 performance_robustness; 1081 u8 performance_robustness;
999}; 1082};
1000 1083
1001/* 1084/*
@@ -1004,179 +1087,217 @@ struct acpi_resource_start_dpf {
1004 */ 1087 */
1005 1088
1006struct acpi_resource_io { 1089struct acpi_resource_io {
1007 u32 io_decode; 1090 u8 io_decode;
1008 u32 min_base_address; 1091 u8 alignment;
1009 u32 max_base_address; 1092 u8 address_length;
1010 u32 alignment; 1093 u16 minimum;
1011 u32 range_length; 1094 u16 maximum;
1012}; 1095};
1013 1096
1014struct acpi_resource_fixed_io { 1097struct acpi_resource_fixed_io {
1015 u32 base_address; 1098 u16 address;
1016 u32 range_length; 1099 u8 address_length;
1017}; 1100};
1018 1101
1019struct acpi_resource_vendor { 1102struct acpi_resource_vendor {
1020 u32 length; 1103 u16 byte_length;
1021 u8 reserved[1]; 1104 u8 byte_data[1];
1105};
1106
1107/* Vendor resource with UUID info (introduced in ACPI 3.0) */
1108
1109struct acpi_resource_vendor_typed {
1110 u16 byte_length;
1111 u8 uuid_subtype;
1112 u8 uuid[ACPI_UUID_LENGTH];
1113 u8 byte_data[1];
1022}; 1114};
1023 1115
1024struct acpi_resource_end_tag { 1116struct acpi_resource_end_tag {
1025 u8 checksum; 1117 u8 checksum;
1026}; 1118};
1027 1119
1028struct acpi_resource_mem24 { 1120struct acpi_resource_memory24 {
1029 u32 read_write_attribute; 1121 u8 write_protect;
1030 u32 min_base_address; 1122 u16 minimum;
1031 u32 max_base_address; 1123 u16 maximum;
1032 u32 alignment; 1124 u16 alignment;
1033 u32 range_length; 1125 u16 address_length;
1034}; 1126};
1035 1127
1036struct acpi_resource_mem32 { 1128struct acpi_resource_memory32 {
1037 u32 read_write_attribute; 1129 u8 write_protect;
1038 u32 min_base_address; 1130 u32 minimum;
1039 u32 max_base_address; 1131 u32 maximum;
1040 u32 alignment; 1132 u32 alignment;
1041 u32 range_length; 1133 u32 address_length;
1042}; 1134};
1043 1135
1044struct acpi_resource_fixed_mem32 { 1136struct acpi_resource_fixed_memory32 {
1045 u32 read_write_attribute; 1137 u8 write_protect;
1046 u32 range_base_address; 1138 u32 address;
1047 u32 range_length; 1139 u32 address_length;
1048}; 1140};
1049 1141
1050struct acpi_memory_attribute { 1142struct acpi_memory_attribute {
1051 u16 cache_attribute; 1143 u8 write_protect;
1052 u16 read_write_attribute; 1144 u8 caching;
1145 u8 range_type;
1146 u8 translation;
1053}; 1147};
1054 1148
1055struct acpi_io_attribute { 1149struct acpi_io_attribute {
1056 u16 range_attribute; 1150 u8 range_type;
1057 u16 translation_attribute; 1151 u8 translation;
1058}; 1152 u8 translation_type;
1059 1153 u8 reserved1;
1060struct acpi_bus_attribute {
1061 u16 reserved1;
1062 u16 reserved2;
1063}; 1154};
1064 1155
1065union acpi_resource_attribute { 1156union acpi_resource_attribute {
1066 struct acpi_memory_attribute memory; 1157 struct acpi_memory_attribute mem;
1067 struct acpi_io_attribute io; 1158 struct acpi_io_attribute io;
1068 struct acpi_bus_attribute bus; 1159
1160 /* Used for the *word_space macros */
1161
1162 u8 type_specific;
1069}; 1163};
1070 1164
1071struct acpi_resource_source { 1165struct acpi_resource_source {
1072 u32 index; 1166 u8 index;
1073 u32 string_length; 1167 u16 string_length;
1074 char *string_ptr; 1168 char *string_ptr;
1075}; 1169};
1076 1170
1077/* Fields common to all address descriptors, 16/32/64 bit */ 1171/* Fields common to all address descriptors, 16/32/64 bit */
1078 1172
1079#define ACPI_RESOURCE_ADDRESS_COMMON \ 1173#define ACPI_RESOURCE_ADDRESS_COMMON \
1080 u32 resource_type; \ 1174 u8 resource_type; \
1081 u32 producer_consumer; \ 1175 u8 producer_consumer; \
1082 u32 decode; \ 1176 u8 decode; \
1083 u32 min_address_fixed; \ 1177 u8 min_address_fixed; \
1084 u32 max_address_fixed; \ 1178 u8 max_address_fixed; \
1085 union acpi_resource_attribute attribute; 1179 union acpi_resource_attribute info;
1086 1180
1087struct acpi_resource_address { 1181struct acpi_resource_address {
1088ACPI_RESOURCE_ADDRESS_COMMON}; 1182ACPI_RESOURCE_ADDRESS_COMMON};
1089 1183
1090struct acpi_resource_address16 { 1184struct acpi_resource_address16 {
1091 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; 1185 ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
1092 u32 min_address_range; 1186 u16 minimum;
1093 u32 max_address_range; 1187 u16 maximum;
1094 u32 address_translation_offset; 1188 u16 translation_offset;
1095 u32 address_length; 1189 u16 address_length;
1096 struct acpi_resource_source resource_source; 1190 struct acpi_resource_source resource_source;
1097}; 1191};
1098 1192
1099struct acpi_resource_address32 { 1193struct acpi_resource_address32 {
1100 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; 1194 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
1101 u32 min_address_range; 1195 u32 minimum;
1102 u32 max_address_range; 1196 u32 maximum;
1103 u32 address_translation_offset; 1197 u32 translation_offset;
1104 u32 address_length; 1198 u32 address_length;
1105 struct acpi_resource_source resource_source; 1199 struct acpi_resource_source resource_source;
1106}; 1200};
1107 1201
1108struct acpi_resource_address64 { 1202struct acpi_resource_address64 {
1109 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; 1203 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
1110 u64 min_address_range; 1204 u64 minimum;
1111 u64 max_address_range; 1205 u64 maximum;
1112 u64 address_translation_offset; 1206 u64 translation_offset;
1113 u64 address_length; 1207 u64 address_length;
1114 u64 type_specific_attributes;
1115 struct acpi_resource_source resource_source; 1208 struct acpi_resource_source resource_source;
1116}; 1209};
1117 1210
1118struct acpi_resource_ext_irq { 1211struct acpi_resource_extended_address64 {
1119 u32 producer_consumer; 1212 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
1120 u32 edge_level; 1213 u64 granularity;
1121 u32 active_high_low; 1214 u64 minimum;
1122 u32 shared_exclusive; 1215 u64 maximum;
1123 u32 number_of_interrupts; 1216 u64 translation_offset;
1217 u64 address_length;
1218 u64 type_specific;
1219};
1220
1221struct acpi_resource_extended_irq {
1222 u8 producer_consumer;
1223 u8 triggering;
1224 u8 polarity;
1225 u8 sharable;
1226 u8 interrupt_count;
1124 struct acpi_resource_source resource_source; 1227 struct acpi_resource_source resource_source;
1125 u32 interrupts[1]; 1228 u32 interrupts[1];
1126}; 1229};
1127 1230
1231struct acpi_resource_generic_register {
1232 u8 space_id;
1233 u8 bit_width;
1234 u8 bit_offset;
1235 u8 access_size;
1236 u64 address;
1237};
1238
1128/* ACPI_RESOURCE_TYPEs */ 1239/* ACPI_RESOURCE_TYPEs */
1129 1240
1130#define ACPI_RSTYPE_IRQ 0 1241#define ACPI_RESOURCE_TYPE_IRQ 0
1131#define ACPI_RSTYPE_DMA 1 1242#define ACPI_RESOURCE_TYPE_DMA 1
1132#define ACPI_RSTYPE_START_DPF 2 1243#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
1133#define ACPI_RSTYPE_END_DPF 3 1244#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
1134#define ACPI_RSTYPE_IO 4 1245#define ACPI_RESOURCE_TYPE_IO 4
1135#define ACPI_RSTYPE_FIXED_IO 5 1246#define ACPI_RESOURCE_TYPE_FIXED_IO 5
1136#define ACPI_RSTYPE_VENDOR 6 1247#define ACPI_RESOURCE_TYPE_VENDOR 6
1137#define ACPI_RSTYPE_END_TAG 7 1248#define ACPI_RESOURCE_TYPE_END_TAG 7
1138#define ACPI_RSTYPE_MEM24 8 1249#define ACPI_RESOURCE_TYPE_MEMORY24 8
1139#define ACPI_RSTYPE_MEM32 9 1250#define ACPI_RESOURCE_TYPE_MEMORY32 9
1140#define ACPI_RSTYPE_FIXED_MEM32 10 1251#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
1141#define ACPI_RSTYPE_ADDRESS16 11 1252#define ACPI_RESOURCE_TYPE_ADDRESS16 11
1142#define ACPI_RSTYPE_ADDRESS32 12 1253#define ACPI_RESOURCE_TYPE_ADDRESS32 12
1143#define ACPI_RSTYPE_ADDRESS64 13 1254#define ACPI_RESOURCE_TYPE_ADDRESS64 13
1144#define ACPI_RSTYPE_EXT_IRQ 14 1255#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
1145 1256#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
1146typedef u32 acpi_resource_type; 1257#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
1258#define ACPI_RESOURCE_TYPE_MAX 16
1147 1259
1148union acpi_resource_data { 1260union acpi_resource_data {
1149 struct acpi_resource_irq irq; 1261 struct acpi_resource_irq irq;
1150 struct acpi_resource_dma dma; 1262 struct acpi_resource_dma dma;
1151 struct acpi_resource_start_dpf start_dpf; 1263 struct acpi_resource_start_dependent start_dpf;
1152 struct acpi_resource_io io; 1264 struct acpi_resource_io io;
1153 struct acpi_resource_fixed_io fixed_io; 1265 struct acpi_resource_fixed_io fixed_io;
1154 struct acpi_resource_vendor vendor_specific; 1266 struct acpi_resource_vendor vendor;
1267 struct acpi_resource_vendor_typed vendor_typed;
1155 struct acpi_resource_end_tag end_tag; 1268 struct acpi_resource_end_tag end_tag;
1156 struct acpi_resource_mem24 memory24; 1269 struct acpi_resource_memory24 memory24;
1157 struct acpi_resource_mem32 memory32; 1270 struct acpi_resource_memory32 memory32;
1158 struct acpi_resource_fixed_mem32 fixed_memory32; 1271 struct acpi_resource_fixed_memory32 fixed_memory32;
1159 struct acpi_resource_address address; /* Common 16/32/64 address fields */
1160 struct acpi_resource_address16 address16; 1272 struct acpi_resource_address16 address16;
1161 struct acpi_resource_address32 address32; 1273 struct acpi_resource_address32 address32;
1162 struct acpi_resource_address64 address64; 1274 struct acpi_resource_address64 address64;
1163 struct acpi_resource_ext_irq extended_irq; 1275 struct acpi_resource_extended_address64 ext_address64;
1276 struct acpi_resource_extended_irq extended_irq;
1277 struct acpi_resource_generic_register generic_reg;
1278
1279 /* Common fields */
1280
1281 struct acpi_resource_address address; /* Common 16/32/64 address fields */
1164}; 1282};
1165 1283
1166struct acpi_resource { 1284struct acpi_resource {
1167 acpi_resource_type id; 1285 u32 type;
1168 u32 length; 1286 u32 length;
1169 union acpi_resource_data data; 1287 union acpi_resource_data data;
1170}; 1288};
1171 1289
1172#define ACPI_RESOURCE_LENGTH 12 1290/* restore default alignment */
1173#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ 1291
1292#pragma pack()
1174 1293
1175#define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) 1294#define ACPI_RS_SIZE_MIN 12
1295#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
1296#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
1176 1297
1177#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) 1298#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
1178 1299
1179#ifdef ACPI_MISALIGNED_TRANSFERS 1300#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
1180#define ACPI_ALIGN_RESOURCE_SIZE(length) (length) 1301#define ACPI_ALIGN_RESOURCE_SIZE(length) (length)
1181#else 1302#else
1182#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) 1303#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length)
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index c1086452696e..0927765df6aa 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -44,6 +44,39 @@
44#ifndef _ACUTILS_H 44#ifndef _ACUTILS_H
45#define _ACUTILS_H 45#define _ACUTILS_H
46 46
47extern const u8 acpi_gbl_resource_aml_sizes[];
48
49/* Strings used by the disassembler and debugger resource dump routines */
50
51#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
52
53extern const char *acpi_gbl_BMdecode[2];
54extern const char *acpi_gbl_config_decode[4];
55extern const char *acpi_gbl_consume_decode[2];
56extern const char *acpi_gbl_DECdecode[2];
57extern const char *acpi_gbl_HEdecode[2];
58extern const char *acpi_gbl_io_decode[2];
59extern const char *acpi_gbl_LLdecode[2];
60extern const char *acpi_gbl_max_decode[2];
61extern const char *acpi_gbl_MEMdecode[4];
62extern const char *acpi_gbl_min_decode[2];
63extern const char *acpi_gbl_MTPdecode[4];
64extern const char *acpi_gbl_RNGdecode[4];
65extern const char *acpi_gbl_RWdecode[2];
66extern const char *acpi_gbl_SHRdecode[2];
67extern const char *acpi_gbl_SIZdecode[4];
68extern const char *acpi_gbl_TRSdecode[2];
69extern const char *acpi_gbl_TTPdecode[2];
70extern const char *acpi_gbl_TYPdecode[4];
71#endif
72
73/* Types for Resource descriptor entries */
74
75#define ACPI_INVALID_RESOURCE 0
76#define ACPI_FIXED_LENGTH 1
77#define ACPI_VARIABLE_LENGTH 2
78#define ACPI_SMALL_VARIABLE_LENGTH 3
79
47typedef 80typedef
48acpi_status(*acpi_pkg_callback) (u8 object_type, 81acpi_status(*acpi_pkg_callback) (u8 object_type,
49 union acpi_operand_object * source_object, 82 union acpi_operand_object * source_object,
@@ -159,7 +192,6 @@ extern const u8 _acpi_ctype[];
159#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 192#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
160#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 193#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
161#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 194#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
162#define ACPI_IS_ASCII(c) ((c) < 0x80)
163 195
164#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 196#endif /* ACPI_USE_SYSTEM_CLIBRARY */
165 197
@@ -243,21 +275,22 @@ acpi_ut_ptr_exit(u32 line_number,
243 const char *function_name, 275 const char *function_name,
244 char *module_name, u32 component_id, u8 * ptr); 276 char *module_name, u32 component_id, u8 * ptr);
245 277
246void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id); 278void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id);
247 279
248void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id); 280void acpi_ut_report_error(char *module_name, u32 line_number);
249 281
250void 282void acpi_ut_report_info(char *module_name, u32 line_number);
251acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id);
252 283
253void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); 284void acpi_ut_report_warning(char *module_name, u32 line_number);
285
286/* Error and message reporting interfaces */
254 287
255void ACPI_INTERNAL_VAR_XFACE 288void ACPI_INTERNAL_VAR_XFACE
256acpi_ut_debug_print(u32 requested_debug_level, 289acpi_ut_debug_print(u32 requested_debug_level,
257 u32 line_number, 290 u32 line_number,
258 const char *function_name, 291 const char *function_name,
259 char *module_name, 292 char *module_name,
260 u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; 293 u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6);
261 294
262void ACPI_INTERNAL_VAR_XFACE 295void ACPI_INTERNAL_VAR_XFACE
263acpi_ut_debug_print_raw(u32 requested_debug_level, 296acpi_ut_debug_print_raw(u32 requested_debug_level,
@@ -265,7 +298,24 @@ acpi_ut_debug_print_raw(u32 requested_debug_level,
265 const char *function_name, 298 const char *function_name,
266 char *module_name, 299 char *module_name,
267 u32 component_id, 300 u32 component_id,
268 char *format, ...) ACPI_PRINTF_LIKE_FUNC; 301 char *format, ...) ACPI_PRINTF_LIKE(6);
302
303void ACPI_INTERNAL_VAR_XFACE
304acpi_ut_error(char *module_name,
305 u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
306
307void ACPI_INTERNAL_VAR_XFACE
308acpi_ut_exception(char *module_name,
309 u32 line_number,
310 acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4);
311
312void ACPI_INTERNAL_VAR_XFACE
313acpi_ut_warning(char *module_name,
314 u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
315
316void ACPI_INTERNAL_VAR_XFACE
317acpi_ut_info(char *module_name,
318 u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
269 319
270/* 320/*
271 * utdelete - Object deletion and reference counts 321 * utdelete - Object deletion and reference counts
@@ -419,7 +469,19 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
419 469
420#define ACPI_ANY_BASE 0 470#define ACPI_ANY_BASE 0
421 471
422u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); 472acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index);
473
474u32 acpi_ut_get_descriptor_length(void *aml);
475
476u16 acpi_ut_get_resource_length(void *aml);
477
478u8 acpi_ut_get_resource_header_length(void *aml);
479
480u8 acpi_ut_get_resource_type(void *aml);
481
482acpi_status
483acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc,
484 u8 ** end_tag);
423 485
424u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); 486u8 acpi_ut_generate_checksum(u8 * buffer, u32 length);
425 487
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index 7fdf5299f501..37964a59aef8 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2005, R. Byron Moore 10 * Copyright (C) 2000 - 2006, R. Byron Moore
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index 051786e4b210..fb4735315ad3 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -92,182 +92,168 @@ struct asl_resource_node {
92 struct asl_resource_node *next; 92 struct asl_resource_node *next;
93}; 93};
94 94
95/* Macros used to generate AML resource length fields */
96
97#define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (struct aml_resource_large_header))
98#define ACPI_AML_SIZE_SMALL(r) (sizeof (r) - sizeof (struct aml_resource_small_header))
99
95/* 100/*
96 * Resource descriptors defined in the ACPI specification. 101 * Resource descriptors defined in the ACPI specification.
97 * 102 *
98 * Packing/alignment must be BYTE because these descriptors 103 * Packing/alignment must be BYTE because these descriptors
99 * are used to overlay the AML byte stream. 104 * are used to overlay the raw AML byte stream.
100 */ 105 */
101#pragma pack(1) 106#pragma pack(1)
102 107
103struct asl_irq_format_desc { 108/*
104 u8 descriptor_type; 109 * SMALL descriptors
105 u16 irq_mask; 110 */
111#define AML_RESOURCE_SMALL_HEADER_COMMON \
112 u8 descriptor_type;
113
114struct aml_resource_small_header {
115AML_RESOURCE_SMALL_HEADER_COMMON};
116
117struct aml_resource_irq {
118 AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask;
106 u8 flags; 119 u8 flags;
107}; 120};
108 121
109struct asl_irq_noflags_desc { 122struct aml_resource_irq_noflags {
110 u8 descriptor_type; 123 AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask;
111 u16 irq_mask;
112}; 124};
113 125
114struct asl_dma_format_desc { 126struct aml_resource_dma {
115 u8 descriptor_type; 127 AML_RESOURCE_SMALL_HEADER_COMMON u8 dma_channel_mask;
116 u8 dma_channel_mask;
117 u8 flags; 128 u8 flags;
118}; 129};
119 130
120struct asl_start_dependent_desc { 131struct aml_resource_start_dependent {
121 u8 descriptor_type; 132 AML_RESOURCE_SMALL_HEADER_COMMON u8 flags;
122 u8 flags;
123}; 133};
124 134
125struct asl_start_dependent_noprio_desc { 135struct aml_resource_start_dependent_noprio {
126 u8 descriptor_type; 136AML_RESOURCE_SMALL_HEADER_COMMON};
127};
128 137
129struct asl_end_dependent_desc { 138struct aml_resource_end_dependent {
130 u8 descriptor_type; 139AML_RESOURCE_SMALL_HEADER_COMMON};
131};
132 140
133struct asl_io_port_desc { 141struct aml_resource_io {
134 u8 descriptor_type; 142 AML_RESOURCE_SMALL_HEADER_COMMON u8 flags;
135 u8 information; 143 u16 minimum;
136 u16 address_min; 144 u16 maximum;
137 u16 address_max;
138 u8 alignment; 145 u8 alignment;
139 u8 length; 146 u8 address_length;
140}; 147};
141 148
142struct asl_fixed_io_port_desc { 149struct aml_resource_fixed_io {
143 u8 descriptor_type; 150 AML_RESOURCE_SMALL_HEADER_COMMON u16 address;
144 u16 base_address; 151 u8 address_length;
145 u8 length;
146}; 152};
147 153
148struct asl_small_vendor_desc { 154struct aml_resource_vendor_small {
149 u8 descriptor_type; 155AML_RESOURCE_SMALL_HEADER_COMMON};
150 u8 vendor_defined[7];
151};
152 156
153struct asl_end_tag_desc { 157struct aml_resource_end_tag {
154 u8 descriptor_type; 158 AML_RESOURCE_SMALL_HEADER_COMMON u8 checksum;
155 u8 checksum;
156}; 159};
157 160
158/* LARGE descriptors */ 161/*
162 * LARGE descriptors
163 */
164#define AML_RESOURCE_LARGE_HEADER_COMMON \
165 u8 descriptor_type;\
166 u16 resource_length;
167
168struct aml_resource_large_header {
169AML_RESOURCE_LARGE_HEADER_COMMON};
159 170
160struct asl_memory_24_desc { 171struct aml_resource_memory24 {
161 u8 descriptor_type; 172 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
162 u16 length; 173 u16 minimum;
163 u8 information; 174 u16 maximum;
164 u16 address_min;
165 u16 address_max;
166 u16 alignment; 175 u16 alignment;
167 u16 range_length; 176 u16 address_length;
168}; 177};
169 178
170struct asl_large_vendor_desc { 179struct aml_resource_vendor_large {
171 u8 descriptor_type; 180AML_RESOURCE_LARGE_HEADER_COMMON};
172 u16 length;
173 u8 vendor_defined[1];
174};
175 181
176struct asl_memory_32_desc { 182struct aml_resource_memory32 {
177 u8 descriptor_type; 183 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
178 u16 length; 184 u32 minimum;
179 u8 information; 185 u32 maximum;
180 u32 address_min;
181 u32 address_max;
182 u32 alignment; 186 u32 alignment;
183 u32 range_length; 187 u32 address_length;
184}; 188};
185 189
186struct asl_fixed_memory_32_desc { 190struct aml_resource_fixed_memory32 {
187 u8 descriptor_type; 191 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
188 u16 length; 192 u32 address;
189 u8 information; 193 u32 address_length;
190 u32 base_address;
191 u32 range_length;
192}; 194};
193 195
194struct asl_extended_address_desc { 196#define AML_RESOURCE_ADDRESS_COMMON \
195 u8 descriptor_type; 197 u8 resource_type; \
196 u16 length; 198 u8 flags; \
197 u8 resource_type; 199 u8 specific_flags;
198 u8 flags; 200
199 u8 specific_flags; 201struct aml_resource_address {
200 u8 revision_iD; 202AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON};
203
204struct aml_resource_extended_address64 {
205 AML_RESOURCE_LARGE_HEADER_COMMON
206 AML_RESOURCE_ADDRESS_COMMON u8 revision_iD;
201 u8 reserved; 207 u8 reserved;
202 u64 granularity; 208 u64 granularity;
203 u64 address_min; 209 u64 minimum;
204 u64 address_max; 210 u64 maximum;
205 u64 translation_offset; 211 u64 translation_offset;
206 u64 address_length; 212 u64 address_length;
207 u64 type_specific_attributes; 213 u64 type_specific;
208 u8 optional_fields[2]; /* Used for length calculation only */
209}; 214};
210 215
211#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ 216#define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */
212 217
213struct asl_qword_address_desc { 218struct aml_resource_address64 {
214 u8 descriptor_type; 219 AML_RESOURCE_LARGE_HEADER_COMMON
215 u16 length; 220 AML_RESOURCE_ADDRESS_COMMON u64 granularity;
216 u8 resource_type; 221 u64 minimum;
217 u8 flags; 222 u64 maximum;
218 u8 specific_flags;
219 u64 granularity;
220 u64 address_min;
221 u64 address_max;
222 u64 translation_offset; 223 u64 translation_offset;
223 u64 address_length; 224 u64 address_length;
224 u8 optional_fields[2];
225}; 225};
226 226
227struct asl_dword_address_desc { 227struct aml_resource_address32 {
228 u8 descriptor_type; 228 AML_RESOURCE_LARGE_HEADER_COMMON
229 u16 length; 229 AML_RESOURCE_ADDRESS_COMMON u32 granularity;
230 u8 resource_type; 230 u32 minimum;
231 u8 flags; 231 u32 maximum;
232 u8 specific_flags;
233 u32 granularity;
234 u32 address_min;
235 u32 address_max;
236 u32 translation_offset; 232 u32 translation_offset;
237 u32 address_length; 233 u32 address_length;
238 u8 optional_fields[2];
239}; 234};
240 235
241struct asl_word_address_desc { 236struct aml_resource_address16 {
242 u8 descriptor_type; 237 AML_RESOURCE_LARGE_HEADER_COMMON
243 u16 length; 238 AML_RESOURCE_ADDRESS_COMMON u16 granularity;
244 u8 resource_type; 239 u16 minimum;
245 u8 flags; 240 u16 maximum;
246 u8 specific_flags;
247 u16 granularity;
248 u16 address_min;
249 u16 address_max;
250 u16 translation_offset; 241 u16 translation_offset;
251 u16 address_length; 242 u16 address_length;
252 u8 optional_fields[2];
253}; 243};
254 244
255struct asl_extended_xrupt_desc { 245struct aml_resource_extended_irq {
256 u8 descriptor_type; 246 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
257 u16 length; 247 u8 interrupt_count;
258 u8 flags; 248 u32 interrupts[1];
259 u8 table_length;
260 u32 interrupt_number[1];
261 /* res_source_index, res_source optional fields follow */ 249 /* res_source_index, res_source optional fields follow */
262}; 250};
263 251
264struct asl_general_register_desc { 252struct aml_resource_generic_register {
265 u8 descriptor_type; 253 AML_RESOURCE_LARGE_HEADER_COMMON u8 address_space_id;
266 u16 length;
267 u8 address_space_id;
268 u8 bit_width; 254 u8 bit_width;
269 u8 bit_offset; 255 u8 bit_offset;
270 u8 access_size; /* ACPI 3.0, was Reserved */ 256 u8 access_size; /* ACPI 3.0, was previously Reserved */
271 u64 address; 257 u64 address;
272}; 258};
273 259
@@ -277,26 +263,39 @@ struct asl_general_register_desc {
277 263
278/* Union of all resource descriptors, so we can allocate the worst case */ 264/* Union of all resource descriptors, so we can allocate the worst case */
279 265
280union asl_resource_desc { 266union aml_resource {
281 struct asl_irq_format_desc irq; 267 /* Descriptor headers */
282 struct asl_dma_format_desc dma; 268
283 struct asl_start_dependent_desc std; 269 struct aml_resource_small_header small_header;
284 struct asl_end_dependent_desc end; 270 struct aml_resource_large_header large_header;
285 struct asl_io_port_desc iop; 271
286 struct asl_fixed_io_port_desc fio; 272 /* Small resource descriptors */
287 struct asl_small_vendor_desc smv; 273
288 struct asl_end_tag_desc et; 274 struct aml_resource_irq irq;
289 275 struct aml_resource_dma dma;
290 struct asl_memory_24_desc M24; 276 struct aml_resource_start_dependent start_dpf;
291 struct asl_large_vendor_desc lgv; 277 struct aml_resource_end_dependent end_dpf;
292 struct asl_memory_32_desc M32; 278 struct aml_resource_io io;
293 struct asl_fixed_memory_32_desc F32; 279 struct aml_resource_fixed_io fixed_io;
294 struct asl_qword_address_desc qas; 280 struct aml_resource_vendor_small vendor_small;
295 struct asl_dword_address_desc das; 281 struct aml_resource_end_tag end_tag;
296 struct asl_word_address_desc was; 282
297 struct asl_extended_address_desc eas; 283 /* Large resource descriptors */
298 struct asl_extended_xrupt_desc exx; 284
299 struct asl_general_register_desc grg; 285 struct aml_resource_memory24 memory24;
286 struct aml_resource_generic_register generic_reg;
287 struct aml_resource_vendor_large vendor_large;
288 struct aml_resource_memory32 memory32;
289 struct aml_resource_fixed_memory32 fixed_memory32;
290 struct aml_resource_address16 address16;
291 struct aml_resource_address32 address32;
292 struct aml_resource_address64 address64;
293 struct aml_resource_extended_address64 ext_address64;
294 struct aml_resource_extended_irq extended_irq;
295
296 /* Utility overlays */
297
298 struct aml_resource_address address;
300 u32 u32_item; 299 u32 u32_item;
301 u16 u16_item; 300 u16 u16_item;
302 u8 U8item; 301 u8 U8item;
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h
index 91f4a12a99a1..3fa81d55cd0c 100644
--- a/include/acpi/pdc_intel.h
+++ b/include/acpi/pdc_intel.h
@@ -15,9 +15,7 @@
15#define ACPI_PDC_C_C1_FFH (0x0100) 15#define ACPI_PDC_C_C1_FFH (0x0100)
16 16
17#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ 17#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \
18 ACPI_PDC_C_C1_HALT) 18 ACPI_PDC_C_C1_HALT | \
19
20#define ACPI_PDC_EST_CAPABILITY_SMP_MSR (ACPI_PDC_EST_CAPABILITY_SMP | \
21 ACPI_PDC_P_FFH) 19 ACPI_PDC_P_FFH)
22 20
23#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ 21#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 16609c1ab2eb..223ec6467108 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -68,6 +68,7 @@
68#define ACPI_APPLICATION 68#define ACPI_APPLICATION
69#define ACPI_DEBUGGER 69#define ACPI_DEBUGGER
70#define ACPI_DISASSEMBLER 70#define ACPI_DISASSEMBLER
71#define ACPI_MUTEX_DEBUG
71#endif 72#endif
72 73
73#ifdef ACPI_ASL_COMPILER 74#ifdef ACPI_ASL_COMPILER
@@ -148,6 +149,9 @@
148#elif defined(NETWARE) 149#elif defined(NETWARE)
149#include "acnetware.h" 150#include "acnetware.h"
150 151
152#elif defined(__sun)
153#include "acsolaris.h"
154
151#else 155#else
152 156
153/* All other environments */ 157/* All other environments */
@@ -157,13 +161,6 @@
157#define COMPILER_DEPENDENT_INT64 long long 161#define COMPILER_DEPENDENT_INT64 long long
158#define COMPILER_DEPENDENT_UINT64 unsigned long long 162#define COMPILER_DEPENDENT_UINT64 unsigned long long
159 163
160/*
161 * This macro is used to tag functions as "printf-like" because
162 * some compilers can catch printf format string problems. MSVC
163 * doesn't, so this is proprocessed away.
164 */
165#define ACPI_PRINTF_LIKE_FUNC
166
167#endif 164#endif
168 165
169/* 166/*
@@ -205,6 +202,8 @@
205 * 202 *
206 *****************************************************************************/ 203 *****************************************************************************/
207 204
205#define ACPI_IS_ASCII(c) ((c) < 0x80)
206
208#ifdef ACPI_USE_SYSTEM_CLIBRARY 207#ifdef ACPI_USE_SYSTEM_CLIBRARY
209/* 208/*
210 * Use the standard C library headers. 209 * Use the standard C library headers.
@@ -234,7 +233,7 @@
234#define ACPI_STRCAT(d,s) (void) strcat((d), (s)) 233#define ACPI_STRCAT(d,s) (void) strcat((d), (s))
235#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) 234#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n))
236#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) 235#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n))
237#define ACPI_MEMCMP(s1,s2,n) memcmp((s1), (s2), (acpi_size)(n)) 236#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
238#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) 237#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
239#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) 238#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
240 239
@@ -246,7 +245,6 @@
246#define ACPI_IS_UPPER(i) isupper((int) (i)) 245#define ACPI_IS_UPPER(i) isupper((int) (i))
247#define ACPI_IS_PRINT(i) isprint((int) (i)) 246#define ACPI_IS_PRINT(i) isprint((int) (i))
248#define ACPI_IS_ALPHA(i) isalpha((int) (i)) 247#define ACPI_IS_ALPHA(i) isalpha((int) (i))
249#define ACPI_IS_ASCII(i) isascii((int) (i))
250 248
251#else 249#else
252 250
@@ -273,8 +271,8 @@ typedef char *va_list;
273/* 271/*
274 * Storage alignment properties 272 * Storage alignment properties
275 */ 273 */
276#define _AUPBND (sizeof (acpi_native_int) - 1) 274#define _AUPBND (sizeof (acpi_native_uint) - 1)
277#define _ADNBND (sizeof (acpi_native_int) - 1) 275#define _ADNBND (sizeof (acpi_native_uint) - 1)
278 276
279/* 277/*
280 * Variable argument list macro definitions 278 * Variable argument list macro definitions
@@ -296,7 +294,7 @@ typedef char *va_list;
296#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) 294#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s))
297#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) 295#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n))
298#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) 296#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n))
299#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((s1), (s2), (acpi_size)(n)) 297#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
300#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) 298#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n))
301#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) 299#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n))
302#define ACPI_TOUPPER acpi_ut_to_upper 300#define ACPI_TOUPPER acpi_ut_to_upper
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 4c0e0ba09ba0..da80933963db 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -48,12 +48,14 @@
48 48
49#define ACPI_GET_FUNCTION_NAME __FUNCTION__ 49#define ACPI_GET_FUNCTION_NAME __FUNCTION__
50 50
51/* This macro is used to tag functions as "printf-like" because 51/*
52 * This macro is used to tag functions as "printf-like" because
52 * some compilers (like GCC) can catch printf format string problems. 53 * some compilers (like GCC) can catch printf format string problems.
53 */ 54 */
54#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7))) 55#define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))
55 56
56/* Some compilers complain about unused variables. Sometimes we don't want to 57/*
58 * Some compilers complain about unused variables. Sometimes we don't want to
57 * use all the variables (for example, _acpi_module_name). This allows us 59 * use all the variables (for example, _acpi_module_name). This allows us
58 * to to tell the compiler warning in a per-variable manner that a variable 60 * to to tell the compiler warning in a per-variable manner that a variable
59 * is unused. 61 * is unused.
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index c93e6562f0e1..2e6d54569ee8 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -71,6 +71,10 @@
71#define acpi_cache_t kmem_cache_t 71#define acpi_cache_t kmem_cache_t
72#endif 72#endif
73 73
74/* Full namespace pathname length limit - arbitrary */
75
76#define ACPI_PATHNAME_MAX 256
77
74#else /* !__KERNEL__ */ 78#else /* !__KERNEL__ */
75 79
76#include <stdarg.h> 80#include <stdarg.h>
@@ -98,4 +102,6 @@
98 102
99#include "acgcc.h" 103#include "acgcc.h"
100 104
105#define acpi_cpu_flags unsigned long
106
101#endif /* __ACLINUX_H__ */ 107#endif /* __ACLINUX_H__ */
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 7a00d5089de9..badf0277b1be 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -62,9 +62,6 @@ struct acpi_processor_power {
62 u32 bm_activity; 62 u32 bm_activity;
63 int count; 63 int count;
64 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; 64 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
65
66 /* the _PDC objects passed by the driver, if any */
67 struct acpi_object_list *pdc;
68}; 65};
69 66
70/* Performance Management */ 67/* Performance Management */
@@ -96,8 +93,6 @@ struct acpi_processor_performance {
96 unsigned int state_count; 93 unsigned int state_count;
97 struct acpi_processor_px *states; 94 struct acpi_processor_px *states;
98 95
99 /* the _PDC objects passed by the driver, if any */
100 struct acpi_object_list *pdc;
101}; 96};
102 97
103/* Throttling Control */ 98/* Throttling Control */
@@ -151,6 +146,9 @@ struct acpi_processor {
151 struct acpi_processor_performance *performance; 146 struct acpi_processor_performance *performance;
152 struct acpi_processor_throttling throttling; 147 struct acpi_processor_throttling throttling;
153 struct acpi_processor_limit limit; 148 struct acpi_processor_limit limit;
149
150 /* the _PDC objects for this processor, if any */
151 struct acpi_object_list *pdc;
154}; 152};
155 153
156struct acpi_processor_errata { 154struct acpi_processor_errata {
@@ -178,22 +176,12 @@ int acpi_processor_notify_smm(struct module *calling_module);
178extern struct acpi_processor *processors[NR_CPUS]; 176extern struct acpi_processor *processors[NR_CPUS];
179extern struct acpi_processor_errata errata; 177extern struct acpi_processor_errata errata;
180 178
181int acpi_processor_set_pdc(struct acpi_processor *pr, 179void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
182 struct acpi_object_list *pdc_in);
183 180
184#ifdef ARCH_HAS_POWER_PDC_INIT 181#ifdef ARCH_HAS_POWER_INIT
185void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
186 unsigned int cpu);
187void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, 182void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
188 unsigned int cpu); 183 unsigned int cpu);
189#else 184#else
190static inline void acpi_processor_power_init_pdc(struct acpi_processor_power
191 *pow, unsigned int cpu)
192{
193 pow->pdc = NULL;
194 return;
195}
196
197static inline void acpi_processor_power_init_bm_check(struct 185static inline void acpi_processor_power_init_bm_check(struct
198 acpi_processor_flags 186 acpi_processor_flags
199 *flags, unsigned int cpu) 187 *flags, unsigned int cpu)
@@ -235,9 +223,6 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
235/* in processor_throttling.c */ 223/* in processor_throttling.c */
236int acpi_processor_get_throttling_info(struct acpi_processor *pr); 224int acpi_processor_get_throttling_info(struct acpi_processor *pr);
237int acpi_processor_set_throttling(struct acpi_processor *pr, int state); 225int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
238ssize_t acpi_processor_write_throttling(struct file *file,
239 const char __user * buffer,
240 size_t count, loff_t * data);
241extern struct file_operations acpi_processor_throttling_fops; 226extern struct file_operations acpi_processor_throttling_fops;
242 227
243/* in processor_idle.c */ 228/* in processor_idle.c */
@@ -249,9 +234,6 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
249 234
250/* in processor_thermal.c */ 235/* in processor_thermal.c */
251int acpi_processor_get_limit_info(struct acpi_processor *pr); 236int acpi_processor_get_limit_info(struct acpi_processor *pr);
252ssize_t acpi_processor_write_limit(struct file *file,
253 const char __user * buffer,
254 size_t count, loff_t * data);
255extern struct file_operations acpi_processor_limit_fops; 237extern struct file_operations acpi_processor_limit_fops;
256 238
257#ifdef CONFIG_CPU_FREQ 239#ifdef CONFIG_CPU_FREQ
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h
index 9dc7256cf979..62d0d6681aa9 100644
--- a/include/asm-alpha/dma-mapping.h
+++ b/include/asm-alpha/dma-mapping.h
@@ -30,6 +30,7 @@
30 30
31#else /* no PCI - no IOMMU. */ 31#else /* no PCI - no IOMMU. */
32 32
33struct scatterlist;
33void *dma_alloc_coherent(struct device *dev, size_t size, 34void *dma_alloc_coherent(struct device *dev, size_t size,
34 dma_addr_t *dma_handle, gfp_t gfp); 35 dma_addr_t *dma_handle, gfp_t gfp);
35int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 36int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S
index abfbe45cd17c..5f8223e700d3 100644
--- a/include/asm-arm/arch-s3c2410/debug-macro.S
+++ b/include/asm-arm/arch-s3c2410/debug-macro.S
@@ -25,7 +25,7 @@
25 .macro addruart, rx 25 .macro addruart, rx
26 mrc p15, 0, \rx, c1, c0 26 mrc p15, 0, \rx, c1, c0
27 tst \rx, #1 27 tst \rx, #1
28 ldreq \rx, = S3C2410_PA_UART 28 ldreq \rx, = S3C24XX_PA_UART
29 ldrne \rx, = S3C24XX_VA_UART 29 ldrne \rx, = S3C24XX_VA_UART
30#if CONFIG_DEBUG_S3C2410_UART != 0 30#if CONFIG_DEBUG_S3C2410_UART != 0
31 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) 31 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART)
@@ -44,7 +44,7 @@
441003: 441003:
45 mrc p15, 0, \rd, c1, c0 45 mrc p15, 0, \rd, c1, c0
46 tst \rd, #1 46 tst \rd, #1
47 addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) 47 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
48 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) 48 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
49 bic \rd, \rd, #0xff000 49 bic \rd, \rd, #0xff000
50 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] 50 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
@@ -75,7 +75,7 @@
751003: 751003:
76 mrc p15, 0, \rd, c1, c0 76 mrc p15, 0, \rd, c1, c0
77 tst \rd, #1 77 tst \rd, #1
78 addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) 78 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
79 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) 79 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
80 bic \rd, \rd, #0xff000 80 bic \rd, \rd, #0xff000
81 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] 81 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h
index 1c9de29cafef..a2330bf83695 100644
--- a/include/asm-arm/arch-s3c2410/hardware.h
+++ b/include/asm-arm/arch-s3c2410/hardware.h
@@ -17,6 +17,7 @@
17 * 14-Sep-2004 BJD Added misccr and getpin to gpio 17 * 14-Sep-2004 BJD Added misccr and getpin to gpio
18 * 01-Oct-2004 BJD Added the new gpio functions 18 * 01-Oct-2004 BJD Added the new gpio functions
19 * 16-Oct-2004 BJD Removed the clock variables 19 * 16-Oct-2004 BJD Removed the clock variables
20 * 15-Jan-2006 LCVR Added s3c2400_gpio_getirq()
20*/ 21*/
21 22
22#ifndef __ASM_ARCH_HARDWARE_H 23#ifndef __ASM_ARCH_HARDWARE_H
@@ -55,6 +56,12 @@ extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
55 56
56extern int s3c2410_gpio_getirq(unsigned int pin); 57extern int s3c2410_gpio_getirq(unsigned int pin);
57 58
59#ifdef CONFIG_CPU_S3C2400
60
61extern int s3c2400_gpio_getirq(unsigned int pin);
62
63#endif /* CONFIG_CPU_S3C2400 */
64
58/* s3c2410_gpio_irqfilter 65/* s3c2410_gpio_irqfilter
59 * 66 *
60 * set the irq filtering on the given pin 67 * set the irq filtering on the given pin
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index 1833ea5c4220..c380d264a847 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -14,6 +14,7 @@
14 * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics out 14 * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics out
15 * 10-Feb-2005 BJD Added CAMIF definition from guillaume.gourat@nexvision.tv 15 * 10-Feb-2005 BJD Added CAMIF definition from guillaume.gourat@nexvision.tv
16 * 10-Mar-2005 LCVR Added support to S3C2400, changed {VA,SZ} names 16 * 10-Mar-2005 LCVR Added support to S3C2400, changed {VA,SZ} names
17 * 15-Jan-2006 LCVR Added S3C24XX_PA macros for common S3C24XX resources
17*/ 18*/
18 19
19#ifndef __ASM_ARCH_MAP_H 20#ifndef __ASM_ARCH_MAP_H
@@ -188,5 +189,42 @@
188 189
189#define S3C2400_SDRAM_PA (S3C2400_CS6) 190#define S3C2400_SDRAM_PA (S3C2400_CS6)
190 191
192/* Use a single interface for common resources between S3C24XX cpus */
193
194#ifdef CONFIG_CPU_S3C2400
195#define S3C24XX_PA_IRQ S3C2400_PA_IRQ
196#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL
197#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST
198#define S3C24XX_PA_DMA S3C2400_PA_DMA
199#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR
200#define S3C24XX_PA_LCD S3C2400_PA_LCD
201#define S3C24XX_PA_UART S3C2400_PA_UART
202#define S3C24XX_PA_TIMER S3C2400_PA_TIMER
203#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV
204#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG
205#define S3C24XX_PA_IIC S3C2400_PA_IIC
206#define S3C24XX_PA_IIS S3C2400_PA_IIS
207#define S3C24XX_PA_GPIO S3C2400_PA_GPIO
208#define S3C24XX_PA_RTC S3C2400_PA_RTC
209#define S3C24XX_PA_ADC S3C2400_PA_ADC
210#define S3C24XX_PA_SPI S3C2400_PA_SPI
211#else
212#define S3C24XX_PA_IRQ S3C2410_PA_IRQ
213#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL
214#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST
215#define S3C24XX_PA_DMA S3C2410_PA_DMA
216#define S3C24XX_PA_CLKPWR S3C2410_PA_CLKPWR
217#define S3C24XX_PA_LCD S3C2410_PA_LCD
218#define S3C24XX_PA_UART S3C2410_PA_UART
219#define S3C24XX_PA_TIMER S3C2410_PA_TIMER
220#define S3C24XX_PA_USBDEV S3C2410_PA_USBDEV
221#define S3C24XX_PA_WATCHDOG S3C2410_PA_WATCHDOG
222#define S3C24XX_PA_IIC S3C2410_PA_IIC
223#define S3C24XX_PA_IIS S3C2410_PA_IIS
224#define S3C24XX_PA_GPIO S3C2410_PA_GPIO
225#define S3C24XX_PA_RTC S3C2410_PA_RTC
226#define S3C24XX_PA_ADC S3C2410_PA_ADC
227#define S3C24XX_PA_SPI S3C2410_PA_SPI
228#endif
191 229
192#endif /* __ASM_ARCH_MAP_H */ 230#endif /* __ASM_ARCH_MAP_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index 7f1be48ad67e..9697f93afe74 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -22,6 +22,7 @@
22 * 28-Mar-2005 LCVR Fixed definition of GPB10 22 * 28-Mar-2005 LCVR Fixed definition of GPB10
23 * 26-Oct-2005 BJD Added generic configuration types 23 * 26-Oct-2005 BJD Added generic configuration types
24 * 27-Nov-2005 LCVR Added definitions to S3C2400 registers 24 * 27-Nov-2005 LCVR Added definitions to S3C2400 registers
25 * 15-Jan-2006 LCVR Written S3C24XX_GPIO_BASE() macro
25*/ 26*/
26 27
27 28
@@ -39,6 +40,27 @@
39#define S3C2410_GPIO_BANKG (32*6) 40#define S3C2410_GPIO_BANKG (32*6)
40#define S3C2410_GPIO_BANKH (32*7) 41#define S3C2410_GPIO_BANKH (32*7)
41 42
43#ifdef CONFIG_CPU_S3C2400
44#define S3C24XX_GPIO_BASE(x) S3C2400_GPIO_BASE(x)
45#define S3C24XX_MISCCR S3C2400_MISCCR
46#else
47#define S3C24XX_GPIO_BASE(x) S3C2410_GPIO_BASE(x)
48#define S3C24XX_MISCCR S3C2410_MISCCR
49#endif /* CONFIG_CPU_S3C2400 */
50
51
52/* S3C2400 doesn't have a 1:1 mapping to S3C2410 gpio base pins */
53
54#define S3C2400_BANKNUM(pin) (((pin) & ~31) / 32)
55#define S3C2400_BASEA2B(pin) ((((pin) & ~31) >> 2))
56#define S3C2400_BASEC2H(pin) ((S3C2400_BANKNUM(pin) * 10) + \
57 (2 * (S3C2400_BANKNUM(pin)-2)))
58
59#define S3C2400_GPIO_BASE(pin) (pin < S3C2410_GPIO_BANKC ? \
60 S3C2400_BASEA2B(pin)+S3C24XX_VA_GPIO : \
61 S3C2400_BASEC2H(pin)+S3C24XX_VA_GPIO)
62
63
42#define S3C2410_GPIO_BASE(pin) ((((pin) & ~31) >> 1) + S3C24XX_VA_GPIO) 64#define S3C2410_GPIO_BASE(pin) ((((pin) & ~31) >> 1) + S3C24XX_VA_GPIO)
43#define S3C2410_GPIO_OFFSET(pin) ((pin) & 31) 65#define S3C2410_GPIO_OFFSET(pin) ((pin) & 31)
44 66
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h
index ce1bbbaad6d3..83b01254c4ac 100644
--- a/include/asm-arm/arch-s3c2410/regs-serial.h
+++ b/include/asm-arm/arch-s3c2410/regs-serial.h
@@ -39,9 +39,9 @@
39#define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) 39#define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 )
40#define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) 40#define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 )
41 41
42#define S3C2410_PA_UART0 (S3C2410_PA_UART) 42#define S3C2410_PA_UART0 (S3C24XX_PA_UART)
43#define S3C2410_PA_UART1 (S3C2410_PA_UART + 0x4000 ) 43#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 )
44#define S3C2410_PA_UART2 (S3C2410_PA_UART + 0x8000 ) 44#define S3C2410_PA_UART2 (S3C24XX_PA_UART + 0x8000 )
45 45
46#define S3C2410_URXH (0x24) 46#define S3C2410_URXH (0x24)
47#define S3C2410_UTXH (0x20) 47#define S3C2410_UTXH (0x20)
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
index ddd1578a7ee0..4367ec054b51 100644
--- a/include/asm-arm/arch-s3c2410/uncompress.h
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -35,13 +35,13 @@
35#undef S3C2410_GPIOREG 35#undef S3C2410_GPIOREG
36#undef S3C2410_WDOGREG 36#undef S3C2410_WDOGREG
37 37
38#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x))) 38#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
39#define S3C2410_WDOGREG(x) ((S3C2410_PA_WATCHDOG + (x))) 39#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
40 40
41/* how many bytes we allow into the FIFO at a time in FIFO mode */ 41/* how many bytes we allow into the FIFO at a time in FIFO mode */
42#define FIFO_MAX (14) 42#define FIFO_MAX (14)
43 43
44#define uart_base S3C2410_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) 44#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT)
45 45
46static __inline__ void 46static __inline__ void
47uart_wr(unsigned int reg, unsigned int val) 47uart_wr(unsigned int reg, unsigned int val)
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h
index d4256d5f3a7c..747bdd31a74b 100644
--- a/include/asm-arm/checksum.h
+++ b/include/asm-arm/checksum.h
@@ -77,7 +77,7 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl)
77 mov %0, %0, lsr #16" 77 mov %0, %0, lsr #16"
78 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) 78 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
79 : "1" (iph), "2" (ihl) 79 : "1" (iph), "2" (ihl)
80 : "cc"); 80 : "cc", "memory");
81 return sum; 81 return sum;
82} 82}
83 83
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
index 3351b77fab36..e8ea67c97c73 100644
--- a/include/asm-arm/mach/map.h
+++ b/include/asm-arm/mach/map.h
@@ -26,6 +26,7 @@ struct meminfo;
26#define MT_MEMORY 5 26#define MT_MEMORY 5
27#define MT_ROM 6 27#define MT_ROM 6
28#define MT_IXP2000_DEVICE 7 28#define MT_IXP2000_DEVICE 7
29#define MT_NONSHARED_DEVICE 8
29 30
30extern void create_memmap_holes(struct meminfo *); 31extern void create_memmap_holes(struct meminfo *);
31extern void memtable_init(struct meminfo *); 32extern void memtable_init(struct meminfo *);
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 5a0d19b466b0..70e00d08345e 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -168,6 +168,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
168#define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 168#define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
169#define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) 169#define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
170#define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 170#define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
171#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2))
171 172
172/* 173/*
173 * - coarse table (not used) 174 * - coarse table (not used)
diff --git a/include/asm-arm26/bitops.h b/include/asm-arm26/bitops.h
index 15cc6f2da792..d87f8634e625 100644
--- a/include/asm-arm26/bitops.h
+++ b/include/asm-arm26/bitops.h
@@ -186,7 +186,7 @@ extern void _change_bit_le(int nr, volatile unsigned long * p);
186extern int _test_and_set_bit_le(int nr, volatile unsigned long * p); 186extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
187extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p); 187extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
188extern int _test_and_change_bit_le(int nr, volatile unsigned long * p); 188extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
189extern int _find_first_zero_bit_le(void * p, unsigned size); 189extern int _find_first_zero_bit_le(const unsigned long * p, unsigned size);
190extern int _find_next_zero_bit_le(void * p, int size, int offset); 190extern int _find_next_zero_bit_le(void * p, int size, int offset);
191extern int _find_first_bit_le(const unsigned long *p, unsigned size); 191extern int _find_first_bit_le(const unsigned long *p, unsigned size);
192extern int _find_next_bit_le(const unsigned long *p, int size, int offset); 192extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
@@ -326,7 +326,7 @@ static inline int sched_find_first_bit(unsigned long *b)
326#define minix_test_and_clear_bit(nr,p) \ 326#define minix_test_and_clear_bit(nr,p) \
327 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 327 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
328#define minix_find_first_zero_bit(p,sz) \ 328#define minix_find_first_zero_bit(p,sz) \
329 _find_first_zero_bit_le(p,sz) 329 _find_first_zero_bit_le((unsigned long *)(p),sz)
330 330
331#endif /* __KERNEL__ */ 331#endif /* __KERNEL__ */
332 332
diff --git a/include/asm-arm26/hardirq.h b/include/asm-arm26/hardirq.h
index dc28daab8aa8..87c19d2bb6a8 100644
--- a/include/asm-arm26/hardirq.h
+++ b/include/asm-arm26/hardirq.h
@@ -4,6 +4,7 @@
4#include <linux/config.h> 4#include <linux/config.h>
5#include <linux/cache.h> 5#include <linux/cache.h>
6#include <linux/threads.h> 6#include <linux/threads.h>
7#include <asm/irq.h>
7 8
8typedef struct { 9typedef struct {
9 unsigned int __softirq_pending; 10 unsigned int __softirq_pending;
@@ -26,13 +27,6 @@ typedef struct {
26 27
27extern asmlinkage void __do_softirq(void); 28extern asmlinkage void __do_softirq(void);
28 29
29#define irq_exit() \
30 do { \
31 preempt_count() -= IRQ_EXIT_OFFSET; \
32 if (!in_interrupt() && local_softirq_pending()) \
33 __do_softirq(); \
34 preempt_enable_no_resched(); \
35 } while (0)
36#endif 30#endif
37 31
38 32
diff --git a/include/asm-arm26/posix_types.h b/include/asm-arm26/posix_types.h
index b88344ad390c..f8d1eb4f4cb1 100644
--- a/include/asm-arm26/posix_types.h
+++ b/include/asm-arm26/posix_types.h
@@ -44,6 +44,7 @@ typedef unsigned int __kernel_gid32_t;
44 44
45typedef unsigned short __kernel_old_uid_t; 45typedef unsigned short __kernel_old_uid_t;
46typedef unsigned short __kernel_old_gid_t; 46typedef unsigned short __kernel_old_gid_t;
47typedef unsigned short __kernel_old_dev_t;
47 48
48#ifdef __GNUC__ 49#ifdef __GNUC__
49typedef long long __kernel_loff_t; 50typedef long long __kernel_loff_t;
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
index ca4ccfc4b578..702884926a55 100644
--- a/include/asm-arm26/system.h
+++ b/include/asm-arm26/system.h
@@ -98,9 +98,8 @@ extern unsigned int user_debug;
98 * spin_unlock_irq() and friends are implemented. This avoids 98 * spin_unlock_irq() and friends are implemented. This avoids
99 * us needlessly decrementing and incrementing the preempt count. 99 * us needlessly decrementing and incrementing the preempt count.
100 */ 100 */
101#define prepare_arch_switch(rq,next) local_irq_enable() 101#define prepare_arch_switch(next) local_irq_enable()
102#define finish_arch_switch(rq,prev) spin_unlock(&(rq)->lock) 102#define finish_arch_switch(prev) spin_unlock(&(rq)->lock)
103#define task_running(rq,p) ((rq)->curr == (p))
104 103
105/* 104/*
106 * switch_to(prev, next) should switch from task `prev' to `next' 105 * switch_to(prev, next) should switch from task `prev' to `next'
diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h
index d3eb0f1e4208..b7fef1572dc0 100644
--- a/include/asm-cris/bitops.h
+++ b/include/asm-cris/bitops.h
@@ -290,7 +290,7 @@ static inline int find_next_zero_bit (const unsigned long * addr, int size, int
290 tmp = *p; 290 tmp = *p;
291 291
292 found_first: 292 found_first:
293 tmp |= ~0UL >> size; 293 tmp |= ~0UL << size;
294 found_middle: 294 found_middle:
295 return result + ffz(tmp); 295 return result + ffz(tmp);
296} 296}
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h
index 02be7b3a8a83..f686b519878e 100644
--- a/include/asm-frv/bitops.h
+++ b/include/asm-frv/bitops.h
@@ -209,7 +209,7 @@ static inline int find_next_zero_bit(const void *addr, int size, int offset)
209 tmp = *p; 209 tmp = *p;
210 210
211found_first: 211found_first:
212 tmp |= ~0UL >> size; 212 tmp |= ~0UL << size;
213found_middle: 213found_middle:
214 return result + ffz(tmp); 214 return result + ffz(tmp);
215} 215}
diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h
index c0411ec9d651..ff7c2b721594 100644
--- a/include/asm-h8300/bitops.h
+++ b/include/asm-h8300/bitops.h
@@ -227,7 +227,7 @@ static __inline__ int find_next_zero_bit (const unsigned long * addr, int size,
227 tmp = *p; 227 tmp = *p;
228 228
229found_first: 229found_first:
230 tmp |= ~0UL >> size; 230 tmp |= ~0UL << size;
231found_middle: 231found_middle:
232 return result + ffz(tmp); 232 return result + ffz(tmp);
233} 233}
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index df4ed323aa4d..55059abf9c95 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -179,7 +179,7 @@ extern void acpi_reserve_bootmem(void);
179 179
180extern u8 x86_acpiid_to_apicid[]; 180extern u8 x86_acpiid_to_apicid[];
181 181
182#define ARCH_HAS_POWER_PDC_INIT 1 182#define ARCH_HAS_POWER_INIT 1
183 183
184#endif /*__KERNEL__*/ 184#endif /*__KERNEL__*/
185 185
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 73296d9924fb..997ca5d17876 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -110,10 +110,10 @@ extern int page_is_ram(unsigned long pagenr);
110#endif /* __ASSEMBLY__ */ 110#endif /* __ASSEMBLY__ */
111 111
112#ifdef __ASSEMBLY__ 112#ifdef __ASSEMBLY__
113#define __PAGE_OFFSET (0xC0000000) 113#define __PAGE_OFFSET CONFIG_PAGE_OFFSET
114#define __PHYSICAL_START CONFIG_PHYSICAL_START 114#define __PHYSICAL_START CONFIG_PHYSICAL_START
115#else 115#else
116#define __PAGE_OFFSET (0xC0000000UL) 116#define __PAGE_OFFSET ((unsigned long)CONFIG_PAGE_OFFSET)
117#define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START) 117#define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START)
118#endif 118#endif
119#define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START) 119#define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START)
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 36a92ed6a9d0..399145a247f2 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -507,7 +507,7 @@ struct alt_instr {
507#define smp_rmb() rmb() 507#define smp_rmb() rmb()
508#define smp_wmb() wmb() 508#define smp_wmb() wmb()
509#define smp_read_barrier_depends() read_barrier_depends() 509#define smp_read_barrier_depends() read_barrier_depends()
510#define set_mb(var, value) do { xchg(&var, value); } while (0) 510#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
511#else 511#else
512#define smp_mb() barrier() 512#define smp_mb() barrier()
513#define smp_rmb() barrier() 513#define smp_rmb() barrier()
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index d7e19eb344b7..af503a122b23 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -27,6 +27,15 @@
27#ifndef _ASM_I386_TOPOLOGY_H 27#ifndef _ASM_I386_TOPOLOGY_H
28#define _ASM_I386_TOPOLOGY_H 28#define _ASM_I386_TOPOLOGY_H
29 29
30#ifdef CONFIG_SMP
31#define topology_physical_package_id(cpu) \
32 (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu])
33#define topology_core_id(cpu) \
34 (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu])
35#define topology_core_siblings(cpu) (cpu_core_map[cpu])
36#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
37#endif
38
30#ifdef CONFIG_NUMA 39#ifdef CONFIG_NUMA
31 40
32#include <asm/mpspec.h> 41#include <asm/mpspec.h>
diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h
index e62b95301d51..93f45c5f189f 100644
--- a/include/asm-ia64/ide.h
+++ b/include/asm-ia64/ide.h
@@ -17,14 +17,6 @@
17 17
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20#ifndef MAX_HWIFS
21# ifdef CONFIG_PCI
22#define MAX_HWIFS 10
23# else
24#define MAX_HWIFS 6
25# endif
26#endif
27
28#define IDE_ARCH_OBSOLETE_DEFAULTS 20#define IDE_ARCH_OBSOLETE_DEFAULTS
29 21
30static inline int ide_default_irq(unsigned long base) 22static inline int ide_default_irq(unsigned long base)
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 09b99029ac1a..23c8e1be1911 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -559,6 +559,23 @@ ia64_eoi (void)
559 559
560#define cpu_relax() ia64_hint(ia64_hint_pause) 560#define cpu_relax() ia64_hint(ia64_hint_pause)
561 561
562static inline int
563ia64_get_irr(unsigned int vector)
564{
565 unsigned int reg = vector / 64;
566 unsigned int bit = vector % 64;
567 u64 irr;
568
569 switch (reg) {
570 case 0: irr = ia64_getreg(_IA64_REG_CR_IRR0); break;
571 case 1: irr = ia64_getreg(_IA64_REG_CR_IRR1); break;
572 case 2: irr = ia64_getreg(_IA64_REG_CR_IRR2); break;
573 case 3: irr = ia64_getreg(_IA64_REG_CR_IRR3); break;
574 }
575
576 return test_bit(bit, &irr);
577}
578
562static inline void 579static inline void
563ia64_set_lrr0 (unsigned long val) 580ia64_set_lrr0 (unsigned long val)
564{ 581{
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index 313cad0628d0..0b210abbe003 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -658,15 +658,7 @@ ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
658 return isrv.status; 658 return isrv.status;
659} 659}
660 660
661/* Flush all the processor and platform level instruction and/or data caches */ 661extern s64 ia64_sal_cache_flush (u64 cache_type);
662static inline s64
663ia64_sal_cache_flush (u64 cache_type)
664{
665 struct ia64_sal_retval isrv;
666 SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0);
667 return isrv.status;
668}
669
670 662
671/* Initialize all the processor and platform level instruction and data caches */ 663/* Initialize all the processor and platform level instruction and data caches */
672static inline s64 664static inline s64
diff --git a/include/asm-ia64/sn/bte.h b/include/asm-ia64/sn/bte.h
index f50da3d91d07..01e5b4103235 100644
--- a/include/asm-ia64/sn/bte.h
+++ b/include/asm-ia64/sn/bte.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9 9
@@ -100,13 +100,28 @@
100#define BTE_LNSTAT_STORE(_bte, _x) \ 100#define BTE_LNSTAT_STORE(_bte, _x) \
101 HUB_S(_bte->bte_base_addr, (_x)) 101 HUB_S(_bte->bte_base_addr, (_x))
102#define BTE_SRC_STORE(_bte, _x) \ 102#define BTE_SRC_STORE(_bte, _x) \
103 HUB_S(_bte->bte_source_addr, (_x)) 103({ \
104 u64 __addr = ((_x) & ~AS_MASK); \
105 if (is_shub2()) \
106 __addr = SH2_TIO_PHYS_TO_DMA(__addr); \
107 HUB_S(_bte->bte_source_addr, __addr); \
108})
104#define BTE_DEST_STORE(_bte, _x) \ 109#define BTE_DEST_STORE(_bte, _x) \
105 HUB_S(_bte->bte_destination_addr, (_x)) 110({ \
111 u64 __addr = ((_x) & ~AS_MASK); \
112 if (is_shub2()) \
113 __addr = SH2_TIO_PHYS_TO_DMA(__addr); \
114 HUB_S(_bte->bte_destination_addr, __addr); \
115})
106#define BTE_CTRL_STORE(_bte, _x) \ 116#define BTE_CTRL_STORE(_bte, _x) \
107 HUB_S(_bte->bte_control_addr, (_x)) 117 HUB_S(_bte->bte_control_addr, (_x))
108#define BTE_NOTIF_STORE(_bte, _x) \ 118#define BTE_NOTIF_STORE(_bte, _x) \
109 HUB_S(_bte->bte_notify_addr, (_x)) 119({ \
120 u64 __addr = ia64_tpa((_x) & ~AS_MASK); \
121 if (is_shub2()) \
122 __addr = SH2_TIO_PHYS_TO_DMA(__addr); \
123 HUB_S(_bte->bte_notify_addr, __addr); \
124})
110 125
111#define BTE_START_TRANSFER(_bte, _len, _mode) \ 126#define BTE_START_TRANSFER(_bte, _len, _mode) \
112 is_shub2() ? BTE_CTRL_STORE(_bte, IBLS_BUSY | (_mode << 24) | _len) \ 127 is_shub2() ? BTE_CTRL_STORE(_bte, IBLS_BUSY | (_mode << 24) | _len) \
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
index a3431372c6e7..60a51a406eec 100644
--- a/include/asm-ia64/sn/intr.h
+++ b/include/asm-ia64/sn/intr.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#ifndef _ASM_IA64_SN_INTR_H 9#ifndef _ASM_IA64_SN_INTR_H
@@ -11,26 +11,26 @@
11 11
12#include <linux/rcupdate.h> 12#include <linux/rcupdate.h>
13 13
14#define SGI_UART_VECTOR (0xe9) 14#define SGI_UART_VECTOR 0xe9
15 15
16/* Reserved IRQs : Note, not to exceed IA64_SN2_FIRST_DEVICE_VECTOR */ 16/* Reserved IRQs : Note, not to exceed IA64_SN2_FIRST_DEVICE_VECTOR */
17#define SGI_XPC_ACTIVATE (0x30) 17#define SGI_XPC_ACTIVATE 0x30
18#define SGI_II_ERROR (0x31) 18#define SGI_II_ERROR 0x31
19#define SGI_XBOW_ERROR (0x32) 19#define SGI_XBOW_ERROR 0x32
20#define SGI_PCIASIC_ERROR (0x33) 20#define SGI_PCIASIC_ERROR 0x33
21#define SGI_ACPI_SCI_INT (0x34) 21#define SGI_ACPI_SCI_INT 0x34
22#define SGI_TIOCA_ERROR (0x35) 22#define SGI_TIOCA_ERROR 0x35
23#define SGI_TIO_ERROR (0x36) 23#define SGI_TIO_ERROR 0x36
24#define SGI_TIOCX_ERROR (0x37) 24#define SGI_TIOCX_ERROR 0x37
25#define SGI_MMTIMER_VECTOR (0x38) 25#define SGI_MMTIMER_VECTOR 0x38
26#define SGI_XPC_NOTIFY (0xe7) 26#define SGI_XPC_NOTIFY 0xe7
27 27
28#define IA64_SN2_FIRST_DEVICE_VECTOR (0x3c) 28#define IA64_SN2_FIRST_DEVICE_VECTOR 0x3c
29#define IA64_SN2_LAST_DEVICE_VECTOR (0xe6) 29#define IA64_SN2_LAST_DEVICE_VECTOR 0xe6
30 30
31#define SN2_IRQ_RESERVED (0x1) 31#define SN2_IRQ_RESERVED 0x1
32#define SN2_IRQ_CONNECTED (0x2) 32#define SN2_IRQ_CONNECTED 0x2
33#define SN2_IRQ_SHARED (0x4) 33#define SN2_IRQ_SHARED 0x4
34 34
35// The SN PROM irq struct 35// The SN PROM irq struct
36struct sn_irq_info { 36struct sn_irq_info {
diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h
index e68a80853d5d..9ca642cad338 100644
--- a/include/asm-ia64/sn/sn_feature_sets.h
+++ b/include/asm-ia64/sn/sn_feature_sets.h
@@ -8,7 +8,7 @@
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 * 10 *
11 * Copyright (c) 2005 Silicon Graphics, Inc. All rights reserved. 11 * Copyright (c) 2005-2006 Silicon Graphics, Inc. All rights reserved.
12 */ 12 */
13 13
14 14
@@ -27,14 +27,12 @@ extern int sn_prom_feature_available(int id);
27 * "false" for new features. 27 * "false" for new features.
28 * 28 *
29 * Use: 29 * Use:
30 * if (sn_prom_feature_available(PRF_FEATURE_XXX)) 30 * if (sn_prom_feature_available(PRF_XXX))
31 * ... 31 * ...
32 */ 32 */
33 33
34/* 34#define PRF_PAL_CACHE_FLUSH_SAFE 0
35 * Example: feature XXX 35#define PRF_DEVICE_FLUSH_LIST 1
36 */
37#define PRF_FEATURE_XXX 0
38 36
39 37
40 38
@@ -51,7 +49,7 @@ extern int sn_prom_feature_available(int id);
51 * 49 *
52 * By default, features are disabled unless explicitly enabled. 50 * By default, features are disabled unless explicitly enabled.
53 */ 51 */
54#define OSF_MCA_SLV_TO_OS_INIT_SLV 0 52#define OSF_MCA_SLV_TO_OS_INIT_SLV 0
55#define OSF_FEAT_LOG_SBES 1 53#define OSF_FEAT_LOG_SBES 1
56 54
57#endif /* _ASM_IA64_SN_FEATURE_SETS_H */ 55#endif /* _ASM_IA64_SN_FEATURE_SETS_H */
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 80c5a234e259..062538715623 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -249,32 +249,7 @@ extern void ia64_load_extra (struct task_struct *task);
249# define switch_to(prev,next,last) __switch_to(prev, next, last) 249# define switch_to(prev,next,last) __switch_to(prev, next, last)
250#endif 250#endif
251 251
252/*
253 * On IA-64, we don't want to hold the runqueue's lock during the low-level context-switch,
254 * because that could cause a deadlock. Here is an example by Erich Focht:
255 *
256 * Example:
257 * CPU#0:
258 * schedule()
259 * -> spin_lock_irq(&rq->lock)
260 * -> context_switch()
261 * -> wrap_mmu_context()
262 * -> read_lock(&tasklist_lock)
263 *
264 * CPU#1:
265 * sys_wait4() or release_task() or forget_original_parent()
266 * -> write_lock(&tasklist_lock)
267 * -> do_notify_parent()
268 * -> wake_up_parent()
269 * -> try_to_wake_up()
270 * -> spin_lock_irq(&parent_rq->lock)
271 *
272 * If the parent's rq happens to be on CPU#0, we'll wait for the rq->lock
273 * of that CPU which will not be released, because there we wait for the
274 * tasklist_lock to become available.
275 */
276#define __ARCH_WANT_UNLOCKED_CTXSW 252#define __ARCH_WANT_UNLOCKED_CTXSW
277
278#define ARCH_HAS_PREFETCH_SWITCH_STACK 253#define ARCH_HAS_PREFETCH_SWITCH_STACK
279#define ia64_platform_is(x) (strcmp(x, platform_name) == 0) 254#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
280 255
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 412ef8e493a8..3ee19dfa46df 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -102,6 +102,13 @@ void build_cpu_to_node_map(void);
102 102
103#endif /* CONFIG_NUMA */ 103#endif /* CONFIG_NUMA */
104 104
105#ifdef CONFIG_SMP
106#define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id)
107#define topology_core_id(cpu) (cpu_data(cpu)->core_id)
108#define topology_core_siblings(cpu) (cpu_core_map[cpu])
109#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
110#endif
111
105#include <asm-generic/topology.h> 112#include <asm-generic/topology.h>
106 113
107#endif /* _ASM_IA64_TOPOLOGY_H */ 114#endif /* _ASM_IA64_TOPOLOGY_H */
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h
index 2ca56d34aaad..4dc7253ff5d0 100644
--- a/include/asm-parisc/atomic.h
+++ b/include/asm-parisc/atomic.h
@@ -1,9 +1,13 @@
1/* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
2 * Copyright (C) 2006 Kyle McMartin <kyle@parisc-linux.org>
3 */
4
1#ifndef _ASM_PARISC_ATOMIC_H_ 5#ifndef _ASM_PARISC_ATOMIC_H_
2#define _ASM_PARISC_ATOMIC_H_ 6#define _ASM_PARISC_ATOMIC_H_
3 7
4#include <linux/config.h> 8#include <linux/config.h>
9#include <linux/types.h>
5#include <asm/system.h> 10#include <asm/system.h>
6/* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>. */
7 11
8/* 12/*
9 * Atomic operations that C can't guarantee us. Useful for 13 * Atomic operations that C can't guarantee us. Useful for
@@ -46,15 +50,6 @@ extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
46# define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0) 50# define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
47#endif 51#endif
48 52
49/* Note that we need not lock read accesses - aligned word writes/reads
50 * are atomic, so a reader never sees unconsistent values.
51 *
52 * Cache-line alignment would conflict with, for example, linux/module.h
53 */
54
55typedef struct { volatile int counter; } atomic_t;
56
57
58/* This should get optimized out since it's never called. 53/* This should get optimized out since it's never called.
59** Or get a link error if xchg is used "wrong". 54** Or get a link error if xchg is used "wrong".
60*/ 55*/
@@ -69,10 +64,9 @@ extern unsigned long __xchg64(unsigned long, unsigned long *);
69#endif 64#endif
70 65
71/* optimizer better get rid of switch since size is a constant */ 66/* optimizer better get rid of switch since size is a constant */
72static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, 67static __inline__ unsigned long
73 int size) 68__xchg(unsigned long x, __volatile__ void * ptr, int size)
74{ 69{
75
76 switch(size) { 70 switch(size) {
77#ifdef __LP64__ 71#ifdef __LP64__
78 case 8: return __xchg64(x,(unsigned long *) ptr); 72 case 8: return __xchg64(x,(unsigned long *) ptr);
@@ -129,7 +123,13 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
129 (unsigned long)_n_, sizeof(*(ptr))); \ 123 (unsigned long)_n_, sizeof(*(ptr))); \
130 }) 124 })
131 125
126/* Note that we need not lock read accesses - aligned word writes/reads
127 * are atomic, so a reader never sees unconsistent values.
128 *
129 * Cache-line alignment would conflict with, for example, linux/module.h
130 */
132 131
132typedef struct { volatile int counter; } atomic_t;
133 133
134/* It's possible to reduce all atomic operations to either 134/* It's possible to reduce all atomic operations to either
135 * __atomic_add_return, atomic_set and atomic_read (the latter 135 * __atomic_add_return, atomic_set and atomic_read (the latter
@@ -210,12 +210,66 @@ static __inline__ int atomic_read(const atomic_t *v)
210 210
211#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) 211#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
212 212
213#define ATOMIC_INIT(i) { (i) } 213#define ATOMIC_INIT(i) ((atomic_t) { (i) })
214 214
215#define smp_mb__before_atomic_dec() smp_mb() 215#define smp_mb__before_atomic_dec() smp_mb()
216#define smp_mb__after_atomic_dec() smp_mb() 216#define smp_mb__after_atomic_dec() smp_mb()
217#define smp_mb__before_atomic_inc() smp_mb() 217#define smp_mb__before_atomic_inc() smp_mb()
218#define smp_mb__after_atomic_inc() smp_mb() 218#define smp_mb__after_atomic_inc() smp_mb()
219 219
220#ifdef __LP64__
221
222typedef struct { volatile s64 counter; } atomic64_t;
223
224#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
225
226static __inline__ int
227__atomic64_add_return(s64 i, atomic64_t *v)
228{
229 int ret;
230 unsigned long flags;
231 _atomic_spin_lock_irqsave(v, flags);
232
233 ret = (v->counter += i);
234
235 _atomic_spin_unlock_irqrestore(v, flags);
236 return ret;
237}
238
239static __inline__ void
240atomic64_set(atomic64_t *v, s64 i)
241{
242 unsigned long flags;
243 _atomic_spin_lock_irqsave(v, flags);
244
245 v->counter = i;
246
247 _atomic_spin_unlock_irqrestore(v, flags);
248}
249
250static __inline__ s64
251atomic64_read(const atomic64_t *v)
252{
253 return v->counter;
254}
255
256#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)i),(v))))
257#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)i),(v))))
258#define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v))))
259#define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v))))
260
261#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)i),(v)))
262#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)i),(v)))
263#define atomic64_inc_return(v) (__atomic64_add_return( 1,(v)))
264#define atomic64_dec_return(v) (__atomic64_add_return( -1,(v)))
265
266#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
267
268#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
269#define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0)
270
271#endif /* __LP64__ */
272
220#include <asm-generic/atomic.h> 273#include <asm-generic/atomic.h>
221#endif 274
275#endif /* _ASM_PARISC_ATOMIC_H_ */
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index 1bc3c83ee74b..c53af9ff41b5 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -183,4 +183,10 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
183 __flush_cache_page(vma, vmaddr); 183 __flush_cache_page(vma, vmaddr);
184 184
185} 185}
186
187#ifdef CONFIG_DEBUG_RODATA
188void mark_rodata_ro(void);
186#endif 189#endif
190
191#endif /* _PARISC_CACHEFLUSH_H */
192
diff --git a/include/asm-parisc/compat_ucontext.h b/include/asm-parisc/compat_ucontext.h
index a1228a3d2071..2f7292afde3c 100644
--- a/include/asm-parisc/compat_ucontext.h
+++ b/include/asm-parisc/compat_ucontext.h
@@ -1,8 +1,7 @@
1#ifndef _ASM_PARISC_COMPAT_UCONTEXT_H 1#ifndef _ASM_PARISC_COMPAT_UCONTEXT_H
2#define _ASM_PARISC_COMPAT_UCONTEXT_H 2#define _ASM_PARISC_COMPAT_UCONTEXT_H
3 3
4#include<linux/compat.h> 4#include <linux/compat.h>
5#include<asm/compat_signal.h>
6 5
7/* 32-bit ucontext as seen from an 64-bit kernel */ 6/* 32-bit ucontext as seen from an 64-bit kernel */
8struct compat_ucontext { 7struct compat_ucontext {
diff --git a/include/asm-parisc/grfioctl.h b/include/asm-parisc/grfioctl.h
index 6a910311b56b..671e06042b40 100644
--- a/include/asm-parisc/grfioctl.h
+++ b/include/asm-parisc/grfioctl.h
@@ -58,7 +58,7 @@
58#define CRT_ID_ELK_1024DB 0x27849CA5 /* Elk 1024x768 double buffer */ 58#define CRT_ID_ELK_1024DB 0x27849CA5 /* Elk 1024x768 double buffer */
59#define CRT_ID_ELK_GS S9000_ID_A1924A /* Elk 1280x1024 GreyScale */ 59#define CRT_ID_ELK_GS S9000_ID_A1924A /* Elk 1280x1024 GreyScale */
60#define CRT_ID_CRX24 S9000_ID_A1439A /* Piranha */ 60#define CRT_ID_CRX24 S9000_ID_A1439A /* Piranha */
61#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti (built-in B132+/B160L) */ 61#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti, A4450A (built-in B132+/B160L) */
62#define CRT_ID_THUNDER 0x2F23E5FC /* Thunder 1 VISUALIZE 48*/ 62#define CRT_ID_THUNDER 0x2F23E5FC /* Thunder 1 VISUALIZE 48*/
63#define CRT_ID_THUNDER2 0x2F8D570E /* Thunder 2 VISUALIZE 48 XP*/ 63#define CRT_ID_THUNDER2 0x2F8D570E /* Thunder 2 VISUALIZE 48 XP*/
64#define CRT_ID_HCRX S9000_ID_HCRX /* Hyperdrive HCRX */ 64#define CRT_ID_HCRX S9000_ID_HCRX /* Hyperdrive HCRX */
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index f277254159b7..fe7f6a2f5aa7 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -18,6 +18,18 @@
18*/ 18*/
19#define PCI_MAX_BUSSES 256 19#define PCI_MAX_BUSSES 256
20 20
21
22/* To be used as: mdelay(pci_post_reset_delay);
23 *
24 * post_reset is the time the kernel should stall to prevent anyone from
25 * accessing the PCI bus once #RESET is de-asserted.
26 * PCI spec somewhere says 1 second but with multi-PCI bus systems,
27 * this makes the boot time much longer than necessary.
28 * 20ms seems to work for all the HP PCI implementations to date.
29 */
30#define pci_post_reset_delay 50
31
32
21/* 33/*
22** pci_hba_data (aka H2P_OBJECT in HP/UX) 34** pci_hba_data (aka H2P_OBJECT in HP/UX)
23** 35**
@@ -83,7 +95,7 @@ static __inline__ int pci_is_lmmio(struct pci_hba_data *hba, unsigned long a)
83 95
84/* 96/*
85** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses. 97** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses.
86** See pcibios.c for more conversions used by Generic PCI code. 98** See pci.c for more conversions used by Generic PCI code.
87** 99**
88** Platform characteristics/firmware guarantee that 100** Platform characteristics/firmware guarantee that
89** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO 101** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO
@@ -191,9 +203,6 @@ struct pci_bios_ops {
191*/ 203*/
192extern struct pci_port_ops *pci_port; 204extern struct pci_port_ops *pci_port;
193extern struct pci_bios_ops *pci_bios; 205extern struct pci_bios_ops *pci_bios;
194extern int pci_post_reset_delay; /* delay after de-asserting #RESET */
195extern int pci_hba_count;
196extern struct pci_hba_data *parisc_pci_hba[];
197 206
198#ifdef CONFIG_PCI 207#ifdef CONFIG_PCI
199extern void pcibios_register_hba(struct pci_hba_data *); 208extern void pcibios_register_hba(struct pci_hba_data *);
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
index 6291d6692e5d..3122fad38a1b 100644
--- a/include/asm-parisc/pgalloc.h
+++ b/include/asm-parisc/pgalloc.h
@@ -137,7 +137,6 @@ static inline void pte_free_kernel(pte_t *pte)
137 137
138#define pte_free(page) pte_free_kernel(page_address(page)) 138#define pte_free(page) pte_free_kernel(page_address(page))
139 139
140extern int do_check_pgt_cache(int, int);
141#define check_pgt_cache() do { } while (0) 140#define check_pgt_cache() do { } while (0)
142 141
143#endif 142#endif
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index b4554711c3e7..4e34c6b44059 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -213,7 +213,7 @@ extern void *vmalloc_start;
213#define PAGE_COPY PAGE_EXECREAD 213#define PAGE_COPY PAGE_EXECREAD
214#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED) 214#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED)
215#define PAGE_KERNEL __pgprot(_PAGE_KERNEL) 215#define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
216#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_DIRTY | _PAGE_ACCESSED) 216#define PAGE_KERNEL_RO __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE)
217#define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE) 217#define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE)
218#define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ) 218#define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ)
219#define PAGE_FLUSH __pgprot(_PAGE_FLUSH) 219#define PAGE_FLUSH __pgprot(_PAGE_FLUSH)
diff --git a/include/asm-parisc/rt_sigframe.h b/include/asm-parisc/rt_sigframe.h
index 5623c032b64c..f0dd3b30f6c4 100644
--- a/include/asm-parisc/rt_sigframe.h
+++ b/include/asm-parisc/rt_sigframe.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_PARISC_RT_SIGFRAME_H 1#ifndef _ASM_PARISC_RT_SIGFRAME_H
2#define _ASM_PARISC_RT_SIGFRAME_H 2#define _ASM_PARISC_RT_SIGFRAME_H
3 3
4#ifdef CONFIG_COMPAT
5#include <asm/compat_rt_sigframe.h>
6#endif
7
8#define SIGRETURN_TRAMP 4 4#define SIGRETURN_TRAMP 4
9#define SIGRESTARTBLOCK_TRAMP 5 5#define SIGRESTARTBLOCK_TRAMP 5
10#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP) 6#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 80b7b98c70a1..c56fccbf34ad 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -761,8 +761,27 @@
761#define __NR_keyctl (__NR_Linux + 266) 761#define __NR_keyctl (__NR_Linux + 266)
762#define __NR_ioprio_set (__NR_Linux + 267) 762#define __NR_ioprio_set (__NR_Linux + 267)
763#define __NR_ioprio_get (__NR_Linux + 268) 763#define __NR_ioprio_get (__NR_Linux + 268)
764#define __NR_inotify_init (__NR_Linux + 269)
765#define __NR_inotify_add_watch (__NR_Linux + 270)
766#define __NR_inotify_rm_watch (__NR_Linux + 271)
767#define __NR_migrate_pages (__NR_Linux + 272)
768#define __NR_pselect6 (__NR_Linux + 273)
769#define __NR_ppoll (__NR_Linux + 274)
770#define __NR_openat (__NR_Linux + 275)
771#define __NR_mkdirat (__NR_Linux + 276)
772#define __NR_mknodat (__NR_Linux + 277)
773#define __NR_fchownat (__NR_Linux + 278)
774#define __NR_futimesat (__NR_Linux + 279)
775#define __NR_newfstatat (__NR_Linux + 280)
776#define __NR_unlinkat (__NR_Linux + 281)
777#define __NR_renameat (__NR_Linux + 282)
778#define __NR_linkat (__NR_Linux + 283)
779#define __NR_symlinkat (__NR_Linux + 284)
780#define __NR_readlinkat (__NR_Linux + 285)
781#define __NR_fchmodat (__NR_Linux + 286)
782#define __NR_faccessat (__NR_Linux + 287)
764 783
765#define __NR_Linux_syscalls 269 784#define __NR_Linux_syscalls 288
766 785
767#define HPUX_GATEWAY_ADDR 0xC0000004 786#define HPUX_GATEWAY_ADDR 0xC0000004
768#define LINUX_GATEWAY_ADDR 0x100 787#define LINUX_GATEWAY_ADDR 0x100
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index 640a6459f2f4..bda2f217e6fe 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -33,6 +33,7 @@
33 33
34#ifdef CONFIG_KEXEC 34#ifdef CONFIG_KEXEC
35 35
36#ifndef __ASSEMBLY__
36#ifdef __powerpc64__ 37#ifdef __powerpc64__
37/* 38/*
38 * This function is responsible for capturing register states if coming 39 * This function is responsible for capturing register states if coming
@@ -104,7 +105,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
104 struct pt_regs *oldregs) { } 105 struct pt_regs *oldregs) { }
105#endif /* !__powerpc64 __ */ 106#endif /* !__powerpc64 __ */
106 107
107#ifndef __ASSEMBLY__
108#define MAX_NOTE_BYTES 1024 108#define MAX_NOTE_BYTES 1024
109 109
110#ifdef __powerpc64__ 110#ifdef __powerpc64__
@@ -121,6 +121,8 @@ extern void default_machine_kexec(struct kimage *image);
121extern int default_machine_kexec_prepare(struct kimage *image); 121extern int default_machine_kexec_prepare(struct kimage *image);
122extern void default_machine_crash_shutdown(struct pt_regs *regs); 122extern void default_machine_crash_shutdown(struct pt_regs *regs);
123 123
124extern void machine_kexec_simple(struct kimage *image);
125
124#endif /* ! __ASSEMBLY__ */ 126#endif /* ! __ASSEMBLY__ */
125#endif /* CONFIG_KEXEC */ 127#endif /* CONFIG_KEXEC */
126#endif /* __KERNEL__ */ 128#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/pmac_pfunc.h b/include/asm-powerpc/pmac_pfunc.h
index d9728c80f86d..cef61304ffc2 100644
--- a/include/asm-powerpc/pmac_pfunc.h
+++ b/include/asm-powerpc/pmac_pfunc.h
@@ -167,6 +167,7 @@ struct pmf_irq_client {
167 void *data; 167 void *data;
168 struct module *owner; 168 struct module *owner;
169 struct list_head link; 169 struct list_head link;
170 struct pmf_function *func;
170}; 171};
171 172
172 173
@@ -187,9 +188,7 @@ extern int pmf_register_irq_client(struct device_node *np,
187 const char *name, 188 const char *name,
188 struct pmf_irq_client *client); 189 struct pmf_irq_client *client);
189 190
190extern void pmf_unregister_irq_client(struct device_node *np, 191extern void pmf_unregister_irq_client(struct pmf_irq_client *client);
191 const char *name,
192 struct pmf_irq_client *client);
193 192
194/* 193/*
195 * Called by the handlers when an irq happens 194 * Called by the handlers when an irq happens
diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h
index 77b10d6adabd..c744ff33b1df 100644
--- a/include/asm-s390/dasd.h
+++ b/include/asm-s390/dasd.h
@@ -8,8 +8,6 @@
8 * any future changes wrt the API will result in a change of the APIVERSION reported 8 * any future changes wrt the API will result in a change of the APIVERSION reported
9 * to userspace by the DASDAPIVER-ioctl 9 * to userspace by the DASDAPIVER-ioctl
10 * 10 *
11 * $Revision: 1.6 $
12 *
13 */ 11 */
14 12
15#ifndef DASD_H 13#ifndef DASD_H
@@ -206,7 +204,8 @@ typedef struct attrib_data_t {
206 * 204 *
207 * Here ist how the ioctl-nr should be used: 205 * Here ist how the ioctl-nr should be used:
208 * 0 - 31 DASD driver itself 206 * 0 - 31 DASD driver itself
209 * 32 - 239 still open 207 * 32 - 229 still open
208 * 230 - 239 DASD extended error reporting
210 * 240 - 255 reserved for EMC 209 * 240 - 255 reserved for EMC
211 *******************************************************************************/ 210 *******************************************************************************/
212 211
@@ -238,12 +237,22 @@ typedef struct attrib_data_t {
238#define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t) 237#define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)
239/* Get Attributes (cache operations) */ 238/* Get Attributes (cache operations) */
240#define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t) 239#define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t)
240/* retrieve extended error-reporting value */
241#define BIODASDEERGET _IOR(DASD_IOCTL_LETTER,6,int)
241 242
242 243
243/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */ 244/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */
244#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t) 245#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t)
245/* Set Attributes (cache operations) */ 246/* Set Attributes (cache operations) */
246#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t) 247#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)
248/* retrieve extended error-reporting value */
249#define BIODASDEERSET _IOW(DASD_IOCTL_LETTER,3,int)
250
251
252/* remove all records from the eer buffer */
253#define DASD_EER_PURGE _IO(DASD_IOCTL_LETTER,230)
254/* set the number of pages that are used for the internal eer buffer */
255#define DASD_EER_SETBUFSIZE _IOW(DASD_IOCTL_LETTER,230,int)
247 256
248 257
249#endif /* DASD_H */ 258#endif /* DASD_H */
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h
index 71f55eb2350a..b05825dd16d7 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -90,10 +90,16 @@ extern void iounmap(void *addr);
90#define readb_relaxed(addr) readb(addr) 90#define readb_relaxed(addr) readb(addr)
91#define readw_relaxed(addr) readw(addr) 91#define readw_relaxed(addr) readw(addr)
92#define readl_relaxed(addr) readl(addr) 92#define readl_relaxed(addr) readl(addr)
93#define __raw_readb readb
94#define __raw_readw readw
95#define __raw_readl readl
93 96
94#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) 97#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b))
95#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) 98#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b))
96#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) 99#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b))
100#define __raw_writeb writeb
101#define __raw_writew writew
102#define __raw_writel writel
97 103
98#define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) 104#define memset_io(a,b,c) memset(__io_virt(a),(b),(c))
99#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) 105#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c))
diff --git a/include/asm-s390/qdio.h b/include/asm-s390/qdio.h
index 7bc15f0231db..a2f37a9353d3 100644
--- a/include/asm-s390/qdio.h
+++ b/include/asm-s390/qdio.h
@@ -11,8 +11,6 @@
11#ifndef __QDIO_H__ 11#ifndef __QDIO_H__
12#define __QDIO_H__ 12#define __QDIO_H__
13 13
14#define VERSION_QDIO_H "$Revision: 1.57 $"
15
16/* note, that most of the typedef's are from ingo. */ 14/* note, that most of the typedef's are from ingo. */
17 15
18#include <linux/interrupt.h> 16#include <linux/interrupt.h>
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h
index f3797a52c4ea..8e0c7ed73d03 100644
--- a/include/asm-s390/thread_info.h
+++ b/include/asm-s390/thread_info.h
@@ -2,7 +2,7 @@
2 * include/asm-s390/thread_info.h 2 * include/asm-s390/thread_info.h
3 * 3 *
4 * S390 version 4 * S390 version
5 * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Copyright (C) IBM Corp. 2002,2006
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) 6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
7 */ 7 */
8 8
@@ -88,7 +88,7 @@ static inline struct thread_info *current_thread_info(void)
88 * thread information flags bit numbers 88 * thread information flags bit numbers
89 */ 89 */
90#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 90#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
91#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 91#define TIF_RESTORE_SIGMASK 1 /* restore signal mask in do_signal() */
92#define TIF_SIGPENDING 2 /* signal pending */ 92#define TIF_SIGPENDING 2 /* signal pending */
93#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 93#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
94#define TIF_RESTART_SVC 4 /* restart svc with new svc number */ 94#define TIF_RESTART_SVC 4 /* restart svc with new svc number */
@@ -102,7 +102,7 @@ static inline struct thread_info *current_thread_info(void)
102#define TIF_MEMDIE 19 102#define TIF_MEMDIE 19
103 103
104#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 104#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
105#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 105#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
106#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 106#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
107#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 107#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
108#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC) 108#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC)
diff --git a/include/asm-s390/timer.h b/include/asm-s390/timer.h
index ea0788967c51..fcd6c256a2d1 100644
--- a/include/asm-s390/timer.h
+++ b/include/asm-s390/timer.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-s390/timer.h 2 * include/asm-s390/timer.h
3 * 3 *
4 * (C) Copyright IBM Corp. 2003 4 * (C) Copyright IBM Corp. 2003,2006
5 * Virtual CPU timer 5 * Virtual CPU timer
6 * 6 *
7 * Author: Jan Glauber (jang@de.ibm.com) 7 * Author: Jan Glauber (jang@de.ibm.com)
@@ -10,6 +10,8 @@
10#ifndef _ASM_S390_TIMER_H 10#ifndef _ASM_S390_TIMER_H
11#define _ASM_S390_TIMER_H 11#define _ASM_S390_TIMER_H
12 12
13#ifdef __KERNEL__
14
13#include <linux/timer.h> 15#include <linux/timer.h>
14 16
15#define VTIMER_MAX_SLICE (0x7ffffffffffff000LL) 17#define VTIMER_MAX_SLICE (0x7ffffffffffff000LL)
@@ -43,4 +45,6 @@ extern void add_virt_timer_periodic(void *new);
43extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires); 45extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires);
44extern int del_virt_timer(struct vtimer_list *timer); 46extern int del_virt_timer(struct vtimer_list *timer);
45 47
46#endif 48#endif /* __KERNEL__ */
49
50#endif /* _ASM_S390_TIMER_H */
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 2861cdc243ad..29a9f357eb9e 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -279,8 +279,24 @@
279#define __NR_inotify_init 284 279#define __NR_inotify_init 284
280#define __NR_inotify_add_watch 285 280#define __NR_inotify_add_watch 285
281#define __NR_inotify_rm_watch 286 281#define __NR_inotify_rm_watch 286
282/* Number 287 is reserved for new sys_migrate_pages */
283#define __NR_openat 288
284#define __NR_mkdirat 289
285#define __NR_mknodat 290
286#define __NR_fchownat 291
287#define __NR_futimesat 292
288#define __NR_newfstatat 293
289#define __NR_unlinkat 294
290#define __NR_renameat 295
291#define __NR_linkat 296
292#define __NR_symlinkat 297
293#define __NR_readlinkat 298
294#define __NR_fchmodat 299
295#define __NR_faccessat 300
296#define __NR_pselect6 301
297#define __NR_ppoll 302
282 298
283#define NR_syscalls 287 299#define NR_syscalls 303
284 300
285/* 301/*
286 * There are some system calls that are not present on 64 bit, some 302 * There are some system calls that are not present on 64 bit, some
@@ -539,11 +555,15 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
539#define __ARCH_WANT_SYS_SIGPENDING 555#define __ARCH_WANT_SYS_SIGPENDING
540#define __ARCH_WANT_SYS_SIGPROCMASK 556#define __ARCH_WANT_SYS_SIGPROCMASK
541#define __ARCH_WANT_SYS_RT_SIGACTION 557#define __ARCH_WANT_SYS_RT_SIGACTION
558#define __ARCH_WANT_SYS_RT_SIGSUSPEND
542# ifndef CONFIG_64BIT 559# ifndef CONFIG_64BIT
543# define __ARCH_WANT_STAT64 560# define __ARCH_WANT_STAT64
544# define __ARCH_WANT_SYS_TIME 561# define __ARCH_WANT_SYS_TIME
545# endif 562# endif
546# define __ARCH_WANT_COMPAT_SYS_TIME 563# ifdef CONFIG_COMPAT
564# define __ARCH_WANT_COMPAT_SYS_TIME
565# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
566# endif
547#endif 567#endif
548 568
549#ifdef __KERNEL_SYSCALLS__ 569#ifdef __KERNEL_SYSCALLS__
diff --git a/include/asm-sh/bus-sh.h b/include/asm-sh/bus-sh.h
deleted file mode 100644
index e42d63b65cb5..000000000000
--- a/include/asm-sh/bus-sh.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * include/asm-sh/bus-sh.h
3 *
4 * Copyright (C) 2004 Paul Mundt
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_SH_BUS_SH_H
11#define __ASM_SH_BUS_SH_H
12
13extern struct bus_type sh_bus_types[];
14
15struct sh_dev {
16 struct device dev;
17 char *name;
18 unsigned int dev_id;
19 unsigned int bus_id;
20 struct resource res;
21 void *mapbase;
22 unsigned int irq[6];
23 u64 *dma_mask;
24 u64 coherent_dma_mask;
25};
26
27#define to_sh_dev(d) container_of((d), struct sh_dev, dev)
28
29#define sh_get_drvdata(d) dev_get_drvdata(&(d)->dev)
30#define sh_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p))
31
32struct sh_driver {
33 struct device_driver drv;
34 unsigned int dev_id;
35 unsigned int bus_id;
36 int (*probe)(struct sh_dev *);
37 int (*remove)(struct sh_dev *);
38 int (*suspend)(struct sh_dev *, pm_message_t);
39 int (*resume)(struct sh_dev *);
40};
41
42#define to_sh_driver(d) container_of((d), struct sh_driver, drv)
43#define sh_name(d) ((d)->dev.driver->name)
44
45/*
46 * Device ID numbers for bus types
47 */
48enum {
49 SH_DEV_ID_USB_OHCI,
50};
51
52#define SH_NR_BUSES 1
53#define SH_BUS_NAME_VIRT "shbus"
54
55enum {
56 SH_BUS_VIRT,
57};
58
59/* arch/sh/kernel/cpu/bus.c */
60extern int sh_device_register(struct sh_dev *dev);
61extern void sh_device_unregister(struct sh_dev *dev);
62extern int sh_driver_register(struct sh_driver *drv);
63extern void sh_driver_unregister(struct sh_driver *drv);
64
65#endif /* __ASM_SH_BUS_SH_H */
66
diff --git a/include/asm-sh/cpu-sh3/mmu_context.h b/include/asm-sh/cpu-sh3/mmu_context.h
index 5cfaa6bcf1ed..a844ea0965b6 100644
--- a/include/asm-sh/cpu-sh3/mmu_context.h
+++ b/include/asm-sh/cpu-sh3/mmu_context.h
@@ -24,5 +24,15 @@
24#define MMU_NTLB_WAYS 4 24#define MMU_NTLB_WAYS 4
25#define MMU_CONTROL_INIT 0x007 /* SV=0, TF=1, IX=1, AT=1 */ 25#define MMU_CONTROL_INIT 0x007 /* SV=0, TF=1, IX=1, AT=1 */
26 26
27#define TRA 0xffffffd0
28#define EXPEVT 0xffffffd4
29
30#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
31 defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
32#define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */
33#else
34#define INTEVT 0xffffffd8
35#endif
36
27#endif /* __ASM_CPU_SH3_MMU_CONTEXT_H */ 37#endif /* __ASM_CPU_SH3_MMU_CONTEXT_H */
28 38
diff --git a/include/asm-sh/cpu-sh4/mmu_context.h b/include/asm-sh/cpu-sh4/mmu_context.h
index 5b64d041f0b9..ff4c5fbbfaf0 100644
--- a/include/asm-sh/cpu-sh4/mmu_context.h
+++ b/include/asm-sh/cpu-sh4/mmu_context.h
@@ -23,7 +23,11 @@
23#define MMU_PAGE_ASSOC_BIT 0x80 23#define MMU_PAGE_ASSOC_BIT 0x80
24 24
25#define MMU_NTLB_ENTRIES 64 /* for 7750 */ 25#define MMU_NTLB_ENTRIES 64 /* for 7750 */
26#ifdef CONFIG_SH_STORE_QUEUES
27#define MMU_CONTROL_INIT 0x05 /* SQMD=0, SV=0, TI=1, AT=1 */
28#else
26#define MMU_CONTROL_INIT 0x205 /* SQMD=1, SV=0, TI=1, AT=1 */ 29#define MMU_CONTROL_INIT 0x205 /* SQMD=1, SV=0, TI=1, AT=1 */
30#endif
27 31
28#define MMU_ITLB_DATA_ARRAY 0xF3000000 32#define MMU_ITLB_DATA_ARRAY 0xF3000000
29#define MMU_UTLB_DATA_ARRAY 0xF7000000 33#define MMU_UTLB_DATA_ARRAY 0xF7000000
@@ -35,5 +39,9 @@
35#define MMU_I_ENTRY_SHIFT 8 39#define MMU_I_ENTRY_SHIFT 8
36#define MMU_ITLB_VALID 0x100 40#define MMU_ITLB_VALID 0x100
37 41
42#define TRA 0xff000020
43#define EXPEVT 0xff000024
44#define INTEVT 0xff000028
45
38#endif /* __ASM_CPU_SH4_MMU_CONTEXT_H */ 46#endif /* __ASM_CPU_SH4_MMU_CONTEXT_H */
39 47
diff --git a/include/asm-sh/ioctls.h b/include/asm-sh/ioctls.h
index 1866f3f90028..9d84a2d445a2 100644
--- a/include/asm-sh/ioctls.h
+++ b/include/asm-sh/ioctls.h
@@ -94,6 +94,6 @@
94#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* 0x545B */ /* Set multiport config */ 94#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* 0x545B */ /* Set multiport config */
95 95
96#define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */ 96#define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */
97#define TIOCGICOUNT _IOR('T', 93, struct async_icount) /* 0x545D */ /* read serial port inline interrupt counts */ 97#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
98 98
99#endif /* __ASM_SH_IOCTLS_H */ 99#endif /* __ASM_SH_IOCTLS_H */
diff --git a/include/asm-sh/irq-sh73180.h b/include/asm-sh/irq-sh73180.h
index bf2e4310ffac..d705252be260 100644
--- a/include/asm-sh/irq-sh73180.h
+++ b/include/asm-sh/irq-sh73180.h
@@ -25,11 +25,6 @@
25#undef DMA_IPR_POS 25#undef DMA_IPR_POS
26#undef DMA_PRIORITY 26#undef DMA_PRIORITY
27 27
28#undef NR_IRQS
29
30#undef __irq_demux
31#undef irq_demux
32
33#undef INTC_IMCR0 28#undef INTC_IMCR0
34#undef INTC_IMCR1 29#undef INTC_IMCR1
35#undef INTC_IMCR2 30#undef INTC_IMCR2
@@ -229,33 +224,6 @@
229#define SIU_IPR_POS 1 224#define SIU_IPR_POS 1
230#define SIU_PRIORITY 3 225#define SIU_PRIORITY 3
231 226
232
233/* ONCHIP_NR_IRQS */
234#define NR_IRQS 109
235
236/* In a generic kernel, NR_IRQS is an upper bound, and we should use
237 * ACTUAL_NR_IRQS (which uses the machine vector) to get the correct value.
238 */
239#define ACTUAL_NR_IRQS NR_IRQS
240
241
242extern void disable_irq(unsigned int);
243extern void disable_irq_nosync(unsigned int);
244extern void enable_irq(unsigned int);
245
246/*
247 * Simple Mask Register Support
248 */
249extern void make_maskreg_irq(unsigned int irq);
250extern unsigned short *irq_mask_register;
251
252/*
253 * Function for "on chip support modules".
254 */
255extern void make_ipr_irq(unsigned int irq, unsigned int addr,
256 int pos, int priority);
257extern void make_imask_irq(unsigned int irq);
258
259#define PORT_PACR 0xA4050100UL 227#define PORT_PACR 0xA4050100UL
260#define PORT_PBCR 0xA4050102UL 228#define PORT_PBCR 0xA4050102UL
261#define PORT_PCCR 0xA4050104UL 229#define PORT_PCCR 0xA4050104UL
@@ -343,8 +311,6 @@ extern void make_imask_irq(unsigned int irq);
343#define IRQ6_PRIORITY 1 311#define IRQ6_PRIORITY 1
344#define IRQ7_PRIORITY 1 312#define IRQ7_PRIORITY 1
345 313
346extern int shmse_irq_demux(int irq); 314int shmse_irq_demux(int irq);
347#define __irq_demux(irq) shmse_irq_demux(irq)
348#define irq_demux(irq) __irq_demux(irq)
349 315
350#endif /* __ASM_SH_IRQ_SH73180_H */ 316#endif /* __ASM_SH_IRQ_SH73180_H */
diff --git a/include/asm-sh/irq-sh7780.h b/include/asm-sh/irq-sh7780.h
index 8c8ca1281084..7f90315cd830 100644
--- a/include/asm-sh/irq-sh7780.h
+++ b/include/asm-sh/irq-sh7780.h
@@ -299,29 +299,6 @@
299#define GPIO_IPR_POS 2 299#define GPIO_IPR_POS 2
300#define GPIO_PRIORITY 3 300#define GPIO_PRIORITY 3
301 301
302/* ONCHIP_NR_IRQS */
303#define NR_IRQS 150 /* 111 + 16 */
304
305/* In a generic kernel, NR_IRQS is an upper bound, and we should use
306 * ACTUAL_NR_IRQS (which uses the machine vector) to get the correct value.
307 */
308#define ACTUAL_NR_IRQS NR_IRQS
309
310extern void disable_irq(unsigned int);
311extern void disable_irq_nosync(unsigned int);
312extern void enable_irq(unsigned int);
313
314/*
315 * Simple Mask Register Support
316 */
317extern void make_maskreg_irq(unsigned int irq);
318extern unsigned short *irq_mask_register;
319
320/*
321 * Function for "on chip support modules".
322 */
323extern void make_imask_irq(unsigned int irq);
324
325#define INTC_TMU0_MSK 0 302#define INTC_TMU0_MSK 0
326#define INTC_TMU3_MSK 1 303#define INTC_TMU3_MSK 1
327#define INTC_RTC_MSK 2 304#define INTC_RTC_MSK 2
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index 060ec3c27207..42b8394c04ed 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -245,6 +245,7 @@
245#endif /* ST40STB1 */ 245#endif /* ST40STB1 */
246 246
247#endif /* 775x / SH4-202 / ST40STB1 */ 247#endif /* 775x / SH4-202 / ST40STB1 */
248#endif /* 7780 */
248 249
249/* NR_IRQS is made from three components: 250/* NR_IRQS is made from three components:
250 * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules 251 * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules
@@ -274,8 +275,11 @@
274# define ONCHIP_NR_IRQS 72 275# define ONCHIP_NR_IRQS 72
275#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) 276#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
276# define ONCHIP_NR_IRQS 144 277# define ONCHIP_NR_IRQS 144
277#elif defined(CONFIG_CPU_SUBTYPE_SH7300) 278#elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \
279 defined(CONFIG_CPU_SUBTYPE_SH73180)
278# define ONCHIP_NR_IRQS 109 280# define ONCHIP_NR_IRQS 109
281#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
282# define ONCHIP_NR_IRQS 111
279#elif defined(CONFIG_SH_UNKNOWN) /* Most be last */ 283#elif defined(CONFIG_SH_UNKNOWN) /* Most be last */
280# define ONCHIP_NR_IRQS 144 284# define ONCHIP_NR_IRQS 144
281#endif 285#endif
@@ -306,6 +310,8 @@
306# define OFFCHIP_NR_IRQS 96 310# define OFFCHIP_NR_IRQS 96
307#elif defined (CONFIG_SH_TITAN) 311#elif defined (CONFIG_SH_TITAN)
308# define OFFCHIP_NR_IRQS 4 312# define OFFCHIP_NR_IRQS 4
313#elif defined(CONFIG_SH_R7780RP)
314# define OFFCHIP_NR_IRQS 16
309#elif defined(CONFIG_SH_UNKNOWN) 315#elif defined(CONFIG_SH_UNKNOWN)
310# define OFFCHIP_NR_IRQS 16 /* Must also be last */ 316# define OFFCHIP_NR_IRQS 16 /* Must also be last */
311#else 317#else
@@ -550,7 +556,7 @@ extern int ipr_irq_demux(int irq);
550#define INTC_ICR_IRLM (1<<7) 556#define INTC_ICR_IRLM (1<<7)
551#endif 557#endif
552 558
553#else 559#ifdef CONFIG_CPU_SUBTYPE_SH7780
554#include <asm/irq-sh7780.h> 560#include <asm/irq-sh7780.h>
555#endif 561#endif
556 562
diff --git a/include/asm-sh/microdev/irq.h b/include/asm-sh/microdev.h
index 47f6f77a65f0..018332a9e590 100644
--- a/include/asm-sh/microdev/irq.h
+++ b/include/asm-sh/microdev.h
@@ -1,32 +1,27 @@
1/* 1/*
2 * linux/include/asm-sh/irq_microdev.h 2 * linux/include/asm-sh/microdev.h
3 * 3 *
4 * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com) 4 * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
5 * 5 *
6 * IRQ functions for the SuperH SH4-202 MicroDev board. 6 * Definitions for the SuperH SH4-202 MicroDev board.
7 * 7 *
8 * May be copied or modified under the terms of the GNU General Public 8 * May be copied or modified under the terms of the GNU General Public
9 * License. See linux/COPYING for more information. 9 * License. See linux/COPYING for more information.
10 *
11 */ 10 */
12 11#ifndef __ASM_SH_MICRODEV_H
13 12#define __ASM_SH_MICRODEV_H
14#ifndef _ASM_SH_IRQ_MICRODEV_H
15#define _ASM_SH_IRQ_MICRODEV_H
16 13
17extern void init_microdev_irq(void); 14extern void init_microdev_irq(void);
18extern void microdev_print_fpga_intc_status(void); 15extern void microdev_print_fpga_intc_status(void);
19 16
20 17/*
21 /* 18 * The following are useful macros for manipulating the interrupt
22 * The following are useful macros for manipulating the 19 * controller (INTC) on the CPU-board FPGA. should be noted that there
23 * interrupt controller (INTC) on the CPU-board FPGA. 20 * is an INTC on the FPGA, and a seperate INTC on the SH4-202 core -
24 * It should be noted that there is an INTC on the FPGA, 21 * these are two different things, both of which need to be prorammed to
25 * and a seperate INTC on the SH4-202 core - these are 22 * correctly route - unfortunately, they have the same name and
26 * two different things, both of which need to be prorammed 23 * abbreviations!
27 * to correctly route - unfortunately, they have the 24 */
28 * same name and abbreviations!
29 */
30#define MICRODEV_FPGA_INTC_BASE 0xa6110000ul /* INTC base address on CPU-board FPGA */ 25#define MICRODEV_FPGA_INTC_BASE 0xa6110000ul /* INTC base address on CPU-board FPGA */
31#define MICRODEV_FPGA_INTENB_REG (MICRODEV_FPGA_INTC_BASE+0ul) /* Interrupt Enable Register on INTC on CPU-board FPGA */ 26#define MICRODEV_FPGA_INTENB_REG (MICRODEV_FPGA_INTC_BASE+0ul) /* Interrupt Enable Register on INTC on CPU-board FPGA */
32#define MICRODEV_FPGA_INTDSB_REG (MICRODEV_FPGA_INTC_BASE+8ul) /* Interrupt Disable Register on INTC on CPU-board FPGA */ 27#define MICRODEV_FPGA_INTDSB_REG (MICRODEV_FPGA_INTC_BASE+8ul) /* Interrupt Disable Register on INTC on CPU-board FPGA */
@@ -38,10 +33,10 @@ extern void microdev_print_fpga_intc_status(void);
38#define MICRODEV_FPGA_INTREQ_REG (MICRODEV_FPGA_INTC_BASE+0x38ul) /* Interrupt Request Register on INTC on CPU-board FPGA */ 33#define MICRODEV_FPGA_INTREQ_REG (MICRODEV_FPGA_INTC_BASE+0x38ul) /* Interrupt Request Register on INTC on CPU-board FPGA */
39 34
40 35
41 /* 36/*
42 * The following are the IRQ numbers for the Linux Kernel for external interrupts. 37 * The following are the IRQ numbers for the Linux Kernel for external
43 * i.e. the numbers seen by 'cat /proc/interrupt'. 38 * interrupts. i.e. the numbers seen by 'cat /proc/interrupt'.
44 */ 39 */
45#define MICRODEV_LINUX_IRQ_KEYBOARD 1 /* SuperIO Keyboard */ 40#define MICRODEV_LINUX_IRQ_KEYBOARD 1 /* SuperIO Keyboard */
46#define MICRODEV_LINUX_IRQ_SERIAL1 2 /* SuperIO Serial #1 */ 41#define MICRODEV_LINUX_IRQ_SERIAL1 2 /* SuperIO Serial #1 */
47#define MICRODEV_LINUX_IRQ_ETHERNET 3 /* on-board Ethnernet */ 42#define MICRODEV_LINUX_IRQ_ETHERNET 3 /* on-board Ethnernet */
@@ -51,10 +46,11 @@ extern void microdev_print_fpga_intc_status(void);
51#define MICRODEV_LINUX_IRQ_IDE2 13 /* SuperIO IDE #2 */ 46#define MICRODEV_LINUX_IRQ_IDE2 13 /* SuperIO IDE #2 */
52#define MICRODEV_LINUX_IRQ_IDE1 14 /* SuperIO IDE #1 */ 47#define MICRODEV_LINUX_IRQ_IDE1 14 /* SuperIO IDE #1 */
53 48
54 /* 49/*
55 * The following are the IRQ numbers for the INTC on the FPGA for external interrupts. 50 * The following are the IRQ numbers for the INTC on the FPGA for
56 * i.e. the bits in the INTC registers in the FPGA. 51 * external interrupts. i.e. the bits in the INTC registers in the
57 */ 52 * FPGA.
53 */
58#define MICRODEV_FPGA_IRQ_KEYBOARD 1 /* SuperIO Keyboard */ 54#define MICRODEV_FPGA_IRQ_KEYBOARD 1 /* SuperIO Keyboard */
59#define MICRODEV_FPGA_IRQ_SERIAL1 3 /* SuperIO Serial #1 */ 55#define MICRODEV_FPGA_IRQ_SERIAL1 3 /* SuperIO Serial #1 */
60#define MICRODEV_FPGA_IRQ_SERIAL2 4 /* SuperIO Serial #2 */ 56#define MICRODEV_FPGA_IRQ_SERIAL2 4 /* SuperIO Serial #2 */
@@ -69,4 +65,16 @@ extern void microdev_print_fpga_intc_status(void);
69#define MICRODEV_IRQ_PCI_INTC 10 65#define MICRODEV_IRQ_PCI_INTC 10
70#define MICRODEV_IRQ_PCI_INTD 11 66#define MICRODEV_IRQ_PCI_INTD 11
71 67
72#endif /* _ASM_SH_IRQ_MICRODEV_H */ 68#define __IO_PREFIX microdev
69#include <asm/io_generic.h>
70
71#if defined(CONFIG_PCI)
72unsigned char microdev_pci_inb(unsigned long port);
73unsigned short microdev_pci_inw(unsigned long port);
74unsigned long microdev_pci_inl(unsigned long port);
75void microdev_pci_outb(unsigned char data, unsigned long port);
76void microdev_pci_outw(unsigned short data, unsigned long port);
77void microdev_pci_outl(unsigned long data, unsigned long port);
78#endif
79
80#endif /* __ASM_SH_MICRODEV_H */
diff --git a/include/asm-sh/microdev/io.h b/include/asm-sh/microdev/io.h
deleted file mode 100644
index f2ca4ac8c88a..000000000000
--- a/include/asm-sh/microdev/io.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * linux/include/asm-sh/io_microdev.h
3 *
4 * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
5 *
6 * IO functions for the SuperH SH4-202 MicroDev board.
7 *
8 * May be copied or modified under the terms of the GNU General Public
9 * License. See linux/COPYING for more information.
10 *
11 */
12
13
14#ifndef _ASM_SH_IO_MICRODEV_H
15#define _ASM_SH_IO_MICRODEV_H
16
17extern unsigned long microdev_isa_port2addr(unsigned long offset);
18
19extern unsigned char microdev_inb(unsigned long port);
20extern unsigned short microdev_inw(unsigned long port);
21extern unsigned int microdev_inl(unsigned long port);
22
23extern void microdev_outb(unsigned char value, unsigned long port);
24extern void microdev_outw(unsigned short value, unsigned long port);
25extern void microdev_outl(unsigned int value, unsigned long port);
26
27extern unsigned char microdev_inb_p(unsigned long port);
28extern unsigned short microdev_inw_p(unsigned long port);
29extern unsigned int microdev_inl_p(unsigned long port);
30
31extern void microdev_outb_p(unsigned char value, unsigned long port);
32extern void microdev_outw_p(unsigned short value, unsigned long port);
33extern void microdev_outl_p(unsigned int value, unsigned long port);
34
35extern void microdev_insb(unsigned long port, void *addr, unsigned long count);
36extern void microdev_insw(unsigned long port, void *addr, unsigned long count);
37extern void microdev_insl(unsigned long port, void *addr, unsigned long count);
38
39extern void microdev_outsb(unsigned long port, const void *addr, unsigned long count);
40extern void microdev_outsw(unsigned long port, const void *addr, unsigned long count);
41extern void microdev_outsl(unsigned long port, const void *addr, unsigned long count);
42
43#if defined(CONFIG_PCI)
44extern unsigned char microdev_pci_inb(unsigned long port);
45extern unsigned short microdev_pci_inw(unsigned long port);
46extern unsigned long microdev_pci_inl(unsigned long port);
47extern void microdev_pci_outb(unsigned char data, unsigned long port);
48extern void microdev_pci_outw(unsigned short data, unsigned long port);
49extern void microdev_pci_outl(unsigned long data, unsigned long port);
50#endif
51
52#endif /* _ASM_SH_IO_MICRODEV_H */
53
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index c4904797d6df..fa5bd2d8803e 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -12,7 +12,6 @@
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/types.h> 13#include <asm/types.h>
14#include <asm/cache.h> 14#include <asm/cache.h>
15#include <linux/threads.h>
16#include <asm/ptrace.h> 15#include <asm/ptrace.h>
17 16
18/* 17/*
@@ -30,7 +29,7 @@
30 * CPU type and hardware bug flags. Kept separately for each CPU. 29 * CPU type and hardware bug flags. Kept separately for each CPU.
31 * 30 *
32 * Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry 31 * Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
33 * in arch/sh/Kconfig, as well as an entry in arch/sh/kernel/setup.c 32 * in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c
34 * for parsing the subtype in get_cpu_subtype(). 33 * for parsing the subtype in get_cpu_subtype().
35 */ 34 */
36enum cpu_type { 35enum cpu_type {
@@ -44,7 +43,7 @@ enum cpu_type {
44 /* SH-4 types */ 43 /* SH-4 types */
45 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, 44 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
46 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, 45 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501,
47 CPU_SH73180, 46 CPU_SH73180, CPU_SH7770, CPU_SH7780, CPU_SH7781,
48 47
49 /* Unknown subtype */ 48 /* Unknown subtype */
50 CPU_SH_NONE 49 CPU_SH_NONE
@@ -52,14 +51,8 @@ enum cpu_type {
52 51
53struct sh_cpuinfo { 52struct sh_cpuinfo {
54 enum cpu_type type; 53 enum cpu_type type;
55 char hard_math;
56 unsigned long loops_per_jiffy; 54 unsigned long loops_per_jiffy;
57 55
58 unsigned int cpu_clock, master_clock, bus_clock, module_clock;
59#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
60 unsigned int memory_clock;
61#endif
62
63 struct cache_info icache; 56 struct cache_info icache;
64 struct cache_info dcache; 57 struct cache_info dcache;
65 58
@@ -131,7 +124,7 @@ union sh_fpu_union {
131 struct sh_fpu_soft_struct soft; 124 struct sh_fpu_soft_struct soft;
132}; 125};
133 126
134/* 127/*
135 * Processor flags 128 * Processor flags
136 */ 129 */
137 130
@@ -140,6 +133,7 @@ union sh_fpu_union {
140#define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */ 133#define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */
141#define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */ 134#define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */
142#define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */ 135#define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */
136#define CPU_HAS_PTEA 0x0020 /* PTEA register */
143 137
144struct thread_struct { 138struct thread_struct {
145 unsigned long sp; 139 unsigned long sp;
@@ -160,10 +154,10 @@ extern int ubc_usercnt;
160#define INIT_THREAD { \ 154#define INIT_THREAD { \
161 sizeof(init_stack) + (long) &init_stack, /* sp */ \ 155 sizeof(init_stack) + (long) &init_stack, /* sp */ \
162 0, /* pc */ \ 156 0, /* pc */ \
163 0, 0, \ 157 0, 0, \
164 0, \ 158 0, \
165 0, \ 159 0, \
166 {{{0,}},} /* fpu state */ \ 160 {{{0,}},} /* fpu state */ \
167} 161}
168 162
169/* 163/*
@@ -171,7 +165,7 @@ extern int ubc_usercnt;
171 */ 165 */
172#define start_thread(regs, new_pc, new_sp) \ 166#define start_thread(regs, new_pc, new_sp) \
173 set_fs(USER_DS); \ 167 set_fs(USER_DS); \
174 regs->pr = 0; \ 168 regs->pr = 0; \
175 regs->sr = SR_FD; /* User mode. */ \ 169 regs->sr = SR_FD; /* User mode. */ \
176 regs->pc = new_pc; \ 170 regs->pc = new_pc; \
177 regs->regs[15] = new_sp 171 regs->regs[15] = new_sp
@@ -239,16 +233,16 @@ extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
239#define save_fpu(tsk) do { } while (0) 233#define save_fpu(tsk) do { } while (0)
240#endif 234#endif
241 235
242#define unlazy_fpu(tsk, regs) do { \ 236#define unlazy_fpu(tsk, regs) do { \
243 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ 237 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \
244 save_fpu(tsk, regs); \ 238 save_fpu(tsk, regs); \
245 } \ 239 } \
246} while (0) 240} while (0)
247 241
248#define clear_fpu(tsk, regs) do { \ 242#define clear_fpu(tsk, regs) do { \
249 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ 243 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \
250 clear_tsk_thread_flag(tsk, TIF_USEDFPU); \ 244 clear_tsk_thread_flag(tsk, TIF_USEDFPU); \
251 release_fpu(regs); \ 245 release_fpu(regs); \
252 } \ 246 } \
253} while (0) 247} while (0)
254 248
diff --git a/include/asm-sh64/ioctls.h b/include/asm-sh64/ioctls.h
index 08f3c1f2e419..6b0c04f63c57 100644
--- a/include/asm-sh64/ioctls.h
+++ b/include/asm-sh64/ioctls.h
@@ -111,6 +111,6 @@
111#define TIOCSERSETMULTI 0x40a8545b /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */ 111#define TIOCSERSETMULTI 0x40a8545b /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */
112 112
113#define TIOCMIWAIT 0x545c /* _IO('T', 92) wait for a change on serial input line(s) */ 113#define TIOCMIWAIT 0x545c /* _IO('T', 92) wait for a change on serial input line(s) */
114#define TIOCGICOUNT 0x802c545d /* _IOR('T', 93, struct async_icount) 0x545D */ /* read serial port inline interrupt counts */ 114#define TIOCGICOUNT 0x545d /* read serial port inline interrupt counts */
115 115
116#endif /* __ASM_SH64_IOCTLS_H */ 116#endif /* __ASM_SH64_IOCTLS_H */
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index ec85d12d73b9..508c416e9d6a 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -131,6 +131,28 @@ static void inline __read_lock(raw_rwlock_t *lock)
131 : "memory"); 131 : "memory");
132} 132}
133 133
134static int inline __read_trylock(raw_rwlock_t *lock)
135{
136 int tmp1, tmp2;
137
138 __asm__ __volatile__ (
139"1: ldsw [%2], %0\n"
140" brlz,a,pn %0, 2f\n"
141" mov 0, %0\n"
142" add %0, 1, %1\n"
143" cas [%2], %0, %1\n"
144" cmp %0, %1\n"
145" membar #StoreLoad | #StoreStore\n"
146" bne,pn %%icc, 1b\n"
147" mov 1, %0\n"
148"2:"
149 : "=&r" (tmp1), "=&r" (tmp2)
150 : "r" (lock)
151 : "memory");
152
153 return tmp1;
154}
155
134static void inline __read_unlock(raw_rwlock_t *lock) 156static void inline __read_unlock(raw_rwlock_t *lock)
135{ 157{
136 unsigned long tmp1, tmp2; 158 unsigned long tmp1, tmp2;
@@ -211,12 +233,12 @@ static int inline __write_trylock(raw_rwlock_t *lock)
211} 233}
212 234
213#define __raw_read_lock(p) __read_lock(p) 235#define __raw_read_lock(p) __read_lock(p)
236#define __raw_read_trylock(p) __read_trylock(p)
214#define __raw_read_unlock(p) __read_unlock(p) 237#define __raw_read_unlock(p) __read_unlock(p)
215#define __raw_write_lock(p) __write_lock(p) 238#define __raw_write_lock(p) __write_lock(p)
216#define __raw_write_unlock(p) __write_unlock(p) 239#define __raw_write_unlock(p) __write_unlock(p)
217#define __raw_write_trylock(p) __write_trylock(p) 240#define __raw_write_trylock(p) __write_trylock(p)
218 241
219#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
220#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) 242#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL))
221#define __raw_write_can_lock(rw) (!(rw)->lock) 243#define __raw_write_can_lock(rw) (!(rw)->lock)
222 244
diff --git a/include/asm-um/ldt-x86_64.h b/include/asm-um/ldt-x86_64.h
index 175722a91164..96b35aada79a 100644
--- a/include/asm-um/ldt-x86_64.h
+++ b/include/asm-um/ldt-x86_64.h
@@ -5,8 +5,8 @@
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> 5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */ 6 */
7 7
8#ifndef __ASM_LDT_I386_H 8#ifndef __ASM_LDT_X86_64_H
9#define __ASM_LDT_I386_H 9#define __ASM_LDT_X86_64_H
10 10
11#include "asm/semaphore.h" 11#include "asm/semaphore.h"
12#include "asm/arch/ldt.h" 12#include "asm/arch/ldt.h"
@@ -39,11 +39,13 @@ typedef struct uml_ldt {
39} uml_ldt_t; 39} uml_ldt_t;
40 40
41/* 41/*
42 * macros stolen from include/asm-i386/desc.h 42 * macros stolen from include/asm-x86_64/desc.h
43 */ 43 */
44#define LDT_entry_a(info) \ 44#define LDT_entry_a(info) \
45 ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) 45 ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
46 46
47/* Don't allow setting of the lm bit. It is useless anyways because
48 * 64bit system calls require __USER_CS. */
47#define LDT_entry_b(info) \ 49#define LDT_entry_b(info) \
48 (((info)->base_addr & 0xff000000) | \ 50 (((info)->base_addr & 0xff000000) | \
49 (((info)->base_addr & 0x00ff0000) >> 16) | \ 51 (((info)->base_addr & 0x00ff0000) >> 16) | \
@@ -54,6 +56,7 @@ typedef struct uml_ldt {
54 ((info)->seg_32bit << 22) | \ 56 ((info)->seg_32bit << 22) | \
55 ((info)->limit_in_pages << 23) | \ 57 ((info)->limit_in_pages << 23) | \
56 ((info)->useable << 20) | \ 58 ((info)->useable << 20) | \
59 /* ((info)->lm << 21) | */ \
57 0x7000) 60 0x7000)
58 61
59#define LDT_empty(info) (\ 62#define LDT_empty(info) (\
@@ -64,6 +67,7 @@ typedef struct uml_ldt {
64 (info)->seg_32bit == 0 && \ 67 (info)->seg_32bit == 0 && \
65 (info)->limit_in_pages == 0 && \ 68 (info)->limit_in_pages == 0 && \
66 (info)->seg_not_present == 1 && \ 69 (info)->seg_not_present == 1 && \
67 (info)->useable == 0 ) 70 (info)->useable == 0 && \
71 (info)->lm == 0)
68 72
69#endif 73#endif
diff --git a/include/asm-um/smp.h b/include/asm-um/smp.h
index d879eba2b52c..aeda6657f366 100644
--- a/include/asm-um/smp.h
+++ b/include/asm-um/smp.h
@@ -23,6 +23,8 @@ extern inline void smp_cpus_done(unsigned int maxcpus)
23{ 23{
24} 24}
25 25
26extern struct task_struct *idle_threads[NR_CPUS];
27
26#endif 28#endif
27 29
28#endif 30#endif
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h
index 8955d2376ac8..609b9e87222a 100644
--- a/include/asm-v850/bitops.h
+++ b/include/asm-v850/bitops.h
@@ -188,7 +188,7 @@ static inline int find_next_zero_bit(const void *addr, int size, int offset)
188 tmp = *p; 188 tmp = *p;
189 189
190 found_first: 190 found_first:
191 tmp |= ~0UL >> size; 191 tmp |= ~0UL << size;
192 found_middle: 192 found_middle:
193 return result + ffz (tmp); 193 return result + ffz (tmp);
194} 194}
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index 4f6a4dc455bb..bdbd8935612a 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -17,6 +17,7 @@
17#define APIC_DEBUG 2 17#define APIC_DEBUG 2
18 18
19extern int apic_verbosity; 19extern int apic_verbosity;
20extern int apic_runs_main_timer;
20 21
21/* 22/*
22 * Define the default level of output to be very little 23 * Define the default level of output to be very little
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h
index 41c0ac8559be..76bb6193ae91 100644
--- a/include/asm-x86_64/cpufeature.h
+++ b/include/asm-x86_64/cpufeature.h
@@ -61,7 +61,7 @@
61#define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */ 61#define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */
62#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ 62#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */
63#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ 63#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */
64/* 4 free */ 64#define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */
65#define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ 65#define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */
66#define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ 66#define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */
67 67
diff --git a/include/asm-x86_64/hardirq.h b/include/asm-x86_64/hardirq.h
index 8661b476fb40..8689951e3503 100644
--- a/include/asm-x86_64/hardirq.h
+++ b/include/asm-x86_64/hardirq.h
@@ -16,23 +16,6 @@
16#define set_softirq_pending(x) write_pda(__softirq_pending, (x)) 16#define set_softirq_pending(x) write_pda(__softirq_pending, (x))
17#define or_softirq_pending(x) or_pda(__softirq_pending, (x)) 17#define or_softirq_pending(x) or_pda(__softirq_pending, (x))
18 18
19/* 19extern void ack_bad_irq(unsigned int irq);
20 * 'what should we do if we get a hw irq event on an illegal vector'. 20
21 * each architecture has to answer this themselves.
22 */
23static inline void ack_bad_irq(unsigned int irq)
24{
25 printk("unexpected IRQ trap at vector %02x\n", irq);
26#ifdef CONFIG_X86_LOCAL_APIC
27 /*
28 * Currently unexpected vectors happen only on SMP and APIC.
29 * We _must_ ack these because every local APIC has only N
30 * irq slots per priority level, and a 'hanging, unacked' IRQ
31 * holds up an irq slot - in excessive cases (when multiple
32 * unexpected vectors occur) that might lock up the APIC
33 * completely.
34 */
35 ack_APIC_irq();
36#endif
37}
38#endif /* __ASM_HARDIRQ_H */ 21#endif /* __ASM_HARDIRQ_H */
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h
index e87cd83a0e86..9afc0c7d3661 100644
--- a/include/asm-x86_64/ia32_unistd.h
+++ b/include/asm-x86_64/ia32_unistd.h
@@ -300,7 +300,7 @@
300#define __NR_ia32_inotify_add_watch 292 300#define __NR_ia32_inotify_add_watch 292
301#define __NR_ia32_inotify_rm_watch 293 301#define __NR_ia32_inotify_rm_watch 293
302#define __NR_ia32_migrate_pages 294 302#define __NR_ia32_migrate_pages 294
303#define __NR_ia32_opanat 295 303#define __NR_ia32_openat 295
304#define __NR_ia32_mkdirat 296 304#define __NR_ia32_mkdirat 296
305#define __NR_ia32_mknodat 297 305#define __NR_ia32_mknodat 297
306#define __NR_ia32_fchownat 298 306#define __NR_ia32_fchownat 298
diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h
index ae28cd44bcd3..c564bae03433 100644
--- a/include/asm-x86_64/kexec.h
+++ b/include/asm-x86_64/kexec.h
@@ -1,8 +1,9 @@
1#ifndef _X86_64_KEXEC_H 1#ifndef _X86_64_KEXEC_H
2#define _X86_64_KEXEC_H 2#define _X86_64_KEXEC_H
3 3
4#include <linux/string.h>
5
4#include <asm/page.h> 6#include <asm/page.h>
5#include <asm/proto.h>
6#include <asm/ptrace.h> 7#include <asm/ptrace.h>
7 8
8/* 9/*
diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h
index 10248a9a0582..14fc3ddd9031 100644
--- a/include/asm-x86_64/mpspec.h
+++ b/include/asm-x86_64/mpspec.h
@@ -188,7 +188,7 @@ extern void mp_register_lapic_address (u64 address);
188extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base); 188extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);
189extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi); 189extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi);
190extern void mp_config_acpi_legacy_irqs (void); 190extern void mp_config_acpi_legacy_irqs (void);
191extern int mp_register_gsi (u32 gsi, int edge_level, int active_high_low); 191extern int mp_register_gsi (u32 gsi, int triggering, int polarity);
192#endif /*CONFIG_X86_IO_APIC*/ 192#endif /*CONFIG_X86_IO_APIC*/
193#endif 193#endif
194 194
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index 115e496c6139..c99832e7bf3f 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -41,10 +41,18 @@ extern void iommu_hole_init(void);
41 41
42extern void time_init_gtod(void); 42extern void time_init_gtod(void);
43extern int pmtimer_mark_offset(void); 43extern int pmtimer_mark_offset(void);
44extern void pmtimer_resume(void);
45extern void pmtimer_wait(unsigned);
44extern unsigned int do_gettimeoffset_pm(void); 46extern unsigned int do_gettimeoffset_pm(void);
47#ifdef CONFIG_X86_PM_TIMER
45extern u32 pmtmr_ioport; 48extern u32 pmtmr_ioport;
49#else
50#define pmtmr_ioport 0
51#endif
46extern unsigned long long monotonic_base; 52extern unsigned long long monotonic_base;
47extern int sysctl_vsyscall; 53extern int sysctl_vsyscall;
54extern int nohpet;
55extern unsigned long vxtime_hz;
48 56
49extern void do_softirq_thunk(void); 57extern void do_softirq_thunk(void);
50 58
@@ -65,6 +73,9 @@ extern void free_bootmem_generic(unsigned long phys, unsigned len);
65 73
66extern void load_gs_index(unsigned gs); 74extern void load_gs_index(unsigned gs);
67 75
76extern void stop_timer_interrupt(void);
77extern void main_timer_handler(struct pt_regs *regs);
78
68extern unsigned long end_pfn_map; 79extern unsigned long end_pfn_map;
69 80
70extern void show_trace(unsigned long * rsp); 81extern void show_trace(unsigned long * rsp);
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index a73f0c789d8b..b7f66034ae7a 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -327,7 +327,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
327#define wmb() asm volatile("" ::: "memory") 327#define wmb() asm volatile("" ::: "memory")
328#endif 328#endif
329#define read_barrier_depends() do {} while(0) 329#define read_barrier_depends() do {} while(0)
330#define set_mb(var, value) do { xchg(&var, value); } while (0) 330#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
331#define set_wmb(var, value) do { var = value; wmb(); } while (0) 331#define set_wmb(var, value) do { var = value; wmb(); } while (0)
332 332
333#define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) 333#define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0)
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 2fa7f27381b4..c642f5d9882d 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -57,6 +57,15 @@ extern int __node_distance(int, int);
57 57
58#endif 58#endif
59 59
60#ifdef CONFIG_SMP
61#define topology_physical_package_id(cpu) \
62 (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu])
63#define topology_core_id(cpu) \
64 (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu])
65#define topology_core_siblings(cpu) (cpu_core_map[cpu])
66#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
67#endif
68
60#include <asm-generic/topology.h> 69#include <asm-generic/topology.h>
61 70
62#endif 71#endif
diff --git a/include/asm-xtensa/futex.h b/include/asm-xtensa/futex.h
new file mode 100644
index 000000000000..0b745828f42b
--- /dev/null
+++ b/include/asm-xtensa/futex.h
@@ -0,0 +1 @@
#include <asm-generic/futex.h>
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 026c3c011dc0..84d3d9f034ce 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -435,7 +435,7 @@ extern int sbf_port ;
435 435
436#endif /* !CONFIG_ACPI */ 436#endif /* !CONFIG_ACPI */
437 437
438int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); 438int acpi_register_gsi (u32 gsi, int triggering, int polarity);
439int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 439int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
440 440
441/* 441/*
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
index 17a17c55a17f..6d59c8efe3be 100644
--- a/include/linux/agpgart.h
+++ b/include/linux/agpgart.h
@@ -111,6 +111,7 @@ typedef struct _agp_unbind {
111} agp_unbind; 111} agp_unbind;
112 112
113#else /* __KERNEL__ */ 113#else /* __KERNEL__ */
114#include <linux/mutex.h>
114 115
115#define AGPGART_MINOR 175 116#define AGPGART_MINOR 175
116 117
@@ -201,7 +202,7 @@ struct agp_file_private {
201}; 202};
202 203
203struct agp_front_data { 204struct agp_front_data {
204 struct semaphore agp_mutex; 205 struct mutex agp_mutex;
205 struct agp_controller *current_controller; 206 struct agp_controller *current_controller;
206 struct agp_controller *controllers; 207 struct agp_controller *controllers;
207 struct agp_file_private *file_priv_list; 208 struct agp_file_private *file_priv_list;
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 6a2a19f14bb2..208650b1ad3a 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -81,7 +81,7 @@ static inline int generic_fls64(__u64 x)
81{ 81{
82 __u32 h = x >> 32; 82 __u32 h = x >> 32;
83 if (h) 83 if (h)
84 return fls(x) + 32; 84 return fls(h) + 32;
85 return fls(x); 85 return fls(x);
86} 86}
87 87
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 02a585faa62c..860e7a485a5f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -392,8 +392,8 @@ struct request_queue
392 unsigned int nr_congestion_off; 392 unsigned int nr_congestion_off;
393 unsigned int nr_batching; 393 unsigned int nr_batching;
394 394
395 unsigned short max_sectors; 395 unsigned int max_sectors;
396 unsigned short max_hw_sectors; 396 unsigned int max_hw_sectors;
397 unsigned short max_phys_segments; 397 unsigned short max_phys_segments;
398 unsigned short max_hw_segments; 398 unsigned short max_hw_segments;
399 unsigned short hardsect_size; 399 unsigned short hardsect_size;
@@ -697,7 +697,7 @@ extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *);
697extern void blk_cleanup_queue(request_queue_t *); 697extern void blk_cleanup_queue(request_queue_t *);
698extern void blk_queue_make_request(request_queue_t *, make_request_fn *); 698extern void blk_queue_make_request(request_queue_t *, make_request_fn *);
699extern void blk_queue_bounce_limit(request_queue_t *, u64); 699extern void blk_queue_bounce_limit(request_queue_t *, u64);
700extern void blk_queue_max_sectors(request_queue_t *, unsigned short); 700extern void blk_queue_max_sectors(request_queue_t *, unsigned int);
701extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); 701extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short);
702extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); 702extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short);
703extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); 703extern void blk_queue_max_segment_size(request_queue_t *, unsigned int);
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index acffb8c9073a..a7f015027535 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -126,7 +126,7 @@ extern struct config_item *config_group_find_obj(struct config_group *, const ch
126 126
127 127
128struct configfs_attribute { 128struct configfs_attribute {
129 char *ca_name; 129 const char *ca_name;
130 struct module *ca_owner; 130 struct module *ca_owner;
131 mode_t ca_mode; 131 mode_t ca_mode;
132}; 132};
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c31650df9241..17866d7e2b71 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -14,6 +14,7 @@
14#ifndef _LINUX_CPUFREQ_H 14#ifndef _LINUX_CPUFREQ_H
15#define _LINUX_CPUFREQ_H 15#define _LINUX_CPUFREQ_H
16 16
17#include <linux/mutex.h>
17#include <linux/config.h> 18#include <linux/config.h>
18#include <linux/notifier.h> 19#include <linux/notifier.h>
19#include <linux/threads.h> 20#include <linux/threads.h>
@@ -82,7 +83,7 @@ struct cpufreq_policy {
82 unsigned int policy; /* see above */ 83 unsigned int policy; /* see above */
83 struct cpufreq_governor *governor; /* see below */ 84 struct cpufreq_governor *governor; /* see below */
84 85
85 struct semaphore lock; /* CPU ->setpolicy or ->target may 86 struct mutex lock; /* CPU ->setpolicy or ->target may
86 only be called once a time */ 87 only be called once a time */
87 88
88 struct work_struct update; /* if update_policy() needs to be 89 struct work_struct update; /* if update_policy() needs to be
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index a3ed5e059d47..a3f09947940e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -108,7 +108,9 @@ struct dentry {
108 struct dentry_operations *d_op; 108 struct dentry_operations *d_op;
109 struct super_block *d_sb; /* The root of the dentry tree */ 109 struct super_block *d_sb; /* The root of the dentry tree */
110 void *d_fsdata; /* fs-specific data */ 110 void *d_fsdata; /* fs-specific data */
111#ifdef CONFIG_PROFILING
111 struct dcookie_struct *d_cookie; /* cookie, if any */ 112 struct dcookie_struct *d_cookie; /* cookie, if any */
113#endif
112 int d_mounted; 114 int d_mounted;
113 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ 115 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
114}; 116};
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 83c7d207b80e..51e0e95a421a 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -91,7 +91,7 @@ struct target_type {
91}; 91};
92 92
93struct io_restrictions { 93struct io_restrictions {
94 unsigned short max_sectors; 94 unsigned int max_sectors;
95 unsigned short max_phys_segments; 95 unsigned short max_phys_segments;
96 unsigned short max_hw_segments; 96 unsigned short max_hw_segments;
97 unsigned short hardsect_size; 97 unsigned short hardsect_size;
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index dbd7bb4a33b7..0cf0bea010fe 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -5,6 +5,7 @@
5#include <linux/signal.h> 5#include <linux/signal.h>
6#include <linux/time.h> 6#include <linux/time.h>
7#include <linux/user.h> 7#include <linux/user.h>
8#include <linux/ptrace.h>
8 9
9struct elf_siginfo 10struct elf_siginfo
10{ 11{
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 84bb449b9b01..e059da947007 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -363,6 +363,8 @@ struct address_space_operations {
363 loff_t offset, unsigned long nr_segs); 363 loff_t offset, unsigned long nr_segs);
364 struct page* (*get_xip_page)(struct address_space *, sector_t, 364 struct page* (*get_xip_page)(struct address_space *, sector_t,
365 int); 365 int);
366 /* migrate the contents of a page to the specified target */
367 int (*migratepage) (struct page *, struct page *);
366}; 368};
367 369
368struct backing_dev_info; 370struct backing_dev_info;
@@ -1719,6 +1721,12 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
1719 1721
1720extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); 1722extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
1721 1723
1724#ifdef CONFIG_MIGRATION
1725extern int buffer_migrate_page(struct page *, struct page *);
1726#else
1727#define buffer_migrate_page NULL
1728#endif
1729
1722extern int inode_change_ok(struct inode *, struct iattr *); 1730extern int inode_change_ok(struct inode *, struct iattr *);
1723extern int __must_check inode_setattr(struct inode *, struct iattr *); 1731extern int __must_check inode_setattr(struct inode *, struct iattr *);
1724 1732
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 528959c52f1b..5425b60021e3 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -14,7 +14,7 @@
14#define FUSE_KERNEL_VERSION 7 14#define FUSE_KERNEL_VERSION 7
15 15
16/** Minor version number of this interface */ 16/** Minor version number of this interface */
17#define FUSE_KERNEL_MINOR_VERSION 5 17#define FUSE_KERNEL_MINOR_VERSION 6
18 18
19/** The node ID of the root inode */ 19/** The node ID of the root inode */
20#define FUSE_ROOT_ID 1 20#define FUSE_ROOT_ID 1
@@ -58,6 +58,9 @@ struct fuse_kstatfs {
58 __u32 spare[6]; 58 __u32 spare[6];
59}; 59};
60 60
61/**
62 * Bitmasks for fuse_setattr_in.valid
63 */
61#define FATTR_MODE (1 << 0) 64#define FATTR_MODE (1 << 0)
62#define FATTR_UID (1 << 1) 65#define FATTR_UID (1 << 1)
63#define FATTR_GID (1 << 2) 66#define FATTR_GID (1 << 2)
@@ -75,6 +78,11 @@ struct fuse_kstatfs {
75#define FOPEN_DIRECT_IO (1 << 0) 78#define FOPEN_DIRECT_IO (1 << 0)
76#define FOPEN_KEEP_CACHE (1 << 1) 79#define FOPEN_KEEP_CACHE (1 << 1)
77 80
81/**
82 * INIT request/reply flags
83 */
84#define FUSE_ASYNC_READ (1 << 0)
85
78enum fuse_opcode { 86enum fuse_opcode {
79 FUSE_LOOKUP = 1, 87 FUSE_LOOKUP = 1,
80 FUSE_FORGET = 2, /* no reply */ 88 FUSE_FORGET = 2, /* no reply */
@@ -247,12 +255,16 @@ struct fuse_access_in {
247struct fuse_init_in { 255struct fuse_init_in {
248 __u32 major; 256 __u32 major;
249 __u32 minor; 257 __u32 minor;
258 __u32 max_readahead;
259 __u32 flags;
250}; 260};
251 261
252struct fuse_init_out { 262struct fuse_init_out {
253 __u32 major; 263 __u32 major;
254 __u32 minor; 264 __u32 minor;
255 __u32 unused[3]; 265 __u32 max_readahead;
266 __u32 flags;
267 __u32 unused;
256 __u32 max_write; 268 __u32 max_write;
257}; 269};
258 270
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 089bfb1fa01a..6361544bb6ae 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -40,6 +40,7 @@ enum hrtimer_restart {
40enum hrtimer_state { 40enum hrtimer_state {
41 HRTIMER_INACTIVE, /* Timer is inactive */ 41 HRTIMER_INACTIVE, /* Timer is inactive */
42 HRTIMER_EXPIRED, /* Timer is expired */ 42 HRTIMER_EXPIRED, /* Timer is expired */
43 HRTIMER_RUNNING, /* Timer is running the callback function */
43 HRTIMER_PENDING, /* Timer is pending */ 44 HRTIMER_PENDING, /* Timer is pending */
44}; 45};
45 46
@@ -100,9 +101,8 @@ struct hrtimer_base {
100/* Exported timer functions: */ 101/* Exported timer functions: */
101 102
102/* Initialize timers: */ 103/* Initialize timers: */
103extern void hrtimer_init(struct hrtimer *timer, const clockid_t which_clock); 104extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
104extern void hrtimer_rebase(struct hrtimer *timer, const clockid_t which_clock); 105 enum hrtimer_mode mode);
105
106 106
107/* Basic timer operations: */ 107/* Basic timer operations: */
108extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, 108extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 9ba806796667..5a9d8c599171 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -1115,9 +1115,11 @@ static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c)
1115 return ERR_PTR(-ENOMEM); 1115 return ERR_PTR(-ENOMEM);
1116 1116
1117 mmsg->mfa = readl(c->in_port); 1117 mmsg->mfa = readl(c->in_port);
1118 if (mmsg->mfa == I2O_QUEUE_EMPTY) { 1118 if (unlikely(mmsg->mfa >= c->in_queue.len)) {
1119 mempool_free(mmsg, c->in_msg.mempool); 1119 mempool_free(mmsg, c->in_msg.mempool);
1120 return ERR_PTR(-EBUSY); 1120 if(mmsg->mfa == I2O_QUEUE_EMPTY)
1121 return ERR_PTR(-EBUSY);
1122 return ERR_PTR(-EFAULT);
1121 } 1123 }
1122 1124
1123 return &mmsg->msg; 1125 return &mmsg->msg;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 110b3cfac021..a7fc4cc79b23 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -582,7 +582,6 @@ typedef struct ide_drive_s {
582 unsigned noprobe : 1; /* from: hdx=noprobe */ 582 unsigned noprobe : 1; /* from: hdx=noprobe */
583 unsigned removable : 1; /* 1 if need to do check_media_change */ 583 unsigned removable : 1; /* 1 if need to do check_media_change */
584 unsigned attach : 1; /* needed for removable devices */ 584 unsigned attach : 1; /* needed for removable devices */
585 unsigned is_flash : 1; /* 1 if probed as flash */
586 unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */ 585 unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */
587 unsigned no_unmask : 1; /* disallow setting unmask bit */ 586 unsigned no_unmask : 1; /* disallow setting unmask bit */
588 unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ 587 unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */
@@ -1006,7 +1005,6 @@ extern ide_hwif_t ide_hwifs[]; /* master data repository */
1006extern int noautodma; 1005extern int noautodma;
1007 1006
1008extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); 1007extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs);
1009extern int __ide_end_request (ide_drive_t *drive, struct request *rq, int uptodate, int nrsecs);
1010 1008
1011/* 1009/*
1012 * This is used on exit from the driver to designate the next irq handler 1010 * This is used on exit from the driver to designate the next irq handler
diff --git a/include/linux/io.h b/include/linux/io.h
new file mode 100644
index 000000000000..85533ec5aaa1
--- /dev/null
+++ b/include/linux/io.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright 2006 PathScale, Inc. All Rights Reserved.
3 *
4 * This file is free software; you can redistribute it and/or modify
5 * it under the terms of version 2 of the GNU General Public License
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
16 */
17
18#ifndef _LINUX_IO_H
19#define _LINUX_IO_H
20
21#include <asm/io.h>
22
23void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
24
25#endif /* _LINUX_IO_H */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 558cb4c26ec9..751bb3849467 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -23,6 +23,7 @@
23#define jfs_debug jbd_debug 23#define jfs_debug jbd_debug
24#else 24#else
25 25
26#include <linux/types.h>
26#include <linux/buffer_head.h> 27#include <linux/buffer_head.h>
27#include <linux/journal-head.h> 28#include <linux/journal-head.h>
28#include <linux/stddef.h> 29#include <linux/stddef.h>
@@ -618,6 +619,7 @@ struct transaction_s
618 * @j_wbuf: array of buffer_heads for journal_commit_transaction 619 * @j_wbuf: array of buffer_heads for journal_commit_transaction
619 * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the 620 * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the
620 * number that will fit in j_blocksize 621 * number that will fit in j_blocksize
622 * @j_last_sync_writer: most recent pid which did a synchronous write
621 * @j_private: An opaque pointer to fs-private information. 623 * @j_private: An opaque pointer to fs-private information.
622 */ 624 */
623 625
@@ -807,6 +809,8 @@ struct journal_s
807 struct buffer_head **j_wbuf; 809 struct buffer_head **j_wbuf;
808 int j_wbufsize; 810 int j_wbufsize;
809 811
812 pid_t j_last_sync_writer;
813
810 /* 814 /*
811 * An opaque pointer to fs-private information. ext3 puts its 815 * An opaque pointer to fs-private information. ext3 puts its
812 * superblock pointer here 816 * superblock pointer here
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 45f625d7d0b2..3aed37314ab8 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -151,6 +151,11 @@ extern unsigned int keymap_count;
151 151
152static inline void con_schedule_flip(struct tty_struct *t) 152static inline void con_schedule_flip(struct tty_struct *t)
153{ 153{
154 unsigned long flags;
155 spin_lock_irqsave(&t->buf.lock, flags);
156 if (t->buf.tail != NULL)
157 t->buf.tail->active = 0;
158 spin_unlock_irqrestore(&t->buf.lock, flags);
154 schedule_work(&t->buf.work); 159 schedule_work(&t->buf.work);
155} 160}
156 161
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index a5363324cf95..b49affa0ac5a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -185,6 +185,7 @@ extern enum system_states {
185 SYSTEM_HALT, 185 SYSTEM_HALT,
186 SYSTEM_POWER_OFF, 186 SYSTEM_POWER_OFF,
187 SYSTEM_RESTART, 187 SYSTEM_RESTART,
188 SYSTEM_SUSPEND_DISK,
188} system_state; 189} system_state;
189 190
190#define TAINT_PROPRIETARY_MODULE (1<<0) 191#define TAINT_PROPRIETARY_MODULE (1<<0)
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 1bd6552cc341..6aca67a569a2 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -10,6 +10,12 @@
10 * 10 *
11 * Started by: Thomas Gleixner and Ingo Molnar 11 * Started by: Thomas Gleixner and Ingo Molnar
12 * 12 *
13 * Credits:
14 *
15 * Roman Zippel provided the ideas and primary code snippets of
16 * the ktime_t union and further simplifications of the original
17 * code.
18 *
13 * For licencing details see kernel-base/COPYING 19 * For licencing details see kernel-base/COPYING
14 */ 20 */
15#ifndef _LINUX_KTIME_H 21#ifndef _LINUX_KTIME_H
diff --git a/include/linux/list.h b/include/linux/list.h
index 945daa1f13dd..47208bd99f9e 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -34,9 +34,11 @@ struct list_head {
34#define LIST_HEAD(name) \ 34#define LIST_HEAD(name) \
35 struct list_head name = LIST_HEAD_INIT(name) 35 struct list_head name = LIST_HEAD_INIT(name)
36 36
37#define INIT_LIST_HEAD(ptr) do { \ 37static inline void INIT_LIST_HEAD(struct list_head *list)
38 (ptr)->next = (ptr); (ptr)->prev = (ptr); \ 38{
39} while (0) 39 list->next = list;
40 list->prev = list;
41}
40 42
41/* 43/*
42 * Insert a new entry between two known consecutive entries. 44 * Insert a new entry between two known consecutive entries.
@@ -534,7 +536,11 @@ struct hlist_node {
534#define HLIST_HEAD_INIT { .first = NULL } 536#define HLIST_HEAD_INIT { .first = NULL }
535#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } 537#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL }
536#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) 538#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
537#define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL) 539static inline void INIT_HLIST_NODE(struct hlist_node *h)
540{
541 h->next = NULL;
542 h->pprev = NULL;
543}
538 544
539static inline int hlist_unhashed(const struct hlist_node *h) 545static inline int hlist_unhashed(const struct hlist_node *h)
540{ 546{
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 95c8fea293ba..920766cea79c 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -84,6 +84,7 @@ struct nlm_rqst {
84 struct nlm_args a_args; /* arguments */ 84 struct nlm_args a_args; /* arguments */
85 struct nlm_res a_res; /* result */ 85 struct nlm_res a_res; /* result */
86 struct nlm_wait * a_block; 86 struct nlm_wait * a_block;
87 unsigned int a_retries; /* Retry count */
87 char a_owner[NLMCLNT_OHSIZE]; 88 char a_owner[NLMCLNT_OHSIZE];
88}; 89};
89 90
@@ -148,7 +149,6 @@ struct nlm_rqst * nlmclnt_alloc_call(void);
148int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl); 149int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl);
149void nlmclnt_finish_block(struct nlm_rqst *req); 150void nlmclnt_finish_block(struct nlm_rqst *req);
150long nlmclnt_block(struct nlm_rqst *req, long timeout); 151long nlmclnt_block(struct nlm_rqst *req, long timeout);
151int nlmclnt_cancel(struct nlm_host *, struct file_lock *);
152u32 nlmclnt_grant(struct nlm_lock *); 152u32 nlmclnt_grant(struct nlm_lock *);
153void nlmclnt_recovery(struct nlm_host *, u32); 153void nlmclnt_recovery(struct nlm_host *, u32);
154int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); 154int nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index ccd3e13de1e8..f38872abc126 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -21,24 +21,35 @@ struct mmc_command {
21 u32 arg; 21 u32 arg;
22 u32 resp[4]; 22 u32 resp[4];
23 unsigned int flags; /* expected response type */ 23 unsigned int flags; /* expected response type */
24#define MMC_RSP_NONE (0 << 0) 24#define MMC_RSP_PRESENT (1 << 0)
25#define MMC_RSP_SHORT (1 << 0) 25#define MMC_RSP_136 (1 << 1) /* 136 bit response */
26#define MMC_RSP_LONG (2 << 0) 26#define MMC_RSP_CRC (1 << 2) /* expect valid crc */
27#define MMC_RSP_MASK (3 << 0) 27#define MMC_RSP_BUSY (1 << 3) /* card may send busy */
28#define MMC_RSP_CRC (1 << 3) /* expect valid crc */ 28#define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */
29#define MMC_RSP_BUSY (1 << 4) /* card may send busy */ 29#define MMC_CMD_MASK (3 << 5) /* command type */
30#define MMC_RSP_OPCODE (1 << 5) /* response contains opcode */ 30#define MMC_CMD_AC (0 << 5)
31#define MMC_CMD_ADTC (1 << 5)
32#define MMC_CMD_BC (2 << 5)
33#define MMC_CMD_BCR (3 << 5)
31 34
32/* 35/*
33 * These are the response types, and correspond to valid bit 36 * These are the response types, and correspond to valid bit
34 * patterns of the above flags. One additional valid pattern 37 * patterns of the above flags. One additional valid pattern
35 * is all zeros, which means we don't expect a response. 38 * is all zeros, which means we don't expect a response.
36 */ 39 */
37#define MMC_RSP_R1 (MMC_RSP_SHORT|MMC_RSP_CRC|MMC_RSP_OPCODE) 40#define MMC_RSP_NONE (0)
38#define MMC_RSP_R1B (MMC_RSP_SHORT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) 41#define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
39#define MMC_RSP_R2 (MMC_RSP_LONG|MMC_RSP_CRC) 42#define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
40#define MMC_RSP_R3 (MMC_RSP_SHORT) 43#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
41#define MMC_RSP_R6 (MMC_RSP_SHORT|MMC_RSP_CRC) 44#define MMC_RSP_R3 (MMC_RSP_PRESENT)
45#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC)
46
47#define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE))
48
49/*
50 * These are the command types.
51 */
52#define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_TYPE)
42 53
43 unsigned int retries; /* max number of retries */ 54 unsigned int retries; /* max number of retries */
44 unsigned int error; /* command error */ 55 unsigned int error; /* command error */
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index a14dc306545b..81c3f77f652c 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -79,7 +79,7 @@
79/* SD commands type argument response */ 79/* SD commands type argument response */
80 /* class 8 */ 80 /* class 8 */
81/* This is basically the same command as for MMC with some quirks. */ 81/* This is basically the same command as for MMC with some quirks. */
82#define SD_SEND_RELATIVE_ADDR 3 /* ac R6 */ 82#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
83 83
84 /* Application commands */ 84 /* Application commands */
85#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ 85#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 93a849f742db..ebfc238cc243 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -91,10 +91,21 @@ struct per_cpu_pageset {
91 * be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible 91 * be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible
92 * combinations of zone modifiers in "zone modifier space". 92 * combinations of zone modifiers in "zone modifier space".
93 * 93 *
94 * As an optimisation any zone modifier bits which are only valid when
95 * no other zone modifier bits are set (loners) should be placed in
96 * the highest order bits of this field. This allows us to reduce the
97 * extent of the zonelists thus saving space. For example in the case
98 * of three zone modifier bits, we could require up to eight zonelists.
99 * If the left most zone modifier is a "loner" then the highest valid
100 * zonelist would be four allowing us to allocate only five zonelists.
101 * Use the first form for GFP_ZONETYPES when the left most bit is not
102 * a "loner", otherwise use the second.
103 *
94 * NOTE! Make sure this matches the zones in <linux/gfp.h> 104 * NOTE! Make sure this matches the zones in <linux/gfp.h>
95 */ 105 */
96#define GFP_ZONEMASK 0x07 106#define GFP_ZONEMASK 0x07
97#define GFP_ZONETYPES 5 107/* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */
108#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */
98 109
99/* 110/*
100 * On machines where it is needed (eg PCs) we divide physical memory 111 * On machines where it is needed (eg PCs) we divide physical memory
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 59ff6c430cf6..6500d4e59d46 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -19,7 +19,21 @@ struct xt_get_revision
19/* For standard target */ 19/* For standard target */
20#define XT_RETURN (-NF_REPEAT - 1) 20#define XT_RETURN (-NF_REPEAT - 1)
21 21
22#define XT_ALIGN(s) (((s) + (__alignof__(u_int64_t)-1)) & ~(__alignof__(u_int64_t)-1)) 22/* this is a dummy structure to find out the alignment requirement for a struct
23 * containing all the fundamental data types that are used in ipt_entry,
24 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
25 * personal pleasure to remove it -HW
26 */
27struct _xt_align
28{
29 u_int8_t u8;
30 u_int16_t u16;
31 u_int32_t u32;
32 u_int64_t u64;
33};
34
35#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \
36 & ~(__alignof__(struct _xt_align)-1))
23 37
24/* Standard return verdict, or do jump. */ 38/* Standard return verdict, or do jump. */
25#define XT_STANDARD_TARGET "" 39#define XT_STANDARD_TARGET ""
diff --git a/include/linux/netfilter_ipv4/ipt_connbytes.h b/include/linux/netfilter_ipv4/ipt_connbytes.h
index b04dfa3083c9..f63e6ee91113 100644
--- a/include/linux/netfilter_ipv4/ipt_connbytes.h
+++ b/include/linux/netfilter_ipv4/ipt_connbytes.h
@@ -1,10 +1,10 @@
1#ifndef _IPT_CONNBYTES_H 1#ifndef _IPT_CONNBYTES_H
2#define _IPT_CONNBYTES_H 2#define _IPT_CONNBYTES_H
3 3
4#include <net/netfilter/xt_connbytes.h> 4#include <linux/netfilter/xt_connbytes.h>
5#define ipt_connbytes_what xt_connbytes_what 5#define ipt_connbytes_what xt_connbytes_what
6 6
7#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PACKETS 7#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS
8#define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES 8#define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES
9#define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT 9#define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT
10 10
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h
index 7fd1bec453f1..a3f6eff39d33 100644
--- a/include/linux/netfilter_ipv4/ipt_policy.h
+++ b/include/linux/netfilter_ipv4/ipt_policy.h
@@ -27,16 +27,22 @@ struct ipt_policy_spec
27 reqid:1; 27 reqid:1;
28}; 28};
29 29
30union ipt_policy_addr
31{
32 struct in_addr a4;
33 struct in6_addr a6;
34};
35
30struct ipt_policy_elem 36struct ipt_policy_elem
31{ 37{
32 u_int32_t saddr; 38 union ipt_policy_addr saddr;
33 u_int32_t smask; 39 union ipt_policy_addr smask;
34 u_int32_t daddr; 40 union ipt_policy_addr daddr;
35 u_int32_t dmask; 41 union ipt_policy_addr dmask;
36 u_int32_t spi; 42 u_int32_t spi;
37 u_int32_t reqid; 43 u_int32_t reqid;
38 u_int8_t proto; 44 u_int8_t proto;
39 u_int8_t mode; 45 u_int8_t mode;
40 46
41 struct ipt_policy_spec match; 47 struct ipt_policy_spec match;
42 struct ipt_policy_spec invert; 48 struct ipt_policy_spec invert;
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h
index 5a93afcd2ff1..671bd818300f 100644
--- a/include/linux/netfilter_ipv6/ip6t_policy.h
+++ b/include/linux/netfilter_ipv6/ip6t_policy.h
@@ -27,16 +27,22 @@ struct ip6t_policy_spec
27 reqid:1; 27 reqid:1;
28}; 28};
29 29
30union ip6t_policy_addr
31{
32 struct in_addr a4;
33 struct in6_addr a6;
34};
35
30struct ip6t_policy_elem 36struct ip6t_policy_elem
31{ 37{
32 struct in6_addr saddr; 38 union ip6t_policy_addr saddr;
33 struct in6_addr smask; 39 union ip6t_policy_addr smask;
34 struct in6_addr daddr; 40 union ip6t_policy_addr daddr;
35 struct in6_addr dmask; 41 union ip6t_policy_addr dmask;
36 u_int32_t spi; 42 u_int32_t spi;
37 u_int32_t reqid; 43 u_int32_t reqid;
38 u_int8_t proto; 44 u_int8_t proto;
39 u_int8_t mode; 45 u_int8_t mode;
40 46
41 struct ip6t_policy_spec match; 47 struct ip6t_policy_spec match;
42 struct ip6t_policy_spec invert; 48 struct ip6t_policy_spec invert;
diff --git a/include/linux/parport.h b/include/linux/parport.h
index f67f838a3a1f..008d736a6c9a 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -128,6 +128,11 @@ struct amiga_parport_state {
128 unsigned char statusdir;/* ciab.ddrb & 7 */ 128 unsigned char statusdir;/* ciab.ddrb & 7 */
129}; 129};
130 130
131struct ip32_parport_state {
132 unsigned int dcr;
133 unsigned int ecr;
134};
135
131struct parport_state { 136struct parport_state {
132 union { 137 union {
133 struct pc_parport_state pc; 138 struct pc_parport_state pc;
@@ -135,6 +140,7 @@ struct parport_state {
135 struct ax_parport_state ax; 140 struct ax_parport_state ax;
136 struct amiga_parport_state amiga; 141 struct amiga_parport_state amiga;
137 /* Atari has not state. */ 142 /* Atari has not state. */
143 struct ip32_parport_state ip32;
138 void *misc; 144 void *misc;
139 } u; 145 } u;
140}; 146};
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0a44072383ec..fe1a2b02fc55 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -406,7 +406,6 @@ struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int devic
406struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 406struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
407int pci_find_capability (struct pci_dev *dev, int cap); 407int pci_find_capability (struct pci_dev *dev, int cap);
408int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 408int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
409int pci_find_ext_capability (struct pci_dev *dev, int cap);
410struct pci_bus * pci_find_next_bus(const struct pci_bus *from); 409struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
411 410
412struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); 411struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
@@ -626,7 +625,6 @@ static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
626static inline void pci_unregister_driver(struct pci_driver *drv) { } 625static inline void pci_unregister_driver(struct pci_driver *drv) { }
627static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 626static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
628static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } 627static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
629static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
630static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } 628static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
631 629
632/* Power management related routines */ 630/* Power management related routines */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ecc1fc1f0f04..92a619ba163f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -394,14 +394,9 @@
394#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511 394#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511
395#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515 395#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515
396#define PCI_DEVICE_ID_NS_87410 0xd001 396#define PCI_DEVICE_ID_NS_87410 0xd001
397#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
398 397
399#define PCI_DEVICE_ID_NS_CS5535_HOST_BRIDGE 0x0028 398#define PCI_DEVICE_ID_NS_CS5535_HOST_BRIDGE 0x0028
400#define PCI_DEVICE_ID_NS_CS5535_ISA_BRIDGE 0x002b 399#define PCI_DEVICE_ID_NS_CS5535_ISA_BRIDGE 0x002b
401#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
402#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e
403#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f
404#define PCI_DEVICE_ID_NS_CS5535_VIDEO 0x0030
405 400
406#define PCI_VENDOR_ID_TSENG 0x100c 401#define PCI_VENDOR_ID_TSENG 0x100c
407#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202 402#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
@@ -511,8 +506,6 @@
511#define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 506#define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097
512#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A 507#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
513 508
514#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
515
516#define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 509#define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081
517#define PCI_DEVICE_ID_AMD_LX_AES 0x2082 510#define PCI_DEVICE_ID_AMD_LX_AES 0x2082
518 511
@@ -1677,6 +1670,9 @@
1677#define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060 1670#define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060
1678#define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 1671#define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061
1679#define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 1672#define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062
1673#define PCI_DEVICE_ID_SIIG_8S_20x_550 0x2080
1674#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081
1675#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082
1680#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 1676#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
1681 1677
1682#define PCI_VENDOR_ID_RADISYS 0x1331 1678#define PCI_VENDOR_ID_RADISYS 0x1331
@@ -2065,6 +2061,7 @@
2065#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5 2061#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
2066#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6 2062#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
2067#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db 2063#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
2064#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
2068#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1 2065#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1
2069#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2 2066#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2
2070#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 2067#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4
@@ -2085,6 +2082,8 @@
2085#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 2082#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
2086#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 2083#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
2087#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 2084#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
2085#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0
2086#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2
2088#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2087#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
2089#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 2088#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
2090#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 2089#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
@@ -2104,6 +2103,13 @@
2104#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd 2103#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
2105#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de 2104#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de
2106#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df 2105#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df
2106#define PCI_DEVICE_ID_INTEL_ICH8_0 0x2810
2107#define PCI_DEVICE_ID_INTEL_ICH8_1 0x2811
2108#define PCI_DEVICE_ID_INTEL_ICH8_2 0x2812
2109#define PCI_DEVICE_ID_INTEL_ICH8_3 0x2814
2110#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
2111#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2112#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2107#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2113#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2108#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2114#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2109#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2115#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
@@ -2147,6 +2153,7 @@
2147#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 2153#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2
2148#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 2154#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
2149#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 2155#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
2156#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5
2150#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca 2157#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca
2151#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb 2158#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb
2152#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea 2159#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 2c177e4c8f22..8a94c717c266 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -114,7 +114,7 @@ struct pkt_ctrl_command {
114 114
115struct packet_settings 115struct packet_settings
116{ 116{
117 __u8 size; /* packet size in (512 byte) sectors */ 117 __u32 size; /* packet size in (512 byte) sectors */
118 __u8 fp; /* fixed packets */ 118 __u8 fp; /* fixed packets */
119 __u8 link_loss; /* the rest is specified 119 __u8 link_loss; /* the rest is specified
120 * as per Mt Fuji */ 120 * as per Mt Fuji */
@@ -169,8 +169,8 @@ struct packet_iosched
169#if (PAGE_SIZE % CD_FRAMESIZE) != 0 169#if (PAGE_SIZE % CD_FRAMESIZE) != 0
170#error "PAGE_SIZE must be a multiple of CD_FRAMESIZE" 170#error "PAGE_SIZE must be a multiple of CD_FRAMESIZE"
171#endif 171#endif
172#define PACKET_MAX_SIZE 32 172#define PACKET_MAX_SIZE 128
173#define PAGES_PER_PACKET (PACKET_MAX_SIZE * CD_FRAMESIZE / PAGE_SIZE) 173#define FRAMES_PER_PAGE (PAGE_SIZE / CD_FRAMESIZE)
174#define PACKET_MAX_SECTORS (PACKET_MAX_SIZE * CD_FRAMESIZE >> 9) 174#define PACKET_MAX_SECTORS (PACKET_MAX_SIZE * CD_FRAMESIZE >> 9)
175 175
176enum packet_data_state { 176enum packet_data_state {
@@ -219,7 +219,7 @@ struct packet_data
219 atomic_t io_errors; /* Number of read/write errors during IO */ 219 atomic_t io_errors; /* Number of read/write errors during IO */
220 220
221 struct bio *r_bios[PACKET_MAX_SIZE]; /* bios to use during data gathering */ 221 struct bio *r_bios[PACKET_MAX_SIZE]; /* bios to use during data gathering */
222 struct page *pages[PAGES_PER_PACKET]; 222 struct page *pages[PACKET_MAX_SIZE / FRAMES_PER_PAGE];
223 223
224 int cache_valid; /* If non-zero, the data for the zone defined */ 224 int cache_valid; /* If non-zero, the data for the zone defined */
225 /* by the sector variable is completely cached */ 225 /* by the sector variable is completely cached */
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 54faf5236da0..95572c434bc9 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -84,7 +84,6 @@ struct k_clock {
84void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock); 84void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock);
85 85
86/* error handlers for timer_create, nanosleep and settime */ 86/* error handlers for timer_create, nanosleep and settime */
87int do_posix_clock_notimer_create(struct k_itimer *timer);
88int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *, 87int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *,
89 struct timespec __user *); 88 struct timespec __user *);
90int do_posix_clock_nosettime(const clockid_t, struct timespec *tp); 89int do_posix_clock_nosettime(const clockid_t, struct timespec *tp);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 4f34d3d60f2e..21e5a9124856 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -190,7 +190,6 @@ static __inline__ int DQUOT_OFF(struct super_block *sb)
190 */ 190 */
191#define sb_dquot_ops (NULL) 191#define sb_dquot_ops (NULL)
192#define sb_quotactl_ops (NULL) 192#define sb_quotactl_ops (NULL)
193#define sync_dquots_dev(dev,type) (NULL)
194#define DQUOT_INIT(inode) do { } while(0) 193#define DQUOT_INIT(inode) do { } while(0)
195#define DQUOT_DROP(inode) do { } while(0) 194#define DQUOT_DROP(inode) do { } while(0)
196#define DQUOT_ALLOC_INODE(inode) (0) 195#define DQUOT_ALLOC_INODE(inode) (0)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 981f9aa43353..b87aefa082e2 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -240,11 +240,14 @@ extern int rcu_pending(int cpu);
240 * This means that all preempt_disable code sequences, including NMI and 240 * This means that all preempt_disable code sequences, including NMI and
241 * hardware-interrupt handlers, in progress on entry will have completed 241 * hardware-interrupt handlers, in progress on entry will have completed
242 * before this primitive returns. However, this does not guarantee that 242 * before this primitive returns. However, this does not guarantee that
243 * softirq handlers will have completed, since in some kernels 243 * softirq handlers will have completed, since in some kernels, these
244 * handlers can run in process context, and can block.
244 * 245 *
245 * This primitive provides the guarantees made by the (deprecated) 246 * This primitive provides the guarantees made by the (deprecated)
246 * synchronize_kernel() API. In contrast, synchronize_rcu() only 247 * synchronize_kernel() API. In contrast, synchronize_rcu() only
247 * guarantees that rcu_read_lock() sections will have completed. 248 * guarantees that rcu_read_lock() sections will have completed.
249 * In "classic RCU", these two guarantees happen to be one and
250 * the same, but can differ in realtime RCU implementations.
248 */ 251 */
249#define synchronize_sched() synchronize_rcu() 252#define synchronize_sched() synchronize_rcu()
250 253
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 7ab2cdb83ef0..015297ff73fa 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -60,8 +60,7 @@ extern void machine_crash_shutdown(struct pt_regs *);
60 */ 60 */
61 61
62extern void kernel_restart_prepare(char *cmd); 62extern void kernel_restart_prepare(char *cmd);
63extern void kernel_halt_prepare(void); 63extern void kernel_shutdown_prepare(enum system_states state);
64extern void kernel_power_off_prepare(void);
65 64
66extern void kernel_restart(char *cmd); 65extern void kernel_restart(char *cmd);
67extern void kernel_halt(void); 66extern void kernel_halt(void);
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 0a3605099c44..806ec5b06707 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -58,9 +58,13 @@ extern struct reiserfs_xattr_handler posix_acl_default_handler;
58extern struct reiserfs_xattr_handler posix_acl_access_handler; 58extern struct reiserfs_xattr_handler posix_acl_access_handler;
59#else 59#else
60 60
61#define reiserfs_get_acl NULL
62#define reiserfs_cache_default_acl(inode) 0 61#define reiserfs_cache_default_acl(inode) 0
63 62
63static inline struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
64{
65 return NULL;
66}
67
64static inline int reiserfs_xattr_posix_acl_init(void) 68static inline int reiserfs_xattr_posix_acl_init(void)
65{ 69{
66 return 0; 70 return 0;
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index e276c5ba2bb7..7d51149bd793 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1971,22 +1971,6 @@ extern struct file_operations reiserfs_file_operations;
1971extern struct address_space_operations reiserfs_address_space_operations; 1971extern struct address_space_operations reiserfs_address_space_operations;
1972 1972
1973/* fix_nodes.c */ 1973/* fix_nodes.c */
1974#ifdef CONFIG_REISERFS_CHECK
1975void *reiserfs_kmalloc(size_t size, gfp_t flags, struct super_block *s);
1976void reiserfs_kfree(const void *vp, size_t size, struct super_block *s);
1977#else
1978static inline void *reiserfs_kmalloc(size_t size, int flags,
1979 struct super_block *s)
1980{
1981 return kmalloc(size, flags);
1982}
1983
1984static inline void reiserfs_kfree(const void *vp, size_t size,
1985 struct super_block *s)
1986{
1987 kfree(vp);
1988}
1989#endif
1990 1974
1991int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, 1975int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb,
1992 struct item_head *p_s_ins_ih, const void *); 1976 struct item_head *p_s_ins_ih, const void *);
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 3e68592e52e9..31b4c0bd4fa0 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -382,7 +382,6 @@ struct reiserfs_sb_info {
382 on-disk FS format */ 382 on-disk FS format */
383 383
384 /* session statistics */ 384 /* session statistics */
385 int s_kmallocs;
386 int s_disk_reads; 385 int s_disk_reads;
387 int s_disk_writes; 386 int s_disk_writes;
388 int s_fix_nodes; 387 int s_fix_nodes;
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index c84354e8374c..87280eb6083d 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -43,8 +43,6 @@ int reiserfs_delete_xattrs(struct inode *inode);
43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); 43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs);
44int reiserfs_xattr_init(struct super_block *sb, int mount_flags); 44int reiserfs_xattr_init(struct super_block *sb, int mount_flags);
45int reiserfs_permission(struct inode *inode, int mask, struct nameidata *nd); 45int reiserfs_permission(struct inode *inode, int mask, struct nameidata *nd);
46int reiserfs_permission_locked(struct inode *inode, int mask,
47 struct nameidata *nd);
48 46
49int reiserfs_xattr_del(struct inode *, const char *); 47int reiserfs_xattr_del(struct inode *, const char *);
50int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t); 48int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t);
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 9d6fbeef2104..d6b9bcd1384c 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -91,7 +91,8 @@ static inline void page_dup_rmap(struct page *page)
91 * Called from mm/vmscan.c to handle paging out 91 * Called from mm/vmscan.c to handle paging out
92 */ 92 */
93int page_referenced(struct page *, int is_locked); 93int page_referenced(struct page *, int is_locked);
94int try_to_unmap(struct page *); 94int try_to_unmap(struct page *, int ignore_refs);
95void remove_from_swap(struct page *page);
95 96
96/* 97/*
97 * Called from mm/filemap_xip.c to unmap empty zero page 98 * Called from mm/filemap_xip.c to unmap empty zero page
@@ -111,7 +112,7 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *);
111#define anon_vma_link(vma) do {} while (0) 112#define anon_vma_link(vma) do {} while (0)
112 113
113#define page_referenced(page,l) TestClearPageReferenced(page) 114#define page_referenced(page,l) TestClearPageReferenced(page)
114#define try_to_unmap(page) SWAP_FAIL 115#define try_to_unmap(page, refs) SWAP_FAIL
115 116
116#endif /* CONFIG_MMU */ 117#endif /* CONFIG_MMU */
117 118
diff --git a/include/linux/security.h b/include/linux/security.h
index ef753654daa5..7cbef482e13a 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1499,15 +1499,11 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd,
1499 1499
1500static inline int security_inode_alloc (struct inode *inode) 1500static inline int security_inode_alloc (struct inode *inode)
1501{ 1501{
1502 if (unlikely (IS_PRIVATE (inode)))
1503 return 0;
1504 return security_ops->inode_alloc_security (inode); 1502 return security_ops->inode_alloc_security (inode);
1505} 1503}
1506 1504
1507static inline void security_inode_free (struct inode *inode) 1505static inline void security_inode_free (struct inode *inode)
1508{ 1506{
1509 if (unlikely (IS_PRIVATE (inode)))
1510 return;
1511 security_ops->inode_free_security (inode); 1507 security_ops->inode_free_security (inode);
1512} 1508}
1513 1509
@@ -2617,6 +2613,25 @@ static inline int security_netlink_recv (struct sk_buff *skb)
2617 return cap_netlink_recv (skb); 2613 return cap_netlink_recv (skb);
2618} 2614}
2619 2615
2616static inline struct dentry *securityfs_create_dir(const char *name,
2617 struct dentry *parent)
2618{
2619 return ERR_PTR(-ENODEV);
2620}
2621
2622static inline struct dentry *securityfs_create_file(const char *name,
2623 mode_t mode,
2624 struct dentry *parent,
2625 void *data,
2626 struct file_operations *fops)
2627{
2628 return ERR_PTR(-ENODEV);
2629}
2630
2631static inline void securityfs_remove(struct dentry *dentry)
2632{
2633}
2634
2620#endif /* CONFIG_SECURITY */ 2635#endif /* CONFIG_SECURITY */
2621 2636
2622#ifdef CONFIG_SECURITY_NETWORK 2637#ifdef CONFIG_SECURITY_NETWORK
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index cee302aefdb7..73b464f0926a 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -26,7 +26,7 @@ struct plat_serial8250_port {
26 unsigned char regshift; /* register shift */ 26 unsigned char regshift; /* register shift */
27 unsigned char iotype; /* UPIO_* */ 27 unsigned char iotype; /* UPIO_* */
28 unsigned char hub6; 28 unsigned char hub6;
29 unsigned int flags; /* UPF_* flags */ 29 upf_t flags; /* UPF_* flags */
30}; 30};
31 31
32/* 32/*
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index ec351005bf9d..4041122dabfc 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -203,6 +203,8 @@ struct uart_icount {
203 __u32 buf_overrun; 203 __u32 buf_overrun;
204}; 204};
205 205
206typedef unsigned int __bitwise__ upf_t;
207
206struct uart_port { 208struct uart_port {
207 spinlock_t lock; /* port lock */ 209 spinlock_t lock; /* port lock */
208 unsigned int iobase; /* in/out[bwl] */ 210 unsigned int iobase; /* in/out[bwl] */
@@ -230,36 +232,34 @@ struct uart_port {
230 unsigned long sysrq; /* sysrq timeout */ 232 unsigned long sysrq; /* sysrq timeout */
231#endif 233#endif
232 234
233 unsigned int flags; 235 upf_t flags;
234 236
235#define UPF_FOURPORT (1 << 1) 237#define UPF_FOURPORT ((__force upf_t) (1 << 1))
236#define UPF_SAK (1 << 2) 238#define UPF_SAK ((__force upf_t) (1 << 2))
237#define UPF_SPD_MASK (0x1030) 239#define UPF_SPD_MASK ((__force upf_t) (0x1030))
238#define UPF_SPD_HI (0x0010) 240#define UPF_SPD_HI ((__force upf_t) (0x0010))
239#define UPF_SPD_VHI (0x0020) 241#define UPF_SPD_VHI ((__force upf_t) (0x0020))
240#define UPF_SPD_CUST (0x0030) 242#define UPF_SPD_CUST ((__force upf_t) (0x0030))
241#define UPF_SPD_SHI (0x1000) 243#define UPF_SPD_SHI ((__force upf_t) (0x1000))
242#define UPF_SPD_WARP (0x1010) 244#define UPF_SPD_WARP ((__force upf_t) (0x1010))
243#define UPF_SKIP_TEST (1 << 6) 245#define UPF_SKIP_TEST ((__force upf_t) (1 << 6))
244#define UPF_AUTO_IRQ (1 << 7) 246#define UPF_AUTO_IRQ ((__force upf_t) (1 << 7))
245#define UPF_HARDPPS_CD (1 << 11) 247#define UPF_HARDPPS_CD ((__force upf_t) (1 << 11))
246#define UPF_LOW_LATENCY (1 << 13) 248#define UPF_LOW_LATENCY ((__force upf_t) (1 << 13))
247#define UPF_BUGGY_UART (1 << 14) 249#define UPF_BUGGY_UART ((__force upf_t) (1 << 14))
248#define UPF_AUTOPROBE (1 << 15) 250#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
249#define UPF_MAGIC_MULTIPLIER (1 << 16) 251#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
250#define UPF_BOOT_ONLYMCA (1 << 22) 252#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
251#define UPF_CONS_FLOW (1 << 23) 253#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
252#define UPF_SHARE_IRQ (1 << 24) 254#define UPF_IOREMAP ((__force upf_t) (1 << 31))
253#define UPF_BOOT_AUTOCONF (1 << 28) 255
254#define UPF_IOREMAP (1 << 31) 256#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff))
255 257#define UPF_USR_MASK ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY))
256#define UPF_CHANGE_MASK (0x17fff)
257#define UPF_USR_MASK (UPF_SPD_MASK|UPF_LOW_LATENCY)
258 258
259 unsigned int mctrl; /* current modem ctrl settings */ 259 unsigned int mctrl; /* current modem ctrl settings */
260 unsigned int timeout; /* character-based timeout */ 260 unsigned int timeout; /* character-based timeout */
261 unsigned int type; /* port type */ 261 unsigned int type; /* port type */
262 struct uart_ops *ops; 262 const struct uart_ops *ops;
263 unsigned int custom_divisor; 263 unsigned int custom_divisor;
264 unsigned int line; /* port index */ 264 unsigned int line; /* port index */
265 unsigned long mapbase; /* for ioremap */ 265 unsigned long mapbase; /* for ioremap */
@@ -289,6 +289,9 @@ struct uart_state {
289}; 289};
290 290
291#define UART_XMIT_SIZE PAGE_SIZE 291#define UART_XMIT_SIZE PAGE_SIZE
292
293typedef unsigned int __bitwise__ uif_t;
294
292/* 295/*
293 * This is the state information which is only valid when the port 296 * This is the state information which is only valid when the port
294 * is open; it may be freed by the core driver once the device has 297 * is open; it may be freed by the core driver once the device has
@@ -298,17 +301,16 @@ struct uart_state {
298struct uart_info { 301struct uart_info {
299 struct tty_struct *tty; 302 struct tty_struct *tty;
300 struct circ_buf xmit; 303 struct circ_buf xmit;
301 unsigned int flags; 304 uif_t flags;
302 305
303/* 306/*
304 * These are the flags that specific to info->flags, and reflect our 307 * Definitions for info->flags. These are _private_ to serial_core, and
305 * internal state. They can not be accessed via port->flags. Low 308 * are specific to this structure. They may be queried by low level drivers.
306 * level drivers must not change these, but may query them instead.
307 */ 309 */
308#define UIF_CHECK_CD (1 << 25) 310#define UIF_CHECK_CD ((__force uif_t) (1 << 25))
309#define UIF_CTS_FLOW (1 << 26) 311#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
310#define UIF_NORMAL_ACTIVE (1 << 29) 312#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))
311#define UIF_INITIALIZED (1 << 31) 313#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
312 314
313 int blocked_open; 315 int blocked_open;
314 316
@@ -430,7 +432,7 @@ static inline int uart_handle_break(struct uart_port *port)
430 port->sysrq = 0; 432 port->sysrq = 0;
431 } 433 }
432#endif 434#endif
433 if (info->flags & UPF_SAK) 435 if (port->flags & UPF_SAK)
434 do_SAK(info->tty); 436 do_SAK(info->tty);
435 return 0; 437 return 0;
436} 438}
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1fb77a9cc148..8cf52939d0ab 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -76,7 +76,14 @@ struct cache_sizes {
76 kmem_cache_t *cs_dmacachep; 76 kmem_cache_t *cs_dmacachep;
77}; 77};
78extern struct cache_sizes malloc_sizes[]; 78extern struct cache_sizes malloc_sizes[];
79
80#ifndef CONFIG_DEBUG_SLAB
79extern void *__kmalloc(size_t, gfp_t); 81extern void *__kmalloc(size_t, gfp_t);
82#else
83extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
84#define __kmalloc(size, flags) \
85 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
86#endif
80 87
81static inline void *kmalloc(size_t size, gfp_t flags) 88static inline void *kmalloc(size_t size, gfp_t flags)
82{ 89{
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index b68c11a2d6dd..be4772ed43c0 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -48,7 +48,7 @@ struct rpc_cred {
48 48
49 /* per-flavor data */ 49 /* per-flavor data */
50}; 50};
51#define RPCAUTH_CRED_LOCKED 0x0001 51#define RPCAUTH_CRED_NEW 0x0001
52#define RPCAUTH_CRED_UPTODATE 0x0002 52#define RPCAUTH_CRED_UPTODATE 0x0002
53 53
54#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 54#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0
@@ -83,9 +83,10 @@ struct rpc_auth {
83 struct rpc_cred_cache * au_credcache; 83 struct rpc_cred_cache * au_credcache;
84 /* per-flavor data */ 84 /* per-flavor data */
85}; 85};
86#define RPC_AUTH_PROC_CREDS 0x0010 /* process creds (including 86
87 * uid/gid, fs[ug]id, gids) 87/* Flags for rpcauth_lookupcred() */
88 */ 88#define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */
89#define RPCAUTH_LOOKUP_ROOTCREDS 0x02 /* This really ought to go! */
89 90
90/* 91/*
91 * Client authentication ops 92 * Client authentication ops
@@ -105,6 +106,7 @@ struct rpc_authops {
105 106
106struct rpc_credops { 107struct rpc_credops {
107 const char * cr_name; /* Name of the auth flavour */ 108 const char * cr_name; /* Name of the auth flavour */
109 int (*cr_init)(struct rpc_auth *, struct rpc_cred *);
108 void (*crdestroy)(struct rpc_cred *); 110 void (*crdestroy)(struct rpc_cred *);
109 111
110 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); 112 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 5dc94e777fab..43bcd13eb1ec 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -42,10 +42,6 @@ extern void mark_free_pages(struct zone *zone);
42#ifdef CONFIG_PM 42#ifdef CONFIG_PM
43/* kernel/power/swsusp.c */ 43/* kernel/power/swsusp.c */
44extern int software_suspend(void); 44extern int software_suspend(void);
45
46extern int pm_prepare_console(void);
47extern void pm_restore_console(void);
48
49#else 45#else
50static inline int software_suspend(void) 46static inline int software_suspend(void)
51{ 47{
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 4a99e4a7fbf3..f3e17d5963c3 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -178,6 +178,7 @@ extern int vm_swappiness;
178 178
179#ifdef CONFIG_NUMA 179#ifdef CONFIG_NUMA
180extern int zone_reclaim_mode; 180extern int zone_reclaim_mode;
181extern int zone_reclaim_interval;
181extern int zone_reclaim(struct zone *, gfp_t, unsigned int); 182extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
182#else 183#else
183#define zone_reclaim_mode 0 184#define zone_reclaim_mode 0
@@ -190,13 +191,20 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
190#ifdef CONFIG_MIGRATION 191#ifdef CONFIG_MIGRATION
191extern int isolate_lru_page(struct page *p); 192extern int isolate_lru_page(struct page *p);
192extern int putback_lru_pages(struct list_head *l); 193extern int putback_lru_pages(struct list_head *l);
194extern int migrate_page(struct page *, struct page *);
195extern void migrate_page_copy(struct page *, struct page *);
196extern int migrate_page_remove_references(struct page *, struct page *, int);
193extern int migrate_pages(struct list_head *l, struct list_head *t, 197extern int migrate_pages(struct list_head *l, struct list_head *t,
194 struct list_head *moved, struct list_head *failed); 198 struct list_head *moved, struct list_head *failed);
199extern int fail_migrate_page(struct page *, struct page *);
195#else 200#else
196static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } 201static inline int isolate_lru_page(struct page *p) { return -ENOSYS; }
197static inline int putback_lru_pages(struct list_head *l) { return 0; } 202static inline int putback_lru_pages(struct list_head *l) { return 0; }
198static inline int migrate_pages(struct list_head *l, struct list_head *t, 203static inline int migrate_pages(struct list_head *l, struct list_head *t,
199 struct list_head *moved, struct list_head *failed) { return -ENOSYS; } 204 struct list_head *moved, struct list_head *failed) { return -ENOSYS; }
205/* Possible settings for the migrate_page() method in address_operations */
206#define migrate_page NULL
207#define fail_migrate_page NULL
200#endif 208#endif
201 209
202#ifdef CONFIG_MMU 210#ifdef CONFIG_MMU
@@ -245,6 +253,7 @@ extern int remove_exclusive_swap_page(struct page *);
245struct backing_dev_info; 253struct backing_dev_info;
246 254
247extern spinlock_t swap_lock; 255extern spinlock_t swap_lock;
256extern int remove_vma_swap(struct vm_area_struct *vma, struct page *page);
248 257
249/* linux/mm/thrash.c */ 258/* linux/mm/thrash.c */
250extern struct mm_struct * swap_token_mm; 259extern struct mm_struct * swap_token_mm;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e666d6070569..3877209d23c3 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -50,6 +50,8 @@ struct timezone;
50struct tms; 50struct tms;
51struct utimbuf; 51struct utimbuf;
52struct mq_attr; 52struct mq_attr;
53struct compat_stat;
54struct compat_timeval;
53 55
54#include <linux/config.h> 56#include <linux/config.h>
55#include <linux/types.h> 57#include <linux/types.h>
@@ -534,4 +536,35 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
534asmlinkage long sys_spu_create(const char __user *name, 536asmlinkage long sys_spu_create(const char __user *name,
535 unsigned int flags, mode_t mode); 537 unsigned int flags, mode_t mode);
536 538
539asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode,
540 unsigned dev);
541asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, int mode);
542asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag);
543asmlinkage long sys_symlinkat(const char __user * oldname,
544 int newdfd, const char __user * newname);
545asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
546 int newdfd, const char __user *newname);
547asmlinkage long sys_renameat(int olddfd, const char __user * oldname,
548 int newdfd, const char __user * newname);
549asmlinkage long sys_futimesat(int dfd, char __user *filename,
550 struct timeval __user *utimes);
551asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
552asmlinkage long sys_fchmodat(int dfd, const char __user * filename,
553 mode_t mode);
554asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
555 gid_t group, int flag);
556asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
557 int mode);
558asmlinkage long sys_newfstatat(int dfd, char __user *filename,
559 struct stat __user *statbuf, int flag);
560asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
561 int bufsiz);
562asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
563 struct compat_timeval __user *t);
564asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
565 struct compat_stat __user *statbuf,
566 int flag);
567asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
568 int flags, int mode);
569
537#endif 570#endif
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 8352a7ce5895..32a4139c4ad8 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -182,7 +182,8 @@ enum
182 VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */ 182 VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */
183 VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */ 183 VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */
184 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ 184 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
185 VM_ZONE_RECLAIM_MODE=31,/* reclaim local zone memory before going off node */ 185 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
186 VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */
186}; 187};
187 188
188 189
diff --git a/include/linux/time.h b/include/linux/time.h
index 614dd8465839..7b4dc36532bb 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -48,7 +48,7 @@ extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
48 * Returns true if the timespec is norm, false if denorm: 48 * Returns true if the timespec is norm, false if denorm:
49 */ 49 */
50#define timespec_valid(ts) \ 50#define timespec_valid(ts) \
51 (((ts)->tv_sec >= 0) && (((unsigned) (ts)->tv_nsec) < NSEC_PER_SEC)) 51 (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC))
52 52
53/* 53/*
54 * 64-bit nanosec type. Large enough to span 292+ years in nanosecond 54 * 64-bit nanosec type. Large enough to span 292+ years in nanosecond
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 3787102e4b12..a7bd3b4558d2 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -57,6 +57,7 @@ struct tty_buffer {
57 unsigned char *flag_buf_ptr; 57 unsigned char *flag_buf_ptr;
58 int used; 58 int used;
59 int size; 59 int size;
60 int active;
60 /* Data points here */ 61 /* Data points here */
61 unsigned long data[0]; 62 unsigned long data[0];
62}; 63};
@@ -64,6 +65,7 @@ struct tty_buffer {
64struct tty_bufhead { 65struct tty_bufhead {
65 struct work_struct work; 66 struct work_struct work;
66 struct semaphore pty_sem; 67 struct semaphore pty_sem;
68 spinlock_t lock;
67 struct tty_buffer *head; /* Queue head */ 69 struct tty_buffer *head; /* Queue head */
68 struct tty_buffer *tail; /* Active buffer */ 70 struct tty_buffer *tail; /* Active buffer */
69 struct tty_buffer *free; /* Free queue head */ 71 struct tty_buffer *free; /* Free queue head */
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index be1400e82482..82961eb19888 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -17,7 +17,7 @@ _INLINE_ int tty_insert_flip_char(struct tty_struct *tty,
17 unsigned char ch, char flag) 17 unsigned char ch, char flag)
18{ 18{
19 struct tty_buffer *tb = tty->buf.tail; 19 struct tty_buffer *tb = tty->buf.tail;
20 if (tb && tb->used < tb->size) { 20 if (tb && tb->active && tb->used < tb->size) {
21 tb->flag_buf_ptr[tb->used] = flag; 21 tb->flag_buf_ptr[tb->used] = flag;
22 tb->char_buf_ptr[tb->used++] = ch; 22 tb->char_buf_ptr[tb->used++] = ch;
23 return 1; 23 return 1;
@@ -27,6 +27,11 @@ _INLINE_ int tty_insert_flip_char(struct tty_struct *tty,
27 27
28_INLINE_ void tty_schedule_flip(struct tty_struct *tty) 28_INLINE_ void tty_schedule_flip(struct tty_struct *tty)
29{ 29{
30 unsigned long flags;
31 spin_lock_irqsave(&tty->buf.lock, flags);
32 if (tty->buf.tail != NULL)
33 tty->buf.tail->active = 0;
34 spin_unlock_irqrestore(&tty->buf.lock, flags);
30 schedule_delayed_work(&tty->buf.work, 1); 35 schedule_delayed_work(&tty->buf.work, 1);
31} 36}
32 37
diff --git a/include/linux/types.h b/include/linux/types.h
index 21b9ce803644..54ae2d59e71b 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -8,6 +8,8 @@
8 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) 8 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
9#define DECLARE_BITMAP(name,bits) \ 9#define DECLARE_BITMAP(name,bits) \
10 unsigned long name[BITS_TO_LONGS(bits)] 10 unsigned long name[BITS_TO_LONGS(bits)]
11
12#define BITS_PER_BYTE 8
11#endif 13#endif
12 14
13#include <linux/posix_types.h> 15#include <linux/posix_types.h>
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 7a6babeca256..b0ffe4356e5a 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -148,11 +148,11 @@ typedef __u16 __bitwise __fs16;
148#define UFS_USEEFT ((__u16)65535) 148#define UFS_USEEFT ((__u16)65535)
149 149
150#define UFS_FSOK 0x7c269d38 150#define UFS_FSOK 0x7c269d38
151#define UFS_FSACTIVE ((char)0x00) 151#define UFS_FSACTIVE ((__s8)0x00)
152#define UFS_FSCLEAN ((char)0x01) 152#define UFS_FSCLEAN ((__s8)0x01)
153#define UFS_FSSTABLE ((char)0x02) 153#define UFS_FSSTABLE ((__s8)0x02)
154#define UFS_FSOSF1 ((char)0x03) /* is this correct for DEC OSF/1? */ 154#define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */
155#define UFS_FSBAD ((char)0xff) 155#define UFS_FSBAD ((__s8)0xff)
156 156
157/* From here to next blank line, s_flags for ufs_sb_info */ 157/* From here to next blank line, s_flags for ufs_sb_info */
158/* directory entry encoding */ 158/* directory entry encoding */
@@ -502,8 +502,7 @@ struct ufs_super_block {
502/* 502/*
503 * Convert cylinder group to base address of its global summary info. 503 * Convert cylinder group to base address of its global summary info.
504 */ 504 */
505#define fs_cs(indx) \ 505#define fs_cs(indx) s_csp[(indx)]
506 s_csp[(indx) >> uspi->s_csshift][(indx) & ~uspi->s_csmask]
507 506
508/* 507/*
509 * Cylinder group block for a file system. 508 * Cylinder group block for a file system.
@@ -913,6 +912,7 @@ extern int ufs_sync_inode (struct inode *);
913extern void ufs_delete_inode (struct inode *); 912extern void ufs_delete_inode (struct inode *);
914extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *); 913extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *);
915extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); 914extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
915extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
916 916
917/* namei.c */ 917/* namei.c */
918extern struct file_operations ufs_dir_operations; 918extern struct file_operations ufs_dir_operations;
diff --git a/include/linux/ufs_fs_sb.h b/include/linux/ufs_fs_sb.h
index c1be4c226486..8ff13c160f3d 100644
--- a/include/linux/ufs_fs_sb.h
+++ b/include/linux/ufs_fs_sb.h
@@ -25,7 +25,7 @@ struct ufs_csum;
25 25
26struct ufs_sb_info { 26struct ufs_sb_info {
27 struct ufs_sb_private_info * s_uspi; 27 struct ufs_sb_private_info * s_uspi;
28 struct ufs_csum * s_csp[UFS_MAXCSBUFS]; 28 struct ufs_csum * s_csp;
29 unsigned s_bytesex; 29 unsigned s_bytesex;
30 unsigned s_flags; 30 unsigned s_flags;
31 struct buffer_head ** s_ucg; 31 struct buffer_head ** s_ucg;
diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h
index ee21e6bf3867..a2aacfc7af2f 100644
--- a/include/linux/usb_ch9.h
+++ b/include/linux/usb_ch9.h
@@ -535,9 +535,11 @@ enum usb_device_state {
535 */ 535 */
536 USB_STATE_NOTATTACHED = 0, 536 USB_STATE_NOTATTACHED = 0,
537 537
538 /* the chapter 9 device states */ 538 /* chapter 9 and authentication (wireless) device states */
539 USB_STATE_ATTACHED, 539 USB_STATE_ATTACHED,
540 USB_STATE_POWERED, 540 USB_STATE_POWERED, /* wired */
541 USB_STATE_UNAUTHENTICATED, /* auth */
542 USB_STATE_RECONNECTING, /* auth */
541 USB_STATE_DEFAULT, /* limited function */ 543 USB_STATE_DEFAULT, /* limited function */
542 USB_STATE_ADDRESS, 544 USB_STATE_ADDRESS,
543 USB_STATE_CONFIGURED, /* most functions */ 545 USB_STATE_CONFIGURED, /* most functions */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 839ccc70698e..b23be44cbea8 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -315,6 +315,7 @@ struct v4l2_pix_format
315#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ 315#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */
316#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ 316#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */
317#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ 317#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
318#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */
318 319
319/* 320/*
320 * F O R M A T E N U M E R A T I O N 321 * F O R M A T E N U M E R A T I O N
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index df05f468fa5c..9a92aef8b0b2 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -803,9 +803,9 @@ enum ieee80211_state {
803#define IEEE80211_24GHZ_MAX_CHANNEL 14 803#define IEEE80211_24GHZ_MAX_CHANNEL 14
804#define IEEE80211_24GHZ_CHANNELS 14 804#define IEEE80211_24GHZ_CHANNELS 14
805 805
806#define IEEE80211_52GHZ_MIN_CHANNEL 36 806#define IEEE80211_52GHZ_MIN_CHANNEL 34
807#define IEEE80211_52GHZ_MAX_CHANNEL 165 807#define IEEE80211_52GHZ_MAX_CHANNEL 165
808#define IEEE80211_52GHZ_CHANNELS 32 808#define IEEE80211_52GHZ_CHANNELS 131
809 809
810enum { 810enum {
811 IEEE80211_CH_PASSIVE_ONLY = (1 << 0), 811 IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 67856eb93b43..dac43b15a5b0 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -88,12 +88,6 @@ extern struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX];
88extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); 88extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto);
89extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); 89extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto);
90 90
91static inline struct nf_conntrack_l3proto *
92__nf_ct_l3proto_find(u_int16_t l3proto)
93{
94 return nf_ct_l3protos[l3proto];
95}
96
97extern struct nf_conntrack_l3proto * 91extern struct nf_conntrack_l3proto *
98nf_ct_l3proto_find_get(u_int16_t l3proto); 92nf_ct_l3proto_find_get(u_int16_t l3proto);
99 93
@@ -103,4 +97,13 @@ extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
103extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; 97extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
104extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; 98extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6;
105extern struct nf_conntrack_l3proto nf_conntrack_generic_l3proto; 99extern struct nf_conntrack_l3proto nf_conntrack_generic_l3proto;
100
101static inline struct nf_conntrack_l3proto *
102__nf_ct_l3proto_find(u_int16_t l3proto)
103{
104 if (unlikely(l3proto >= AF_MAX))
105 return &nf_conntrack_generic_l3proto;
106 return nf_ct_l3protos[l3proto];
107}
108
106#endif /*_NF_CONNTRACK_L3PROTO_H*/ 109#endif /*_NF_CONNTRACK_L3PROTO_H*/
diff --git a/include/net/route.h b/include/net/route.h
index e3e5436f8017..9c04f15090d2 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -170,8 +170,8 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst,
170 return ip_route_output_flow(rp, &fl, sk, 0); 170 return ip_route_output_flow(rp, &fl, sk, 0);
171} 171}
172 172
173static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, 173static inline int ip_route_newports(struct rtable **rp, u8 protocol,
174 struct sock *sk) 174 u16 sport, u16 dport, struct sock *sk)
175{ 175{
176 if (sport != (*rp)->fl.fl_ip_sport || 176 if (sport != (*rp)->fl.fl_ip_sport ||
177 dport != (*rp)->fl.fl_ip_dport) { 177 dport != (*rp)->fl.fl_ip_dport) {
@@ -180,6 +180,7 @@ static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport,
180 memcpy(&fl, &(*rp)->fl, sizeof(fl)); 180 memcpy(&fl, &(*rp)->fl, sizeof(fl));
181 fl.fl_ip_sport = sport; 181 fl.fl_ip_sport = sport;
182 fl.fl_ip_dport = dport; 182 fl.fl_ip_dport = dport;
183 fl.proto = protocol;
183 ip_rt_put(*rp); 184 ip_rt_put(*rp);
184 *rp = NULL; 185 *rp = NULL;
185 return ip_route_output_flow(rp, &fl, sk, 0); 186 return ip_route_output_flow(rp, &fl, sk, 0);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 8c522ae031bb..072f407848a6 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -700,7 +700,7 @@ struct sctp_chunk {
700 __u8 ecn_ce_done; /* Have we processed the ECN CE bit? */ 700 __u8 ecn_ce_done; /* Have we processed the ECN CE bit? */
701 __u8 pdiscard; /* Discard the whole packet now? */ 701 __u8 pdiscard; /* Discard the whole packet now? */
702 __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ 702 __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */
703 __u8 fast_retransmit; /* Is this chunk fast retransmitted? */ 703 __s8 fast_retransmit; /* Is this chunk fast retransmitted? */
704 __u8 tsn_missing_report; /* Data chunk missing counter. */ 704 __u8 tsn_missing_report; /* Data chunk missing counter. */
705}; 705};
706 706
diff --git a/include/net/sock.h b/include/net/sock.h
index 1806e5b61419..30758035d616 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1354,12 +1354,12 @@ extern int sock_get_timestamp(struct sock *, struct timeval __user *);
1354 * Enable debug/info messages 1354 * Enable debug/info messages
1355 */ 1355 */
1356 1356
1357#if 0 1357#ifdef CONFIG_NETDEBUG
1358#define NETDEBUG(fmt, args...) do { } while (0)
1359#define LIMIT_NETDEBUG(fmt, args...) do { } while(0)
1360#else
1361#define NETDEBUG(fmt, args...) printk(fmt,##args) 1358#define NETDEBUG(fmt, args...) printk(fmt,##args)
1362#define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0) 1359#define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0)
1360#else
1361#define NETDEBUG(fmt, args...) do { } while (0)
1362#define LIMIT_NETDEBUG(fmt, args...) do { } while(0)
1363#endif 1363#endif
1364 1364
1365/* 1365/*
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index e94ca4d36035..290e3b4d2aec 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -275,7 +275,7 @@ extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd,
275 int data_direction, void *buffer, unsigned bufflen, 275 int data_direction, void *buffer, unsigned bufflen,
276 struct scsi_sense_hdr *, int timeout, int retries); 276 struct scsi_sense_hdr *, int timeout, int retries);
277extern int scsi_execute_async(struct scsi_device *sdev, 277extern int scsi_execute_async(struct scsi_device *sdev,
278 const unsigned char *cmd, int data_direction, 278 const unsigned char *cmd, int cmd_len, int data_direction,
279 void *buffer, unsigned bufflen, int use_sg, 279 void *buffer, unsigned bufflen, int use_sg,
280 int timeout, int retries, void *privdata, 280 int timeout, int retries, void *privdata,
281 void (*done)(void *, char *, int, int), 281 void (*done)(void *, char *, int, int),
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 467274a764d1..827992949c4b 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -554,7 +554,6 @@ struct Scsi_Host {
554 /* 554 /*
555 * ordered write support 555 * ordered write support
556 */ 556 */
557 unsigned ordered_flush:1;
558 unsigned ordered_tag:1; 557 unsigned ordered_tag:1;
559 558
560 /* 559 /*