aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h7
-rw-r--r--include/acpi/acdebug.h146
-rw-r--r--include/acpi/acdisasm.h114
-rw-r--r--include/acpi/acdispat.h171
-rw-r--r--include/acpi/acevents.h85
-rw-r--r--include/acpi/acexcep.h5
-rw-r--r--include/acpi/acglobal.h12
-rw-r--r--include/acpi/achware.h52
-rw-r--r--include/acpi/acinterp.h243
-rw-r--r--include/acpi/aclocal.h10
-rw-r--r--include/acpi/acmacros.h10
-rw-r--r--include/acpi/acnames.h84
-rw-r--r--include/acpi/acnamesp.h163
-rw-r--r--include/acpi/acobject.h2
-rw-r--r--include/acpi/acopcode.h325
-rw-r--r--include/acpi/acparser.h134
-rw-r--r--include/acpi/acpi.h1
-rw-r--r--include/acpi/acpi_bus.h21
-rw-r--r--include/acpi/acpi_drivers.h5
-rw-r--r--include/acpi/acpiosxf.h18
-rw-r--r--include/acpi/acpixf.h13
-rw-r--r--include/acpi/acresrc.h67
-rw-r--r--include/acpi/acstruct.h1
-rw-r--r--include/acpi/actables.h70
-rw-r--r--include/acpi/actbl.h2
-rw-r--r--include/acpi/actypes.h2
-rw-r--r--include/acpi/acutils.h274
-rw-r--r--include/acpi/amlcode.h12
-rw-r--r--include/acpi/pdc_intel.h29
-rw-r--r--include/acpi/platform/acenv.h20
-rw-r--r--include/acpi/processor.h34
-rw-r--r--include/asm-alpha/pci.h2
-rw-r--r--include/asm-alpha/pgtable.h4
-rw-r--r--include/asm-arm/pci.h2
-rw-r--r--include/asm-arm/smp.h3
-rw-r--r--include/asm-h8300/pci.h2
-rw-r--r--include/asm-i386/acpi.h10
-rw-r--r--include/asm-i386/apicdef.h6
-rw-r--r--include/asm-i386/pci.h2
-rw-r--r--include/asm-i386/unistd.h5
-rw-r--r--include/asm-ia64/acpi.h9
-rw-r--r--include/asm-ia64/pci.h2
-rw-r--r--include/asm-m68k/pci.h2
-rw-r--r--include/asm-mips/pci.h2
-rw-r--r--include/asm-ppc/kexec.h2
-rw-r--r--include/asm-ppc/pci.h2
-rw-r--r--include/asm-ppc64/pci.h2
-rw-r--r--include/asm-sh/pci.h2
-rw-r--r--include/asm-sh64/pci.h2
-rw-r--r--include/asm-sparc/pci.h2
-rw-r--r--include/asm-sparc64/pci.h2
-rw-r--r--include/asm-sparc64/seccomp.h21
-rw-r--r--include/asm-um/mmu_context.h4
-rw-r--r--include/asm-x86_64/acpi.h8
-rw-r--r--include/asm-x86_64/pci.h2
-rw-r--r--include/linux/acpi.h7
-rw-r--r--include/linux/device.h6
-rw-r--r--include/linux/etherdevice.h2
-rw-r--r--include/linux/ext3_fs.h14
-rw-r--r--include/linux/fddidevice.h2
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/fsnotify.h248
-rw-r--r--include/linux/hardirq.h1
-rw-r--r--include/linux/hdlc.h4
-rw-r--r--include/linux/inotify.h108
-rw-r--r--include/linux/mount.h2
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/pm.h2
-rw-r--r--include/linux/reiserfs_acl.h52
-rw-r--r--include/linux/reiserfs_fs.h1595
-rw-r--r--include/linux/reiserfs_fs_i.h59
-rw-r--r--include/linux/reiserfs_fs_sb.h616
-rw-r--r--include/linux/reiserfs_xattr.h126
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/sysctl.h9
-rw-r--r--include/linux/usb.h8
-rw-r--r--include/linux/usb_cdc.h13
-rw-r--r--include/linux/usb_gadget.h12
-rw-r--r--include/linux/wanrouter.h3
-rw-r--r--include/media/audiochip.h3
-rw-r--r--include/media/saa6752hs.h49
-rw-r--r--include/media/tuner.h51
-rw-r--r--include/net/sctp/sctp.h3
-rw-r--r--include/net/sctp/sm.h11
-rw-r--r--include/net/sctp/structs.h30
-rw-r--r--include/net/sctp/ulpevent.h16
-rw-r--r--include/net/sctp/ulpqueue.h11
-rw-r--r--include/net/x25device.h3
-rw-r--r--include/pcmcia/ds.h5
90 files changed, 2689 insertions, 2627 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 2b41e47b7d8..2f6ab189fc6 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -64,7 +64,7 @@
64 64
65/* Version string */ 65/* Version string */
66 66
67#define ACPI_CA_VERSION 0x20050309 67#define ACPI_CA_VERSION 0x20050408
68 68
69/* 69/*
70 * OS name, used for the _OS object. The _OS object is essentially obsolete, 70 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -130,9 +130,8 @@
130#define ACPI_MAX_GPE_BLOCKS 2 130#define ACPI_MAX_GPE_BLOCKS 2
131#define ACPI_GPE_REGISTER_WIDTH 8 131#define ACPI_GPE_REGISTER_WIDTH 8
132 132
133/* 133/* Method info (in WALK_STATE), containing local variables and argumetns */
134 * Method info (in WALK_STATE), containing local variables and argumetns 134
135 */
136#define ACPI_METHOD_NUM_LOCALS 8 135#define ACPI_METHOD_NUM_LOCALS 8
137#define ACPI_METHOD_MAX_LOCAL 7 136#define ACPI_METHOD_MAX_LOCAL 7
138 137
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index 223b2a506e4..8ba372b0f24 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -61,9 +61,7 @@ struct argument_info
61 61
62 62
63#define PARAM_LIST(pl) pl 63#define PARAM_LIST(pl) pl
64
65#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) 64#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
66
67#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ 65#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
68 acpi_os_printf PARAM_LIST(fp);} 66 acpi_os_printf PARAM_LIST(fp);}
69 67
@@ -71,13 +69,9 @@ struct argument_info
71#define EX_SINGLE_STEP 2 69#define EX_SINGLE_STEP 2
72 70
73 71
74/* Prototypes */
75
76
77/* 72/*
78 * dbxface - external debugger interfaces 73 * dbxface - external debugger interfaces
79 */ 74 */
80
81acpi_status 75acpi_status
82acpi_db_initialize ( 76acpi_db_initialize (
83 void); 77 void);
@@ -92,20 +86,10 @@ acpi_db_single_step (
92 union acpi_parse_object *op, 86 union acpi_parse_object *op,
93 u32 op_type); 87 u32 op_type);
94 88
95acpi_status
96acpi_db_start_command (
97 struct acpi_walk_state *walk_state,
98 union acpi_parse_object *op);
99
100void
101acpi_db_method_end (
102 struct acpi_walk_state *walk_state);
103
104 89
105/* 90/*
106 * dbcmds - debug commands and output routines 91 * dbcmds - debug commands and output routines
107 */ 92 */
108
109acpi_status 93acpi_status
110acpi_db_disassemble_method ( 94acpi_db_disassemble_method (
111 char *name); 95 char *name);
@@ -177,57 +161,30 @@ acpi_db_find_references (
177 char *object_arg); 161 char *object_arg);
178 162
179void 163void
180acpi_db_display_locks (void); 164acpi_db_display_locks (
181 165 void);
182 166
183void 167void
184acpi_db_display_resources ( 168acpi_db_display_resources (
185 char *object_arg); 169 char *object_arg);
186 170
187void 171void
188acpi_db_display_gpes (void); 172acpi_db_display_gpes (
173 void);
189 174
190void 175void
191acpi_db_check_integrity ( 176acpi_db_check_integrity (
192 void); 177 void);
193 178
194acpi_status
195acpi_db_integrity_walk (
196 acpi_handle obj_handle,
197 u32 nesting_level,
198 void *context,
199 void **return_value);
200
201acpi_status
202acpi_db_walk_and_match_name (
203 acpi_handle obj_handle,
204 u32 nesting_level,
205 void *context,
206 void **return_value);
207
208acpi_status
209acpi_db_walk_for_references (
210 acpi_handle obj_handle,
211 u32 nesting_level,
212 void *context,
213 void **return_value);
214
215acpi_status
216acpi_db_walk_for_specific_objects (
217 acpi_handle obj_handle,
218 u32 nesting_level,
219 void *context,
220 void **return_value);
221
222void 179void
223acpi_db_generate_gpe ( 180acpi_db_generate_gpe (
224 char *gpe_arg, 181 char *gpe_arg,
225 char *block_arg); 182 char *block_arg);
226 183
184
227/* 185/*
228 * dbdisply - debug display commands 186 * dbdisply - debug display commands
229 */ 187 */
230
231void 188void
232acpi_db_display_method_info ( 189acpi_db_display_method_info (
233 union acpi_parse_object *op); 190 union acpi_parse_object *op);
@@ -271,19 +228,10 @@ acpi_db_display_argument_object (
271 union acpi_operand_object *obj_desc, 228 union acpi_operand_object *obj_desc,
272 struct acpi_walk_state *walk_state); 229 struct acpi_walk_state *walk_state);
273 230
274void
275acpi_db_dump_parser_descriptor (
276 union acpi_parse_object *op);
277
278void *
279acpi_db_get_pointer (
280 void *target);
281
282 231
283/* 232/*
284 * dbexec - debugger control method execution 233 * dbexec - debugger control method execution
285 */ 234 */
286
287void 235void
288acpi_db_execute ( 236acpi_db_execute (
289 char *name, 237 char *name,
@@ -296,44 +244,15 @@ acpi_db_create_execution_threads (
296 char *num_loops_arg, 244 char *num_loops_arg,
297 char *method_name_arg); 245 char *method_name_arg);
298 246
299acpi_status
300acpi_db_execute_method (
301 struct acpi_db_method_info *info,
302 struct acpi_buffer *return_obj);
303
304void
305acpi_db_execute_setup (
306 struct acpi_db_method_info *info);
307
308u32
309acpi_db_get_outstanding_allocations (
310 void);
311
312void ACPI_SYSTEM_XFACE
313acpi_db_method_thread (
314 void *context);
315
316acpi_status
317acpi_db_execution_walk (
318 acpi_handle obj_handle,
319 u32 nesting_level,
320 void *context,
321 void **return_value);
322
323 247
324/* 248/*
325 * dbfileio - Debugger file I/O commands 249 * dbfileio - Debugger file I/O commands
326 */ 250 */
327
328acpi_object_type 251acpi_object_type
329acpi_db_match_argument ( 252acpi_db_match_argument (
330 char *user_argument, 253 char *user_argument,
331 struct argument_info *arguments); 254 struct argument_info *arguments);
332 255
333acpi_status
334ae_local_load_table (
335 struct acpi_table_header *table_ptr);
336
337void 256void
338acpi_db_close_debug_file ( 257acpi_db_close_debug_file (
339 void); 258 void);
@@ -356,16 +275,17 @@ acpi_db_read_table_from_file (
356 char *filename, 275 char *filename,
357 struct acpi_table_header **table); 276 struct acpi_table_header **table);
358 277
278
359/* 279/*
360 * dbhistry - debugger HISTORY command 280 * dbhistry - debugger HISTORY command
361 */ 281 */
362
363void 282void
364acpi_db_add_to_history ( 283acpi_db_add_to_history (
365 char *command_line); 284 char *command_line);
366 285
367void 286void
368acpi_db_display_history (void); 287acpi_db_display_history (
288 void);
369 289
370char * 290char *
371acpi_db_get_from_history ( 291acpi_db_get_from_history (
@@ -375,7 +295,6 @@ acpi_db_get_from_history (
375/* 295/*
376 * dbinput - user front-end to the AML debugger 296 * dbinput - user front-end to the AML debugger
377 */ 297 */
378
379acpi_status 298acpi_status
380acpi_db_command_dispatch ( 299acpi_db_command_dispatch (
381 char *input_buffer, 300 char *input_buffer,
@@ -386,71 +305,28 @@ void ACPI_SYSTEM_XFACE
386acpi_db_execute_thread ( 305acpi_db_execute_thread (
387 void *context); 306 void *context);
388 307
389void
390acpi_db_display_help (
391 char *help_type);
392
393char *
394acpi_db_get_next_token (
395 char *string,
396 char **next);
397
398u32
399acpi_db_get_line (
400 char *input_buffer);
401
402u32
403acpi_db_match_command (
404 char *user_command);
405
406void
407acpi_db_single_thread (
408 void);
409
410 308
411/* 309/*
412 * dbstats - Generation and display of ACPI table statistics 310 * dbstats - Generation and display of ACPI table statistics
413 */ 311 */
414
415void 312void
416acpi_db_generate_statistics ( 313acpi_db_generate_statistics (
417 union acpi_parse_object *root, 314 union acpi_parse_object *root,
418 u8 is_method); 315 u8 is_method);
419 316
420
421acpi_status 317acpi_status
422acpi_db_display_statistics ( 318acpi_db_display_statistics (
423 char *type_arg); 319 char *type_arg);
424 320
425acpi_status
426acpi_db_classify_one_object (
427 acpi_handle obj_handle,
428 u32 nesting_level,
429 void *context,
430 void **return_value);
431
432void
433acpi_db_count_namespace_objects (
434 void);
435
436void
437acpi_db_enumerate_object (
438 union acpi_operand_object *obj_desc);
439
440 321
441/* 322/*
442 * dbutils - AML debugger utilities 323 * dbutils - AML debugger utilities
443 */ 324 */
444
445void 325void
446acpi_db_set_output_destination ( 326acpi_db_set_output_destination (
447 u32 where); 327 u32 where);
448 328
449void 329void
450acpi_db_dump_buffer (
451 u32 address);
452
453void
454acpi_db_dump_object ( 330acpi_db_dump_object (
455 union acpi_object *obj_desc, 331 union acpi_object *obj_desc,
456 u32 level); 332 u32 level);
@@ -459,14 +335,8 @@ void
459acpi_db_prep_namestring ( 335acpi_db_prep_namestring (
460 char *name); 336 char *name);
461 337
462
463acpi_status
464acpi_db_second_pass_parse (
465 union acpi_parse_object *root);
466
467struct acpi_namespace_node * 338struct acpi_namespace_node *
468acpi_db_local_ns_lookup ( 339acpi_db_local_ns_lookup (
469 char *name); 340 char *name);
470 341
471
472#endif /* __ACDEBUG_H__ */ 342#endif /* __ACDEBUG_H__ */
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 26d907eae6f..dbfa877121b 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -102,58 +102,16 @@ acpi_status (*asl_walk_callback) (
102/* 102/*
103 * dmwalk 103 * dmwalk
104 */ 104 */
105
106void
107acpi_dm_walk_parse_tree (
108 union acpi_parse_object *op,
109 asl_walk_callback descending_callback,
110 asl_walk_callback ascending_callback,
111 void *context);
112
113acpi_status
114acpi_dm_descending_op (
115 union acpi_parse_object *op,
116 u32 level,
117 void *context);
118
119acpi_status
120acpi_dm_ascending_op (
121 union acpi_parse_object *op,
122 u32 level,
123 void *context);
124
125
126/*
127 * dmopcode
128 */
129
130void
131acpi_dm_validate_name (
132 char *name,
133 union acpi_parse_object *op);
134
135u32
136acpi_dm_dump_name (
137 char *name);
138
139void
140acpi_dm_unicode (
141 union acpi_parse_object *op);
142
143void 105void
144acpi_dm_disassemble ( 106acpi_dm_disassemble (
145 struct acpi_walk_state *walk_state, 107 struct acpi_walk_state *walk_state,
146 union acpi_parse_object *origin, 108 union acpi_parse_object *origin,
147 u32 num_opcodes); 109 u32 num_opcodes);
148 110
149void
150acpi_dm_namestring (
151 char *name);
152
153void
154acpi_dm_display_path (
155 union acpi_parse_object *op);
156 111
112/*
113 * dmopcode
114 */
157void 115void
158acpi_dm_disassemble_one_op ( 116acpi_dm_disassemble_one_op (
159 struct acpi_walk_state *walk_state, 117 struct acpi_walk_state *walk_state,
@@ -165,18 +123,9 @@ acpi_dm_decode_internal_object (
165 union acpi_operand_object *obj_desc); 123 union acpi_operand_object *obj_desc);
166 124
167u32 125u32
168acpi_dm_block_type (
169 union acpi_parse_object *op);
170
171u32
172acpi_dm_list_type ( 126acpi_dm_list_type (
173 union acpi_parse_object *op); 127 union acpi_parse_object *op);
174 128
175acpi_status
176acpi_ps_display_object_pathname (
177 struct acpi_walk_state *walk_state,
178 union acpi_parse_object *op);
179
180void 129void
181acpi_dm_method_flags ( 130acpi_dm_method_flags (
182 union acpi_parse_object *op); 131 union acpi_parse_object *op);
@@ -197,10 +146,6 @@ void
197acpi_dm_match_op ( 146acpi_dm_match_op (
198 union acpi_parse_object *op); 147 union acpi_parse_object *op);
199 148
200void
201acpi_dm_match_keyword (
202 union acpi_parse_object *op);
203
204u8 149u8
205acpi_dm_comma_if_list_member ( 150acpi_dm_comma_if_list_member (
206 union acpi_parse_object *op); 151 union acpi_parse_object *op);
@@ -211,13 +156,25 @@ acpi_dm_comma_if_field_member (
211 156
212 157
213/* 158/*
214 * dmobject 159 * dmnames
215 */ 160 */
161u32
162acpi_dm_dump_name (
163 char *name);
164
165acpi_status
166acpi_ps_display_object_pathname (
167 struct acpi_walk_state *walk_state,
168 union acpi_parse_object *op);
216 169
217void 170void
218acpi_dm_decode_node ( 171acpi_dm_namestring (
219 struct acpi_namespace_node *node); 172 char *name);
173
220 174
175/*
176 * dmobject
177 */
221void 178void
222acpi_dm_display_internal_object ( 179acpi_dm_display_internal_object (
223 union acpi_operand_object *obj_desc, 180 union acpi_operand_object *obj_desc,
@@ -241,6 +198,16 @@ acpi_dm_dump_method_info (
241/* 198/*
242 * dmbuffer 199 * dmbuffer
243 */ 200 */
201void
202acpi_dm_disasm_byte_list (
203 u32 level,
204 u8 *byte_data,
205 u32 byte_count);
206
207void
208acpi_dm_byte_list (
209 struct acpi_op_walk_info *info,
210 union acpi_parse_object *op);
244 211
245void 212void
246acpi_is_eisa_id ( 213acpi_is_eisa_id (
@@ -262,18 +229,6 @@ acpi_dm_is_string_buffer (
262/* 229/*
263 * dmresrc 230 * dmresrc
264 */ 231 */
265
266void
267acpi_dm_disasm_byte_list (
268 u32 level,
269 u8 *byte_data,
270 u32 byte_count);
271
272void
273acpi_dm_byte_list (
274 struct acpi_op_walk_info *info,
275 union acpi_parse_object *op);
276
277void 232void
278acpi_dm_resource_descriptor ( 233acpi_dm_resource_descriptor (
279 struct acpi_op_walk_info *info, 234 struct acpi_op_walk_info *info,
@@ -296,19 +251,10 @@ void
296acpi_dm_decode_attribute ( 251acpi_dm_decode_attribute (
297 u8 attribute); 252 u8 attribute);
298 253
254
299/* 255/*
300 * dmresrcl 256 * dmresrcl
301 */ 257 */
302
303void
304acpi_dm_io_flags (
305 u8 flags);
306
307void
308acpi_dm_memory_flags (
309 u8 flags,
310 u8 specific_flags);
311
312void 258void
313acpi_dm_word_descriptor ( 259acpi_dm_word_descriptor (
314 struct asl_word_address_desc *resource, 260 struct asl_word_address_desc *resource,
@@ -373,7 +319,6 @@ acpi_dm_vendor_large_descriptor (
373/* 319/*
374 * dmresrcs 320 * dmresrcs
375 */ 321 */
376
377void 322void
378acpi_dm_irq_descriptor ( 323acpi_dm_irq_descriptor (
379 struct asl_irq_format_desc *resource, 324 struct asl_irq_format_desc *resource,
@@ -420,7 +365,6 @@ acpi_dm_vendor_small_descriptor (
420/* 365/*
421 * dmutils 366 * dmutils
422 */ 367 */
423
424void 368void
425acpi_dm_add_to_external_list ( 369acpi_dm_add_to_external_list (
426 char *path); 370 char *path);
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 237d6343358..8f5f2f71b1d 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -50,40 +50,9 @@
50#define NAMEOF_ARG_NTE "__A0" 50#define NAMEOF_ARG_NTE "__A0"
51 51
52 52
53/* Common interfaces */ 53/*
54 54 * dsopcode - support for late evaluation
55acpi_status 55 */
56acpi_ds_obj_stack_push (
57 void *object,
58 struct acpi_walk_state *walk_state);
59
60acpi_status
61acpi_ds_obj_stack_pop (
62 u32 pop_count,
63 struct acpi_walk_state *walk_state);
64
65#ifdef ACPI_FUTURE_USAGE
66void *
67acpi_ds_obj_stack_get_value (
68 u32 index,
69 struct acpi_walk_state *walk_state);
70#endif
71
72acpi_status
73acpi_ds_obj_stack_pop_object (
74 union acpi_operand_object **object,
75 struct acpi_walk_state *walk_state);
76
77
78/* dsopcode - support for late evaluation */
79
80acpi_status
81acpi_ds_execute_arguments (
82 struct acpi_namespace_node *node,
83 struct acpi_namespace_node *scope_node,
84 u32 aml_length,
85 u8 *aml_start);
86
87acpi_status 56acpi_status
88acpi_ds_get_buffer_field_arguments ( 57acpi_ds_get_buffer_field_arguments (
89 union acpi_operand_object *obj_desc); 58 union acpi_operand_object *obj_desc);
@@ -101,15 +70,6 @@ acpi_ds_get_package_arguments (
101 union acpi_operand_object *obj_desc); 70 union acpi_operand_object *obj_desc);
102 71
103acpi_status 72acpi_status
104acpi_ds_init_buffer_field (
105 u16 aml_opcode,
106 union acpi_operand_object *obj_desc,
107 union acpi_operand_object *buffer_desc,
108 union acpi_operand_object *offset_desc,
109 union acpi_operand_object *length_desc,
110 union acpi_operand_object *result_desc);
111
112acpi_status
113acpi_ds_eval_buffer_field_operands ( 73acpi_ds_eval_buffer_field_operands (
114 struct acpi_walk_state *walk_state, 74 struct acpi_walk_state *walk_state,
115 union acpi_parse_object *op); 75 union acpi_parse_object *op);
@@ -130,9 +90,9 @@ acpi_ds_initialize_region (
130 acpi_handle obj_handle); 90 acpi_handle obj_handle);
131 91
132 92
133/* dsctrl - Parser/Interpreter interface, control stack routines */ 93/*
134 94 * dsctrl - Parser/Interpreter interface, control stack routines
135 95 */
136acpi_status 96acpi_status
137acpi_ds_exec_begin_control_op ( 97acpi_ds_exec_begin_control_op (
138 struct acpi_walk_state *walk_state, 98 struct acpi_walk_state *walk_state,
@@ -144,9 +104,9 @@ acpi_ds_exec_end_control_op (
144 union acpi_parse_object *op); 104 union acpi_parse_object *op);
145 105
146 106
147/* dsexec - Parser/Interpreter interface, method execution callbacks */ 107/*
148 108 * dsexec - Parser/Interpreter interface, method execution callbacks
149 109 */
150acpi_status 110acpi_status
151acpi_ds_get_predicate_value ( 111acpi_ds_get_predicate_value (
152 struct acpi_walk_state *walk_state, 112 struct acpi_walk_state *walk_state,
@@ -162,14 +122,9 @@ acpi_ds_exec_end_op (
162 struct acpi_walk_state *state); 122 struct acpi_walk_state *state);
163 123
164 124
165/* dsfield - Parser/Interpreter interface for AML fields */ 125/*
166 126 * dsfield - Parser/Interpreter interface for AML fields
167acpi_status 127 */
168acpi_ds_get_field_names (
169 struct acpi_create_field_info *info,
170 struct acpi_walk_state *walk_state,
171 union acpi_parse_object *arg);
172
173acpi_status 128acpi_status
174acpi_ds_create_field ( 129acpi_ds_create_field (
175 union acpi_parse_object *op, 130 union acpi_parse_object *op,
@@ -199,8 +154,9 @@ acpi_ds_init_field_objects (
199 struct acpi_walk_state *walk_state); 154 struct acpi_walk_state *walk_state);
200 155
201 156
202/* dsload - Parser/Interpreter interface, namespace load callbacks */ 157/*
203 158 * dsload - Parser/Interpreter interface, namespace load callbacks
159 */
204acpi_status 160acpi_status
205acpi_ds_load1_begin_op ( 161acpi_ds_load1_begin_op (
206 struct acpi_walk_state *walk_state, 162 struct acpi_walk_state *walk_state,
@@ -225,9 +181,9 @@ acpi_ds_init_callbacks (
225 u32 pass_number); 181 u32 pass_number);
226 182
227 183
228/* dsmthdat - method data (locals/args) */ 184/*
229 185 * dsmthdat - method data (locals/args)
230 186 */
231acpi_status 187acpi_status
232acpi_ds_store_object_to_local ( 188acpi_ds_store_object_to_local (
233 u16 opcode, 189 u16 opcode,
@@ -250,14 +206,6 @@ u8
250acpi_ds_is_method_value ( 206acpi_ds_is_method_value (
251 union acpi_operand_object *obj_desc); 207 union acpi_operand_object *obj_desc);
252 208
253#ifdef ACPI_FUTURE_USAGE
254acpi_object_type
255acpi_ds_method_data_get_type (
256 u16 opcode,
257 u32 index,
258 struct acpi_walk_state *walk_state);
259#endif
260
261acpi_status 209acpi_status
262acpi_ds_method_data_get_value ( 210acpi_ds_method_data_get_value (
263 u16 opcode, 211 u16 opcode,
@@ -265,12 +213,6 @@ acpi_ds_method_data_get_value (
265 struct acpi_walk_state *walk_state, 213 struct acpi_walk_state *walk_state,
266 union acpi_operand_object **dest_desc); 214 union acpi_operand_object **dest_desc);
267 215
268void
269acpi_ds_method_data_delete_value (
270 u16 opcode,
271 u32 index,
272 struct acpi_walk_state *walk_state);
273
274acpi_status 216acpi_status
275acpi_ds_method_data_init_args ( 217acpi_ds_method_data_init_args (
276 union acpi_operand_object **params, 218 union acpi_operand_object **params,
@@ -288,16 +230,10 @@ void
288acpi_ds_method_data_init ( 230acpi_ds_method_data_init (
289 struct acpi_walk_state *walk_state); 231 struct acpi_walk_state *walk_state);
290 232
291acpi_status
292acpi_ds_method_data_set_value (
293 u16 opcode,
294 u32 index,
295 union acpi_operand_object *object,
296 struct acpi_walk_state *walk_state);
297
298
299/* dsmethod - Parser/Interpreter interface - control method parsing */
300 233
234/*
235 * dsmethod - Parser/Interpreter interface - control method parsing
236 */
301acpi_status 237acpi_status
302acpi_ds_parse_method ( 238acpi_ds_parse_method (
303 acpi_handle obj_handle); 239 acpi_handle obj_handle);
@@ -324,20 +260,18 @@ acpi_ds_begin_method_execution (
324 struct acpi_namespace_node *calling_method_node); 260 struct acpi_namespace_node *calling_method_node);
325 261
326 262
327/* dsobj - Parser/Interpreter interface - object initialization and conversion */ 263/*
328 264 * dsinit
329acpi_status 265 */
330acpi_ds_init_one_object (
331 acpi_handle obj_handle,
332 u32 level,
333 void *context,
334 void **return_value);
335
336acpi_status 266acpi_status
337acpi_ds_initialize_objects ( 267acpi_ds_initialize_objects (
338 struct acpi_table_desc *table_desc, 268 struct acpi_table_desc *table_desc,
339 struct acpi_namespace_node *start_node); 269 struct acpi_namespace_node *start_node);
340 270
271
272/*
273 * dsobject - Parser/Interpreter interface - object initialization and conversion
274 */
341acpi_status 275acpi_status
342acpi_ds_build_internal_buffer_obj ( 276acpi_ds_build_internal_buffer_obj (
343 struct acpi_walk_state *walk_state, 277 struct acpi_walk_state *walk_state,
@@ -353,12 +287,6 @@ acpi_ds_build_internal_package_obj (
353 union acpi_operand_object **obj_desc); 287 union acpi_operand_object **obj_desc);
354 288
355acpi_status 289acpi_status
356acpi_ds_build_internal_object (
357 struct acpi_walk_state *walk_state,
358 union acpi_parse_object *op,
359 union acpi_operand_object **obj_desc_ptr);
360
361acpi_status
362acpi_ds_init_object_from_op ( 290acpi_ds_init_object_from_op (
363 struct acpi_walk_state *walk_state, 291 struct acpi_walk_state *walk_state,
364 union acpi_parse_object *op, 292 union acpi_parse_object *op,
@@ -372,8 +300,9 @@ acpi_ds_create_node (
372 union acpi_parse_object *op); 300 union acpi_parse_object *op);
373 301
374 302
375/* dsutils - Parser/Interpreter interface utility routines */ 303/*
376 304 * dsutils - Parser/Interpreter interface utility routines
305 */
377void 306void
378acpi_ds_clear_implicit_return ( 307acpi_ds_clear_implicit_return (
379 struct acpi_walk_state *walk_state); 308 struct acpi_walk_state *walk_state);
@@ -418,7 +347,6 @@ acpi_ds_clear_operands (
418/* 347/*
419 * dswscope - Scope Stack manipulation 348 * dswscope - Scope Stack manipulation
420 */ 349 */
421
422acpi_status 350acpi_status
423acpi_ds_scope_stack_push ( 351acpi_ds_scope_stack_push (
424 struct acpi_namespace_node *node, 352 struct acpi_namespace_node *node,
@@ -435,7 +363,18 @@ acpi_ds_scope_stack_clear (
435 struct acpi_walk_state *walk_state); 363 struct acpi_walk_state *walk_state);
436 364
437 365
438/* dswstate - parser WALK_STATE management routines */ 366/*
367 * dswstate - parser WALK_STATE management routines
368 */
369acpi_status
370acpi_ds_obj_stack_push (
371 void *object,
372 struct acpi_walk_state *walk_state);
373
374acpi_status
375acpi_ds_obj_stack_pop (
376 u32 pop_count,
377 struct acpi_walk_state *walk_state);
439 378
440struct acpi_walk_state * 379struct acpi_walk_state *
441acpi_ds_create_walk_state ( 380acpi_ds_create_walk_state (
@@ -454,12 +393,6 @@ acpi_ds_init_aml_walk (
454 struct acpi_parameter_info *info, 393 struct acpi_parameter_info *info,
455 u32 pass_number); 394 u32 pass_number);
456 395
457#ifdef ACPI_FUTURE_USAGE
458acpi_status
459acpi_ds_obj_stack_delete_all (
460 struct acpi_walk_state *walk_state);
461#endif
462
463acpi_status 396acpi_status
464acpi_ds_obj_stack_pop_and_delete ( 397acpi_ds_obj_stack_pop_and_delete (
465 u32 pop_count, 398 u32 pop_count,
@@ -494,20 +427,8 @@ struct acpi_walk_state *
494acpi_ds_get_current_walk_state ( 427acpi_ds_get_current_walk_state (
495 struct acpi_thread_state *thread); 428 struct acpi_thread_state *thread);
496 429
497#ifdef ACPI_ENABLE_OBJECT_CACHE
498void
499acpi_ds_delete_walk_state_cache (
500 void);
501#endif
502
503#ifdef ACPI_FUTURE_USAGE 430#ifdef ACPI_FUTURE_USAGE
504acpi_status 431acpi_status
505acpi_ds_result_insert (
506 void *object,
507 u32 index,
508 struct acpi_walk_state *walk_state);
509
510acpi_status
511acpi_ds_result_remove ( 432acpi_ds_result_remove (
512 union acpi_operand_object **object, 433 union acpi_operand_object **object,
513 u32 index, 434 u32 index,
@@ -529,4 +450,10 @@ acpi_ds_result_pop_from_bottom (
529 union acpi_operand_object **object, 450 union acpi_operand_object **object,
530 struct acpi_walk_state *walk_state); 451 struct acpi_walk_state *walk_state);
531 452
453#ifdef ACPI_ENABLE_OBJECT_CACHE
454void
455acpi_ds_delete_walk_state_cache (
456 void);
457#endif
458
532#endif /* _ACDISPAT_H_ */ 459#endif /* _ACDISPAT_H_ */
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index 2dec083ba1c..61a27c8c507 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -45,6 +45,9 @@
45#define __ACEVENTS_H__ 45#define __ACEVENTS_H__
46 46
47 47
48/*
49 * evevent
50 */
48acpi_status 51acpi_status
49acpi_ev_initialize_events ( 52acpi_ev_initialize_events (
50 void); 53 void);
@@ -53,28 +56,14 @@ acpi_status
53acpi_ev_install_xrupt_handlers ( 56acpi_ev_install_xrupt_handlers (
54 void); 57 void);
55 58
56
57/*
58 * Evfixed - Fixed event handling
59 */
60
61acpi_status
62acpi_ev_fixed_event_initialize (
63 void);
64
65u32 59u32
66acpi_ev_fixed_event_detect ( 60acpi_ev_fixed_event_detect (
67 void); 61 void);
68 62
69u32
70acpi_ev_fixed_event_dispatch (
71 u32 event);
72
73 63
74/* 64/*
75 * Evmisc 65 * evmisc
76 */ 66 */
77
78u8 67u8
79acpi_ev_is_notify_object ( 68acpi_ev_is_notify_object (
80 struct acpi_namespace_node *node); 69 struct acpi_namespace_node *node);
@@ -100,24 +89,10 @@ acpi_ev_queue_notify_request (
100 struct acpi_namespace_node *node, 89 struct acpi_namespace_node *node,
101 u32 notify_value); 90 u32 notify_value);
102 91
103void ACPI_SYSTEM_XFACE
104acpi_ev_notify_dispatch (
105 void *context);
106
107 92
108/* 93/*
109 * Evgpe - GPE handling and dispatch 94 * evgpe - GPE handling and dispatch
110 */ 95 */
111
112acpi_status
113acpi_ev_walk_gpe_list (
114 ACPI_GPE_CALLBACK gpe_walk_callback,
115 u32 flags);
116
117u8
118acpi_ev_valid_gpe_event (
119 struct acpi_gpe_event_info *gpe_event_info);
120
121acpi_status 96acpi_status
122acpi_ev_update_gpe_enable_masks ( 97acpi_ev_update_gpe_enable_masks (
123 struct acpi_gpe_event_info *gpe_event_info, 98 struct acpi_gpe_event_info *gpe_event_info,
@@ -137,9 +112,23 @@ acpi_ev_get_gpe_event_info (
137 acpi_handle gpe_device, 112 acpi_handle gpe_device,
138 u32 gpe_number); 113 u32 gpe_number);
139 114
115
116/*
117 * evgpeblk
118 */
119u8
120acpi_ev_valid_gpe_event (
121 struct acpi_gpe_event_info *gpe_event_info);
122
140acpi_status 123acpi_status
141acpi_ev_gpe_initialize ( 124acpi_ev_walk_gpe_list (
142 void); 125 ACPI_GPE_CALLBACK gpe_walk_callback,
126 u32 flags);
127
128acpi_status
129acpi_ev_delete_gpe_handlers (
130 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
131 struct acpi_gpe_block_info *gpe_block);
143 132
144acpi_status 133acpi_status
145acpi_ev_create_gpe_block ( 134acpi_ev_create_gpe_block (
@@ -154,11 +143,6 @@ acpi_status
154acpi_ev_delete_gpe_block ( 143acpi_ev_delete_gpe_block (
155 struct acpi_gpe_block_info *gpe_block); 144 struct acpi_gpe_block_info *gpe_block);
156 145
157acpi_status
158acpi_ev_delete_gpe_handlers (
159 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
160 struct acpi_gpe_block_info *gpe_block);
161
162u32 146u32
163acpi_ev_gpe_dispatch ( 147acpi_ev_gpe_dispatch (
164 struct acpi_gpe_event_info *gpe_event_info, 148 struct acpi_gpe_event_info *gpe_event_info,
@@ -177,10 +161,14 @@ acpi_status
177acpi_ev_check_for_wake_only_gpe ( 161acpi_ev_check_for_wake_only_gpe (
178 struct acpi_gpe_event_info *gpe_event_info); 162 struct acpi_gpe_event_info *gpe_event_info);
179 163
164acpi_status
165acpi_ev_gpe_initialize (
166 void);
167
168
180/* 169/*
181 * Evregion - Address Space handling 170 * evregion - Address Space handling
182 */ 171 */
183
184acpi_status 172acpi_status
185acpi_ev_install_region_handlers ( 173acpi_ev_install_region_handlers (
186 void); 174 void);
@@ -198,13 +186,6 @@ acpi_ev_address_space_dispatch (
198 void *value); 186 void *value);
199 187
200acpi_status 188acpi_status
201acpi_ev_install_handler (
202 acpi_handle obj_handle,
203 u32 level,
204 void *context,
205 void **return_value);
206
207acpi_status
208acpi_ev_attach_region ( 189acpi_ev_attach_region (
209 union acpi_operand_object *handler_obj, 190 union acpi_operand_object *handler_obj,
210 union acpi_operand_object *region_obj, 191 union acpi_operand_object *region_obj,
@@ -233,17 +214,10 @@ acpi_ev_execute_reg_method (
233 union acpi_operand_object *region_obj, 214 union acpi_operand_object *region_obj,
234 u32 function); 215 u32 function);
235 216
236acpi_status
237acpi_ev_reg_run (
238 acpi_handle obj_handle,
239 u32 level,
240 void *context,
241 void **return_value);
242 217
243/* 218/*
244 * Evregini - Region initialization and setup 219 * evregini - Region initialization and setup
245 */ 220 */
246
247acpi_status 221acpi_status
248acpi_ev_system_memory_region_setup ( 222acpi_ev_system_memory_region_setup (
249 acpi_handle handle, 223 acpi_handle handle,
@@ -293,9 +267,8 @@ acpi_ev_initialize_region (
293 267
294 268
295/* 269/*
296 * Evsci - SCI (System Control Interrupt) handling/dispatch 270 * evsci - SCI (System Control Interrupt) handling/dispatch
297 */ 271 */
298
299u32 ACPI_SYSTEM_XFACE 272u32 ACPI_SYSTEM_XFACE
300acpi_ev_gpe_xrupt_handler ( 273acpi_ev_gpe_xrupt_handler (
301 void *context); 274 void *context);
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 53f8b50fac1..60d737b2d70 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -48,7 +48,6 @@
48/* 48/*
49 * Exceptions returned by external ACPI interfaces 49 * Exceptions returned by external ACPI interfaces
50 */ 50 */
51
52#define AE_CODE_ENVIRONMENTAL 0x0000 51#define AE_CODE_ENVIRONMENTAL 0x0000
53#define AE_CODE_PROGRAMMER 0x1000 52#define AE_CODE_PROGRAMMER 0x1000
54#define AE_CODE_ACPI_TABLES 0x2000 53#define AE_CODE_ACPI_TABLES 0x2000
@@ -99,6 +98,7 @@
99 98
100#define AE_CODE_ENV_MAX 0x001E 99#define AE_CODE_ENV_MAX 0x001E
101 100
101
102/* 102/*
103 * Programmer exceptions 103 * Programmer exceptions
104 */ 104 */
@@ -168,6 +168,7 @@
168 168
169#define AE_CODE_AML_MAX 0x0021 169#define AE_CODE_AML_MAX 0x0021
170 170
171
171/* 172/*
172 * Internal exceptions used for control 173 * Internal exceptions used for control
173 */ 174 */
@@ -188,6 +189,7 @@
188 189
189#ifdef DEFINE_ACPI_GLOBALS 190#ifdef DEFINE_ACPI_GLOBALS
190 191
192
191/* 193/*
192 * String versions of the exception codes above 194 * String versions of the exception codes above
193 * These strings must match the corresponding defines exactly 195 * These strings must match the corresponding defines exactly
@@ -304,5 +306,4 @@ char const *acpi_gbl_exception_names_ctrl[] =
304 306
305#endif /* ACPI GLOBALS */ 307#endif /* ACPI GLOBALS */
306 308
307
308#endif /* __ACEXCEP_H__ */ 309#endif /* __ACEXCEP_H__ */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index c7f387a972c..4946696088c 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -146,15 +146,15 @@ ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
146ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; 146ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS;
147ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; 147ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
148/* 148/*
149 * Since there may be multiple SSDTs and PSDTS, a single pointer is not 149 * Since there may be multiple SSDTs and PSDTs, a single pointer is not
150 * sufficient; Therefore, there isn't one! 150 * sufficient; Therefore, there isn't one!
151 */ 151 */
152 152
153 153
154/* 154/*
155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths 155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths:
156 * If we are running a method that exists in a 32-bit ACPI table. 156 * If we are executing a method that exists in a 32-bit ACPI table,
157 * Use only 32 bits of the Integer for conversion. 157 * use only the lower 32 bits of the (internal) 64-bit Integer.
158 */ 158 */
159ACPI_EXTERN u8 acpi_gbl_integer_bit_width; 159ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
160ACPI_EXTERN u8 acpi_gbl_integer_byte_width; 160ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
@@ -246,6 +246,7 @@ ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer;
246ACPI_EXTERN u32 acpi_gbl_deepest_nesting; 246ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
247#endif 247#endif
248 248
249
249/***************************************************************************** 250/*****************************************************************************
250 * 251 *
251 * Interpreter globals 252 * Interpreter globals
@@ -268,6 +269,7 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step;
268 269
269ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; 270ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root;
270 271
272
271/***************************************************************************** 273/*****************************************************************************
272 * 274 *
273 * Hardware globals 275 * Hardware globals
@@ -298,7 +300,6 @@ ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock;
298 * 300 *
299 ****************************************************************************/ 301 ****************************************************************************/
300 302
301
302ACPI_EXTERN u8 acpi_gbl_db_output_flags; 303ACPI_EXTERN u8 acpi_gbl_db_output_flags;
303 304
304#ifdef ACPI_DISASSEMBLER 305#ifdef ACPI_DISASSEMBLER
@@ -353,5 +354,4 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
353 354
354#endif /* ACPI_DEBUGGER */ 355#endif /* ACPI_DEBUGGER */
355 356
356
357#endif /* __ACGLOBAL_H__ */ 357#endif /* __ACGLOBAL_H__ */
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 28ad1398c15..9d63641b8e7 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -46,22 +46,26 @@
46 46
47 47
48/* PM Timer ticks per second (HZ) */ 48/* PM Timer ticks per second (HZ) */
49
49#define PM_TIMER_FREQUENCY 3579545 50#define PM_TIMER_FREQUENCY 3579545
50 51
52/* Values for the _SST reserved method */
51 53
52/* Prototypes */ 54#define ACPI_SST_INDICATOR_OFF 0
55#define ACPI_SST_WORKING 1
56#define ACPI_SST_WAKING 2
57#define ACPI_SST_SLEEPING 3
58#define ACPI_SST_SLEEP_CONTEXT 4
53 59
54 60
55acpi_status 61/* Prototypes */
56acpi_hw_initialize (
57 void);
58 62
59acpi_status
60acpi_hw_shutdown (
61 void);
62 63
64/*
65 * hwacpi - high level functions
66 */
63acpi_status 67acpi_status
64acpi_hw_initialize_system_info ( 68acpi_hw_initialize (
65 void); 69 void);
66 70
67acpi_status 71acpi_status
@@ -72,12 +76,10 @@ u32
72acpi_hw_get_mode ( 76acpi_hw_get_mode (
73 void); 77 void);
74 78
75u32
76acpi_hw_get_mode_capabilities (
77 void);
78
79/* Register I/O Prototypes */
80 79
80/*
81 * hwregs - ACPI Register I/O
82 */
81struct acpi_bit_register_info * 83struct acpi_bit_register_info *
82acpi_hw_get_bit_register_info ( 84acpi_hw_get_bit_register_info (
83 u32 register_id); 85 u32 register_id);
@@ -111,8 +113,9 @@ acpi_hw_clear_acpi_status (
111 u32 flags); 113 u32 flags);
112 114
113 115
114/* GPE support */ 116/*
115 117 * hwgpe - GPE support
118 */
116acpi_status 119acpi_status
117acpi_hw_write_gpe_enable_reg ( 120acpi_hw_write_gpe_enable_reg (
118 struct acpi_gpe_event_info *gpe_event_info); 121 struct acpi_gpe_event_info *gpe_event_info);
@@ -131,12 +134,12 @@ acpi_hw_clear_gpe_block (
131 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 134 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
132 struct acpi_gpe_block_info *gpe_block); 135 struct acpi_gpe_block_info *gpe_block);
133 136
134#ifdef ACPI_FUTURE_USAGE 137#ifdef ACPI_FUTURE_USAGE
135acpi_status 138acpi_status
136acpi_hw_get_gpe_status ( 139acpi_hw_get_gpe_status (
137 struct acpi_gpe_event_info *gpe_event_info, 140 struct acpi_gpe_event_info *gpe_event_info,
138 acpi_event_status *event_status); 141 acpi_event_status *event_status);
139#endif 142#endif /* ACPI_FUTURE_USAGE */
140 143
141acpi_status 144acpi_status
142acpi_hw_disable_all_gpes ( 145acpi_hw_disable_all_gpes (
@@ -155,15 +158,11 @@ acpi_hw_enable_runtime_gpe_block (
155 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 158 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
156 struct acpi_gpe_block_info *gpe_block); 159 struct acpi_gpe_block_info *gpe_block);
157 160
158acpi_status
159acpi_hw_enable_wakeup_gpe_block (
160 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
161 struct acpi_gpe_block_info *gpe_block);
162
163
164/* ACPI Timer prototypes */
165 161
166#ifdef ACPI_FUTURE_USAGE 162#ifdef ACPI_FUTURE_USAGE
163/*
164 * hwtimer - ACPI Timer prototypes
165 */
167acpi_status 166acpi_status
168acpi_get_timer_resolution ( 167acpi_get_timer_resolution (
169 u32 *resolution); 168 u32 *resolution);
@@ -177,6 +176,7 @@ acpi_get_timer_duration (
177 u32 start_ticks, 176 u32 start_ticks,
178 u32 end_ticks, 177 u32 end_ticks,
179 u32 *time_elapsed); 178 u32 *time_elapsed);
180#endif /* ACPI_FUTURE_USAGE */ 179#endif /* ACPI_FUTURE_USAGE */
180
181 181
182#endif /* __ACHWARE_H__ */ 182#endif /* __ACHWARE_H__ */
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index c5301f5ffaf..5c7172477a0 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -48,37 +48,9 @@
48#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) 48#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
49 49
50 50
51acpi_status
52acpi_ex_resolve_operands (
53 u16 opcode,
54 union acpi_operand_object **stack_ptr,
55 struct acpi_walk_state *walk_state);
56
57acpi_status
58acpi_ex_check_object_type (
59 acpi_object_type type_needed,
60 acpi_object_type this_type,
61 void *object);
62
63/*
64 * exxface - External interpreter interfaces
65 */
66
67acpi_status
68acpi_ex_load_table (
69 acpi_table_type table_id);
70
71acpi_status
72acpi_ex_execute_method (
73 struct acpi_namespace_node *method_node,
74 union acpi_operand_object **params,
75 union acpi_operand_object **return_obj_desc);
76
77
78/* 51/*
79 * exconvrt - object conversion 52 * exconvrt - object conversion
80 */ 53 */
81
82acpi_status 54acpi_status
83acpi_ex_convert_to_integer ( 55acpi_ex_convert_to_integer (
84 union acpi_operand_object *obj_desc, 56 union acpi_operand_object *obj_desc,
@@ -110,17 +82,10 @@ acpi_ex_convert_to_target_type (
110 union acpi_operand_object **result_desc, 82 union acpi_operand_object **result_desc,
111 struct acpi_walk_state *walk_state); 83 struct acpi_walk_state *walk_state);
112 84
113u32
114acpi_ex_convert_to_ascii (
115 acpi_integer integer,
116 u16 base,
117 u8 *string,
118 u8 max_length);
119 85
120/* 86/*
121 * exfield - ACPI AML (p-code) execution - field manipulation 87 * exfield - ACPI AML (p-code) execution - field manipulation
122 */ 88 */
123
124acpi_status 89acpi_status
125acpi_ex_common_buffer_setup ( 90acpi_ex_common_buffer_setup (
126 union acpi_operand_object *obj_desc, 91 union acpi_operand_object *obj_desc,
@@ -128,42 +93,6 @@ acpi_ex_common_buffer_setup (
128 u32 *datum_count); 93 u32 *datum_count);
129 94
130acpi_status 95acpi_status
131acpi_ex_extract_from_field (
132 union acpi_operand_object *obj_desc,
133 void *buffer,
134 u32 buffer_length);
135
136acpi_status
137acpi_ex_insert_into_field (
138 union acpi_operand_object *obj_desc,
139 void *buffer,
140 u32 buffer_length);
141
142acpi_status
143acpi_ex_setup_region (
144 union acpi_operand_object *obj_desc,
145 u32 field_datum_byte_offset);
146
147acpi_status
148acpi_ex_access_region (
149 union acpi_operand_object *obj_desc,
150 u32 field_datum_byte_offset,
151 acpi_integer *value,
152 u32 read_write);
153
154u8
155acpi_ex_register_overflow (
156 union acpi_operand_object *obj_desc,
157 acpi_integer value);
158
159acpi_status
160acpi_ex_field_datum_io (
161 union acpi_operand_object *obj_desc,
162 u32 field_datum_byte_offset,
163 acpi_integer *value,
164 u32 read_write);
165
166acpi_status
167acpi_ex_write_with_update_rule ( 96acpi_ex_write_with_update_rule (
168 union acpi_operand_object *obj_desc, 97 union acpi_operand_object *obj_desc,
169 acpi_integer mask, 98 acpi_integer mask,
@@ -198,28 +127,33 @@ acpi_ex_write_data_to_field (
198 union acpi_operand_object *obj_desc, 127 union acpi_operand_object *obj_desc,
199 union acpi_operand_object **result_desc); 128 union acpi_operand_object **result_desc);
200 129
130
201/* 131/*
202 * exmisc - ACPI AML (p-code) execution - specific opcodes 132 * exfldio - low level field I/O
203 */ 133 */
204
205acpi_status 134acpi_status
206acpi_ex_opcode_3A_0T_0R ( 135acpi_ex_extract_from_field (
207 struct acpi_walk_state *walk_state); 136 union acpi_operand_object *obj_desc,
137 void *buffer,
138 u32 buffer_length);
208 139
209acpi_status 140acpi_status
210acpi_ex_opcode_3A_1T_1R ( 141acpi_ex_insert_into_field (
211 struct acpi_walk_state *walk_state); 142 union acpi_operand_object *obj_desc,
143 void *buffer,
144 u32 buffer_length);
212 145
213acpi_status 146acpi_status
214acpi_ex_opcode_6A_0T_1R ( 147acpi_ex_access_region (
215 struct acpi_walk_state *walk_state); 148 union acpi_operand_object *obj_desc,
149 u32 field_datum_byte_offset,
150 acpi_integer *value,
151 u32 read_write);
216 152
217u8
218acpi_ex_do_match (
219 u32 match_op,
220 union acpi_operand_object *package_obj,
221 union acpi_operand_object *match_obj);
222 153
154/*
155 * exmisc - misc support routines
156 */
223acpi_status 157acpi_status
224acpi_ex_get_object_reference ( 158acpi_ex_get_object_reference (
225 union acpi_operand_object *obj_desc, 159 union acpi_operand_object *obj_desc,
@@ -227,13 +161,6 @@ acpi_ex_get_object_reference (
227 struct acpi_walk_state *walk_state); 161 struct acpi_walk_state *walk_state);
228 162
229acpi_status 163acpi_status
230acpi_ex_resolve_multiple (
231 struct acpi_walk_state *walk_state,
232 union acpi_operand_object *operand,
233 acpi_object_type *return_type,
234 union acpi_operand_object **return_desc);
235
236acpi_status
237acpi_ex_concat_template ( 164acpi_ex_concat_template (
238 union acpi_operand_object *obj_desc, 165 union acpi_operand_object *obj_desc,
239 union acpi_operand_object *obj_desc2, 166 union acpi_operand_object *obj_desc2,
@@ -308,13 +235,6 @@ acpi_ex_create_method (
308/* 235/*
309 * exconfig - dynamic table load/unload 236 * exconfig - dynamic table load/unload
310 */ 237 */
311
312acpi_status
313acpi_ex_add_table (
314 struct acpi_table_header *table,
315 struct acpi_namespace_node *parent_node,
316 union acpi_operand_object **ddb_handle);
317
318acpi_status 238acpi_status
319acpi_ex_load_op ( 239acpi_ex_load_op (
320 union acpi_operand_object *obj_desc, 240 union acpi_operand_object *obj_desc,
@@ -334,7 +254,6 @@ acpi_ex_unload_table (
334/* 254/*
335 * exmutex - mutex support 255 * exmutex - mutex support
336 */ 256 */
337
338acpi_status 257acpi_status
339acpi_ex_acquire_mutex ( 258acpi_ex_acquire_mutex (
340 union acpi_operand_object *time_desc, 259 union acpi_operand_object *time_desc,
@@ -354,15 +273,10 @@ void
354acpi_ex_unlink_mutex ( 273acpi_ex_unlink_mutex (
355 union acpi_operand_object *obj_desc); 274 union acpi_operand_object *obj_desc);
356 275
357void
358acpi_ex_link_mutex (
359 union acpi_operand_object *obj_desc,
360 struct acpi_thread_state *thread);
361 276
362/* 277/*
363 * exprep - ACPI AML (p-code) execution - prep utilities 278 * exprep - ACPI AML execution - prep utilities
364 */ 279 */
365
366acpi_status 280acpi_status
367acpi_ex_prep_common_field_object ( 281acpi_ex_prep_common_field_object (
368 union acpi_operand_object *obj_desc, 282 union acpi_operand_object *obj_desc,
@@ -375,10 +289,10 @@ acpi_status
375acpi_ex_prep_field_value ( 289acpi_ex_prep_field_value (
376 struct acpi_create_field_info *info); 290 struct acpi_create_field_info *info);
377 291
292
378/* 293/*
379 * exsystem - Interface to OS services 294 * exsystem - Interface to OS services
380 */ 295 */
381
382acpi_status 296acpi_status
383acpi_ex_system_do_notify_op ( 297acpi_ex_system_do_notify_op (
384 union acpi_operand_object *value, 298 union acpi_operand_object *value,
@@ -421,9 +335,8 @@ acpi_ex_system_wait_semaphore (
421 335
422 336
423/* 337/*
424 * exmonadic - ACPI AML (p-code) execution, monadic operators 338 * exoparg1 - ACPI AML execution, 1 operand
425 */ 339 */
426
427acpi_status 340acpi_status
428acpi_ex_opcode_0A_0T_1R ( 341acpi_ex_opcode_0A_0T_1R (
429 struct acpi_walk_state *walk_state); 342 struct acpi_walk_state *walk_state);
@@ -445,9 +358,8 @@ acpi_ex_opcode_1A_1T_0R (
445 struct acpi_walk_state *walk_state); 358 struct acpi_walk_state *walk_state);
446 359
447/* 360/*
448 * exdyadic - ACPI AML (p-code) execution, dyadic operators 361 * exoparg2 - ACPI AML execution, 2 operands
449 */ 362 */
450
451acpi_status 363acpi_status
452acpi_ex_opcode_2A_0T_0R ( 364acpi_ex_opcode_2A_0T_0R (
453 struct acpi_walk_state *walk_state); 365 struct acpi_walk_state *walk_state);
@@ -466,21 +378,56 @@ acpi_ex_opcode_2A_2T_1R (
466 378
467 379
468/* 380/*
469 * exresolv - Object resolution and get value functions 381 * exoparg3 - ACPI AML execution, 3 operands
382 */
383acpi_status
384acpi_ex_opcode_3A_0T_0R (
385 struct acpi_walk_state *walk_state);
386
387acpi_status
388acpi_ex_opcode_3A_1T_1R (
389 struct acpi_walk_state *walk_state);
390
391
392/*
393 * exoparg6 - ACPI AML execution, 6 operands
470 */ 394 */
395acpi_status
396acpi_ex_opcode_6A_0T_1R (
397 struct acpi_walk_state *walk_state);
398
471 399
400/*
401 * exresolv - Object resolution and get value functions
402 */
472acpi_status 403acpi_status
473acpi_ex_resolve_to_value ( 404acpi_ex_resolve_to_value (
474 union acpi_operand_object **stack_ptr, 405 union acpi_operand_object **stack_ptr,
475 struct acpi_walk_state *walk_state); 406 struct acpi_walk_state *walk_state);
476 407
477acpi_status 408acpi_status
409acpi_ex_resolve_multiple (
410 struct acpi_walk_state *walk_state,
411 union acpi_operand_object *operand,
412 acpi_object_type *return_type,
413 union acpi_operand_object **return_desc);
414
415
416/*
417 * exresnte - resolve namespace node
418 */
419acpi_status
478acpi_ex_resolve_node_to_value ( 420acpi_ex_resolve_node_to_value (
479 struct acpi_namespace_node **stack_ptr, 421 struct acpi_namespace_node **stack_ptr,
480 struct acpi_walk_state *walk_state); 422 struct acpi_walk_state *walk_state);
481 423
424
425/*
426 * exresop - resolve operand to value
427 */
482acpi_status 428acpi_status
483acpi_ex_resolve_object_to_value ( 429acpi_ex_resolve_operands (
430 u16 opcode,
484 union acpi_operand_object **stack_ptr, 431 union acpi_operand_object **stack_ptr,
485 struct acpi_walk_state *walk_state); 432 struct acpi_walk_state *walk_state);
486 433
@@ -488,7 +435,6 @@ acpi_ex_resolve_object_to_value (
488/* 435/*
489 * exdump - Interpreter debug output routines 436 * exdump - Interpreter debug output routines
490 */ 437 */
491
492void 438void
493acpi_ex_dump_operand ( 439acpi_ex_dump_operand (
494 union acpi_operand_object *obj_desc, 440 union acpi_operand_object *obj_desc,
@@ -504,7 +450,7 @@ acpi_ex_dump_operands (
504 char *module_name, 450 char *module_name,
505 u32 line_number); 451 u32 line_number);
506 452
507#ifdef ACPI_FUTURE_USAGE 453#ifdef ACPI_FUTURE_USAGE
508void 454void
509acpi_ex_dump_object_descriptor ( 455acpi_ex_dump_object_descriptor (
510 union acpi_operand_object *object, 456 union acpi_operand_object *object,
@@ -514,46 +460,12 @@ void
514acpi_ex_dump_node ( 460acpi_ex_dump_node (
515 struct acpi_namespace_node *node, 461 struct acpi_namespace_node *node,
516 u32 flags); 462 u32 flags);
463#endif /* ACPI_FUTURE_USAGE */
517 464
518void
519acpi_ex_out_string (
520 char *title,
521 char *value);
522
523void
524acpi_ex_out_pointer (
525 char *title,
526 void *value);
527
528void
529acpi_ex_out_integer (
530 char *title,
531 u32 value);
532
533void
534acpi_ex_out_address (
535 char *title,
536 acpi_physical_address value);
537#endif /* ACPI_FUTURE_USAGE */
538 465
539/* 466/*
540 * exnames - interpreter/scanner name load/execute 467 * exnames - AML namestring support
541 */ 468 */
542
543char *
544acpi_ex_allocate_name_string (
545 u32 prefix_count,
546 u32 num_name_segs);
547
548u32
549acpi_ex_good_char (
550 u32 character);
551
552acpi_status
553acpi_ex_name_segment (
554 u8 **in_aml_address,
555 char *name_string);
556
557acpi_status 469acpi_status
558acpi_ex_get_name_string ( 470acpi_ex_get_name_string (
559 acpi_object_type data_type, 471 acpi_object_type data_type,
@@ -561,16 +473,10 @@ acpi_ex_get_name_string (
561 char **out_name_string, 473 char **out_name_string,
562 u32 *out_name_length); 474 u32 *out_name_length);
563 475
564acpi_status
565acpi_ex_do_name (
566 acpi_object_type data_type,
567 acpi_interpreter_mode load_exec_mode);
568
569 476
570/* 477/*
571 * exstore - Object store support 478 * exstore - Object store support
572 */ 479 */
573
574acpi_status 480acpi_status
575acpi_ex_store ( 481acpi_ex_store (
576 union acpi_operand_object *val_desc, 482 union acpi_operand_object *val_desc,
@@ -578,12 +484,6 @@ acpi_ex_store (
578 struct acpi_walk_state *walk_state); 484 struct acpi_walk_state *walk_state);
579 485
580acpi_status 486acpi_status
581acpi_ex_store_object_to_index (
582 union acpi_operand_object *val_desc,
583 union acpi_operand_object *dest_desc,
584 struct acpi_walk_state *walk_state);
585
586acpi_status
587acpi_ex_store_object_to_node ( 487acpi_ex_store_object_to_node (
588 union acpi_operand_object *source_desc, 488 union acpi_operand_object *source_desc,
589 struct acpi_namespace_node *node, 489 struct acpi_namespace_node *node,
@@ -593,10 +493,10 @@ acpi_ex_store_object_to_node (
593#define ACPI_IMPLICIT_CONVERSION TRUE 493#define ACPI_IMPLICIT_CONVERSION TRUE
594#define ACPI_NO_IMPLICIT_CONVERSION FALSE 494#define ACPI_NO_IMPLICIT_CONVERSION FALSE
595 495
496
596/* 497/*
597 * exstoren 498 * exstoren - resolve/store object
598 */ 499 */
599
600acpi_status 500acpi_status
601acpi_ex_resolve_object ( 501acpi_ex_resolve_object (
602 union acpi_operand_object **source_desc_ptr, 502 union acpi_operand_object **source_desc_ptr,
@@ -612,9 +512,8 @@ acpi_ex_store_object_to_object (
612 512
613 513
614/* 514/*
615 * excopy - object copy 515 * exstorob - store object - buffer/string
616 */ 516 */
617
618acpi_status 517acpi_status
619acpi_ex_store_buffer_to_buffer ( 518acpi_ex_store_buffer_to_buffer (
620 union acpi_operand_object *source_desc, 519 union acpi_operand_object *source_desc,
@@ -625,6 +524,10 @@ acpi_ex_store_string_to_string (
625 union acpi_operand_object *source_desc, 524 union acpi_operand_object *source_desc,
626 union acpi_operand_object *target_desc); 525 union acpi_operand_object *target_desc);
627 526
527
528/*
529 * excopy - object copy
530 */
628acpi_status 531acpi_status
629acpi_ex_copy_integer_to_index_field ( 532acpi_ex_copy_integer_to_index_field (
630 union acpi_operand_object *source_desc, 533 union acpi_operand_object *source_desc,
@@ -645,10 +548,10 @@ acpi_ex_copy_integer_to_buffer_field (
645 union acpi_operand_object *source_desc, 548 union acpi_operand_object *source_desc,
646 union acpi_operand_object *target_desc); 549 union acpi_operand_object *target_desc);
647 550
551
648/* 552/*
649 * exutils - interpreter/scanner utilities 553 * exutils - interpreter/scanner utilities
650 */ 554 */
651
652acpi_status 555acpi_status
653acpi_ex_enter_interpreter ( 556acpi_ex_enter_interpreter (
654 void); 557 void);
@@ -669,11 +572,6 @@ void
669acpi_ex_release_global_lock ( 572acpi_ex_release_global_lock (
670 u8 locked); 573 u8 locked);
671 574
672u32
673acpi_ex_digits_needed (
674 acpi_integer value,
675 u32 base);
676
677void 575void
678acpi_ex_eisa_id_to_string ( 576acpi_ex_eisa_id_to_string (
679 u32 numeric_id, 577 u32 numeric_id,
@@ -688,7 +586,6 @@ acpi_ex_unsigned_integer_to_string (
688/* 586/*
689 * exregion - default op_region handlers 587 * exregion - default op_region handlers
690 */ 588 */
691
692acpi_status 589acpi_status
693acpi_ex_system_memory_space_handler ( 590acpi_ex_system_memory_space_handler (
694 u32 function, 591 u32 function,
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 01d3b4bc0c8..030e641115c 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -72,7 +72,6 @@ typedef u32 acpi_mutex_handle;
72 * 72 *
73 * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also! 73 * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also!
74 */ 74 */
75
76#define ACPI_MTX_EXECUTE 0 75#define ACPI_MTX_EXECUTE 0
77#define ACPI_MTX_INTERPRETER 1 76#define ACPI_MTX_INTERPRETER 1
78#define ACPI_MTX_PARSER 2 77#define ACPI_MTX_PARSER 2
@@ -151,13 +150,13 @@ typedef u16 acpi_owner_id;
151#define ACPI_FIELD_DWORD_GRANULARITY 4 150#define ACPI_FIELD_DWORD_GRANULARITY 4
152#define ACPI_FIELD_QWORD_GRANULARITY 8 151#define ACPI_FIELD_QWORD_GRANULARITY 8
153 152
153
154/***************************************************************************** 154/*****************************************************************************
155 * 155 *
156 * Namespace typedefs and structs 156 * Namespace typedefs and structs
157 * 157 *
158 ****************************************************************************/ 158 ****************************************************************************/
159 159
160
161/* Operational modes of the AML interpreter/scanner */ 160/* Operational modes of the AML interpreter/scanner */
162 161
163typedef enum 162typedef enum
@@ -176,7 +175,6 @@ typedef enum
176 * data_type is used to differentiate between internal descriptors, and MUST 175 * data_type is used to differentiate between internal descriptors, and MUST
177 * be the first byte in this structure. 176 * be the first byte in this structure.
178 */ 177 */
179
180union acpi_name_union 178union acpi_name_union
181{ 179{
182 u32 integer; 180 u32 integer;
@@ -415,7 +413,6 @@ struct acpi_field_info
415 * 413 *
416 ****************************************************************************/ 414 ****************************************************************************/
417 415
418
419#define ACPI_CONTROL_NORMAL 0xC0 416#define ACPI_CONTROL_NORMAL 0xC0
420#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 417#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
421#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 418#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
@@ -424,6 +421,7 @@ struct acpi_field_info
424 421
425 422
426/* Forward declarations */ 423/* Forward declarations */
424
427struct acpi_walk_state ; 425struct acpi_walk_state ;
428struct acpi_obj_mutex; 426struct acpi_obj_mutex;
429union acpi_parse_object ; 427union acpi_parse_object ;
@@ -601,7 +599,6 @@ struct acpi_opcode_info
601 u8 type; /* Opcode type */ 599 u8 type; /* Opcode type */
602}; 600};
603 601
604
605union acpi_parse_value 602union acpi_parse_value
606{ 603{
607 acpi_integer integer; /* Integer constant (Up to 64 bits) */ 604 acpi_integer integer; /* Integer constant (Up to 64 bits) */
@@ -613,7 +610,6 @@ union acpi_parse_value
613 union acpi_parse_object *arg; /* arguments and contained ops */ 610 union acpi_parse_object *arg; /* arguments and contained ops */
614}; 611};
615 612
616
617#define ACPI_PARSE_COMMON \ 613#define ACPI_PARSE_COMMON \
618 u8 data_type; /* To differentiate various internal objs */\ 614 u8 data_type; /* To differentiate various internal objs */\
619 u8 flags; /* Type of Op */\ 615 u8 flags; /* Type of Op */\
@@ -691,7 +687,6 @@ struct acpi_parse_obj_asl
691 char parse_op_name[12]; 687 char parse_op_name[12];
692}; 688};
693 689
694
695union acpi_parse_object 690union acpi_parse_object
696{ 691{
697 struct acpi_parse_obj_common common; 692 struct acpi_parse_obj_common common;
@@ -834,7 +829,6 @@ struct acpi_bit_register_info
834 * 829 *
835 ****************************************************************************/ 830 ****************************************************************************/
836 831
837
838/* resource_type values */ 832/* resource_type values */
839 833
840#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 834#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index fcaced16b16..09be937d2c3 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -539,11 +539,6 @@
539 539
540 540
541#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) 541#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
542
543#ifdef ACPI_FUTURE_USAGE
544#define ACPI_DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b)
545#endif
546
547#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) 542#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d)
548#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) 543#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a)
549#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) 544#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
@@ -596,11 +591,6 @@
596#define ACPI_DUMP_STACK_ENTRY(a) 591#define ACPI_DUMP_STACK_ENTRY(a)
597#define ACPI_DUMP_OPERANDS(a,b,c,d,e) 592#define ACPI_DUMP_OPERANDS(a,b,c,d,e)
598#define ACPI_DUMP_ENTRY(a,b) 593#define ACPI_DUMP_ENTRY(a,b)
599
600#ifdef ACPI_FUTURE_USAGE
601#define ACPI_DUMP_TABLES(a,b)
602#endif
603
604#define ACPI_DUMP_PATHNAME(a,b,c,d) 594#define ACPI_DUMP_PATHNAME(a,b,c,d)
605#define ACPI_DUMP_RESOURCE_LIST(a) 595#define ACPI_DUMP_RESOURCE_LIST(a)
606#define ACPI_DUMP_BUFFER(a,b) 596#define ACPI_DUMP_BUFFER(a,b)
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
new file mode 100644
index 00000000000..deb7cb06f5f
--- /dev/null
+++ b/include/acpi/acnames.h
@@ -0,0 +1,84 @@
1/******************************************************************************
2 *
3 * Name: acnames.h - Global names and strings
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACNAMES_H__
45#define __ACNAMES_H__
46
47/* Method names - these methods can appear anywhere in the namespace */
48
49#define METHOD_NAME__HID "_HID"
50#define METHOD_NAME__CID "_CID"
51#define METHOD_NAME__UID "_UID"
52#define METHOD_NAME__ADR "_ADR"
53#define METHOD_NAME__INI "_INI"
54#define METHOD_NAME__STA "_STA"
55#define METHOD_NAME__REG "_REG"
56#define METHOD_NAME__SEG "_SEG"
57#define METHOD_NAME__BBN "_BBN"
58#define METHOD_NAME__PRT "_PRT"
59#define METHOD_NAME__CRS "_CRS"
60#define METHOD_NAME__PRS "_PRS"
61#define METHOD_NAME__PRW "_PRW"
62#define METHOD_NAME__SRS "_SRS"
63
64/* Method names - these methods must appear at the namespace root */
65
66#define METHOD_NAME__BFS "\\_BFS"
67#define METHOD_NAME__GTS "\\_GTS"
68#define METHOD_NAME__PTS "\\_PTS"
69#define METHOD_NAME__SST "\\_SI._SST"
70#define METHOD_NAME__WAK "\\_WAK"
71
72/* Definitions of the predefined namespace names */
73
74#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
75#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
76#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
77
78#define ACPI_NS_ROOT_PATH "\\"
79#define ACPI_NS_SYSTEM_BUS "_SB_"
80
81
82#endif /* __ACNAMES_H__ */
83
84
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index 8b3cdc3566b..d1b3ce80056 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -57,17 +57,6 @@
57#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ 57#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
58#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ 58#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
59 59
60
61/* Definitions of the predefined namespace names */
62
63#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
64#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
65#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
66
67#define ACPI_NS_ROOT_PATH "\\"
68#define ACPI_NS_SYSTEM_BUS "_SB_"
69
70
71/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ 60/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
72 61
73#define ACPI_NS_NO_UPSEARCH 0 62#define ACPI_NS_NO_UPSEARCH 0
@@ -80,10 +69,9 @@
80#define ACPI_NS_WALK_NO_UNLOCK FALSE 69#define ACPI_NS_WALK_NO_UNLOCK FALSE
81 70
82 71
83acpi_status 72/*
84acpi_ns_load_namespace ( 73 * nsinit - Namespace initialization
85 void); 74 */
86
87acpi_status 75acpi_status
88acpi_ns_initialize_objects ( 76acpi_ns_initialize_objects (
89 void); 77 void);
@@ -93,23 +81,22 @@ acpi_ns_initialize_devices (
93 void); 81 void);
94 82
95 83
96/* Namespace init - nsxfinit */ 84/*
97 85 * nsload - Namespace loading
86 */
98acpi_status 87acpi_status
99acpi_ns_init_one_device ( 88acpi_ns_load_namespace (
100 acpi_handle obj_handle, 89 void);
101 u32 nesting_level,
102 void *context,
103 void **return_value);
104 90
105acpi_status 91acpi_status
106acpi_ns_init_one_object ( 92acpi_ns_load_table (
107 acpi_handle obj_handle, 93 struct acpi_table_desc *table_desc,
108 u32 level, 94 struct acpi_namespace_node *node);
109 void *context,
110 void **return_value);
111 95
112 96
97/*
98 * nswalk - walk the namespace
99 */
113acpi_status 100acpi_status
114acpi_ns_walk_namespace ( 101acpi_ns_walk_namespace (
115 acpi_object_type type, 102 acpi_object_type type,
@@ -126,37 +113,24 @@ acpi_ns_get_next_node (
126 struct acpi_namespace_node *parent, 113 struct acpi_namespace_node *parent,
127 struct acpi_namespace_node *child); 114 struct acpi_namespace_node *child);
128 115
129void
130acpi_ns_delete_namespace_by_owner (
131 u16 table_id);
132
133
134/* Namespace loading - nsload */
135
136acpi_status
137acpi_ns_one_complete_parse (
138 u32 pass_number,
139 struct acpi_table_desc *table_desc);
140 116
117/*
118 * nsparse - table parsing
119 */
141acpi_status 120acpi_status
142acpi_ns_parse_table ( 121acpi_ns_parse_table (
143 struct acpi_table_desc *table_desc, 122 struct acpi_table_desc *table_desc,
144 struct acpi_namespace_node *scope); 123 struct acpi_namespace_node *scope);
145 124
146acpi_status 125acpi_status
147acpi_ns_load_table ( 126acpi_ns_one_complete_parse (
148 struct acpi_table_desc *table_desc, 127 u32 pass_number,
149 struct acpi_namespace_node *node); 128 struct acpi_table_desc *table_desc);
150
151acpi_status
152acpi_ns_load_table_by_type (
153 acpi_table_type table_type);
154 129
155 130
156/* 131/*
157 * Top-level namespace access - nsaccess 132 * nsaccess - Top-level namespace access
158 */ 133 */
159
160acpi_status 134acpi_status
161acpi_ns_root_initialize ( 135acpi_ns_root_initialize (
162 void); 136 void);
@@ -173,9 +147,8 @@ acpi_ns_lookup (
173 147
174 148
175/* 149/*
176 * Named object allocation/deallocation - nsalloc 150 * nsalloc - Named object allocation/deallocation
177 */ 151 */
178
179struct acpi_namespace_node * 152struct acpi_namespace_node *
180acpi_ns_create_node ( 153acpi_ns_create_node (
181 u32 name); 154 u32 name);
@@ -189,6 +162,10 @@ acpi_ns_delete_namespace_subtree (
189 struct acpi_namespace_node *parent_handle); 162 struct acpi_namespace_node *parent_handle);
190 163
191void 164void
165acpi_ns_delete_namespace_by_owner (
166 u16 table_id);
167
168void
192acpi_ns_detach_object ( 169acpi_ns_detach_object (
193 struct acpi_namespace_node *node); 170 struct acpi_namespace_node *node);
194 171
@@ -201,36 +178,16 @@ acpi_ns_compare_names (
201 char *name1, 178 char *name1,
202 char *name2); 179 char *name2);
203 180
204void
205acpi_ns_remove_reference (
206 struct acpi_namespace_node *node);
207
208 181
209/* 182/*
210 * Namespace modification - nsmodify 183 * nsdump - Namespace dump/print utilities
211 */ 184 */
212 185#ifdef ACPI_FUTURE_USAGE
213#ifdef ACPI_FUTURE_USAGE
214acpi_status
215acpi_ns_unload_namespace (
216 acpi_handle handle);
217
218acpi_status
219acpi_ns_delete_subtree (
220 acpi_handle start_handle);
221#endif
222
223
224/*
225 * Namespace dump/print utilities - nsdump
226 */
227
228#ifdef ACPI_FUTURE_USAGE
229void 186void
230acpi_ns_dump_tables ( 187acpi_ns_dump_tables (
231 acpi_handle search_base, 188 acpi_handle search_base,
232 u32 max_depth); 189 u32 max_depth);
233#endif 190#endif /* ACPI_FUTURE_USAGE */
234 191
235void 192void
236acpi_ns_dump_entry ( 193acpi_ns_dump_entry (
@@ -249,19 +206,6 @@ acpi_ns_print_pathname (
249 u32 num_segments, 206 u32 num_segments,
250 char *pathname); 207 char *pathname);
251 208
252#ifdef ACPI_FUTURE_USAGE
253acpi_status
254acpi_ns_dump_one_device (
255 acpi_handle obj_handle,
256 u32 level,
257 void *context,
258 void **return_value);
259
260void
261acpi_ns_dump_root_devices (
262 void);
263#endif /* ACPI_FUTURE_USAGE */
264
265acpi_status 209acpi_status
266acpi_ns_dump_one_object ( 210acpi_ns_dump_one_object (
267 acpi_handle obj_handle, 211 acpi_handle obj_handle,
@@ -269,7 +213,7 @@ acpi_ns_dump_one_object (
269 void *context, 213 void *context,
270 void **return_value); 214 void **return_value);
271 215
272#ifdef ACPI_FUTURE_USAGE 216#ifdef ACPI_FUTURE_USAGE
273void 217void
274acpi_ns_dump_objects ( 218acpi_ns_dump_objects (
275 acpi_object_type type, 219 acpi_object_type type,
@@ -277,13 +221,12 @@ acpi_ns_dump_objects (
277 u32 max_depth, 221 u32 max_depth,
278 u32 ownder_id, 222 u32 ownder_id,
279 acpi_handle start_handle); 223 acpi_handle start_handle);
280#endif 224#endif /* ACPI_FUTURE_USAGE */
281 225
282 226
283/* 227/*
284 * Namespace evaluation functions - nseval 228 * nseval - Namespace evaluation functions
285 */ 229 */
286
287acpi_status 230acpi_status
288acpi_ns_evaluate_by_handle ( 231acpi_ns_evaluate_by_handle (
289 struct acpi_parameter_info *info); 232 struct acpi_parameter_info *info);
@@ -298,40 +241,14 @@ acpi_ns_evaluate_relative (
298 char *pathname, 241 char *pathname,
299 struct acpi_parameter_info *info); 242 struct acpi_parameter_info *info);
300 243
301acpi_status
302acpi_ns_execute_control_method (
303 struct acpi_parameter_info *info);
304
305acpi_status
306acpi_ns_get_object_value (
307 struct acpi_parameter_info *info);
308
309
310/*
311 * Parent/Child/Peer utility functions
312 */
313
314#ifdef ACPI_FUTURE_USAGE
315acpi_name
316acpi_ns_find_parent_name (
317 struct acpi_namespace_node *node_to_search);
318#endif
319
320 244
321/* 245/*
322 * Name and Scope manipulation - nsnames 246 * nsnames - Name and Scope manipulation
323 */ 247 */
324
325u32 248u32
326acpi_ns_opens_scope ( 249acpi_ns_opens_scope (
327 acpi_object_type type); 250 acpi_object_type type);
328 251
329void
330acpi_ns_build_external_path (
331 struct acpi_namespace_node *node,
332 acpi_size size,
333 char *name_buffer);
334
335char * 252char *
336acpi_ns_get_external_pathname ( 253acpi_ns_get_external_pathname (
337 struct acpi_namespace_node *node); 254 struct acpi_namespace_node *node);
@@ -363,9 +280,8 @@ acpi_ns_get_pathname_length (
363 280
364 281
365/* 282/*
366 * Object management for namespace nodes - nsobject 283 * nsobject - Object management for namespace nodes
367 */ 284 */
368
369acpi_status 285acpi_status
370acpi_ns_attach_object ( 286acpi_ns_attach_object (
371 struct acpi_namespace_node *node, 287 struct acpi_namespace_node *node,
@@ -399,9 +315,8 @@ acpi_ns_get_attached_data (
399 315
400 316
401/* 317/*
402 * Namespace searching and entry - nssearch 318 * nssearch - Namespace searching and entry
403 */ 319 */
404
405acpi_status 320acpi_status
406acpi_ns_search_and_enter ( 321acpi_ns_search_and_enter (
407 u32 entry_name, 322 u32 entry_name,
@@ -428,17 +343,12 @@ acpi_ns_install_node (
428 343
429 344
430/* 345/*
431 * Utility functions - nsutils 346 * nsutils - Utility functions
432 */ 347 */
433
434u8 348u8
435acpi_ns_valid_root_prefix ( 349acpi_ns_valid_root_prefix (
436 char prefix); 350 char prefix);
437 351
438u8
439acpi_ns_valid_path_separator (
440 char sep);
441
442acpi_object_type 352acpi_object_type
443acpi_ns_get_type ( 353acpi_ns_get_type (
444 struct acpi_namespace_node *node); 354 struct acpi_namespace_node *node);
@@ -511,5 +421,4 @@ struct acpi_namespace_node *
511acpi_ns_get_next_valid_node ( 421acpi_ns_get_next_valid_node (
512 struct acpi_namespace_node *node); 422 struct acpi_namespace_node *node);
513 423
514
515#endif /* __ACNAMESP_H__ */ 424#endif /* __ACNAMESP_H__ */
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 036023a940b..e079b94e4fc 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -133,6 +133,7 @@ struct acpi_object_integer
133 acpi_integer value; 133 acpi_integer value;
134}; 134};
135 135
136
136/* 137/*
137 * Note: The String and Buffer object must be identical through the Pointer 138 * Note: The String and Buffer object must be identical through the Pointer
138 * element. There is code that depends on this. 139 * element. There is code that depends on this.
@@ -468,7 +469,6 @@ union acpi_operand_object
468 * 469 *
469 *****************************************************************************/ 470 *****************************************************************************/
470 471
471
472/* Object descriptor types */ 472/* Object descriptor types */
473 473
474#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ 474#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
new file mode 100644
index 00000000000..118ecba4cf0
--- /dev/null
+++ b/include/acpi/acopcode.h
@@ -0,0 +1,325 @@
1/******************************************************************************
2 *
3 * Name: acopcode.h - AML opcode information for the AML parser and interpreter
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACOPCODE_H__
45#define __ACOPCODE_H__
46
47#define MAX_EXTENDED_OPCODE 0x88
48#define NUM_EXTENDED_OPCODE (MAX_EXTENDED_OPCODE + 1)
49#define MAX_INTERNAL_OPCODE
50#define NUM_INTERNAL_OPCODE (MAX_INTERNAL_OPCODE + 1)
51
52/* Used for non-assigned opcodes */
53
54#define _UNK 0x6B
55
56/*
57 * Reserved ASCII characters. Do not use any of these for
58 * internal opcodes, since they are used to differentiate
59 * name strings from AML opcodes
60 */
61#define _ASC 0x6C
62#define _NAM 0x6C
63#define _PFX 0x6D
64
65
66/*
67 * All AML opcodes and the parse-time arguments for each. Used by the AML
68 * parser Each list is compressed into a 32-bit number and stored in the
69 * master opcode table (in psopcode.c).
70 */
71#define ARGP_ACCESSFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
72#define ARGP_ACQUIRE_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_WORDDATA)
73#define ARGP_ADD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
74#define ARGP_ALIAS_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_NAME)
75#define ARGP_ARG0 ARG_NONE
76#define ARGP_ARG1 ARG_NONE
77#define ARGP_ARG2 ARG_NONE
78#define ARGP_ARG3 ARG_NONE
79#define ARGP_ARG4 ARG_NONE
80#define ARGP_ARG5 ARG_NONE
81#define ARGP_ARG6 ARG_NONE
82#define ARGP_BANK_FIELD_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_TERMARG, ARGP_BYTEDATA, ARGP_FIELDLIST)
83#define ARGP_BIT_AND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
84#define ARGP_BIT_NAND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
85#define ARGP_BIT_NOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
86#define ARGP_BIT_NOT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
87#define ARGP_BIT_OR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
88#define ARGP_BIT_XOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
89#define ARGP_BREAK_OP ARG_NONE
90#define ARGP_BREAK_POINT_OP ARG_NONE
91#define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST)
92#define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA)
93#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING)
94#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
95#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
96#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
97#define ARGP_CONTINUE_OP ARG_NONE
98#define ARGP_COPY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SIMPLENAME)
99#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
100#define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
101#define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
102#define ARGP_CREATE_FIELD_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
103#define ARGP_CREATE_QWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
104#define ARGP_CREATE_WORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
105#define ARGP_DATA_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
106#define ARGP_DEBUG_OP ARG_NONE
107#define ARGP_DECREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
108#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_TERMARG)
109#define ARGP_DEVICE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
110#define ARGP_DIVIDE_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET, ARGP_TARGET)
111#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
112#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
113#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
114#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
115#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
116#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
117#define ARGP_FIND_SET_RIGHT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
118#define ARGP_FROM_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
119#define ARGP_IF_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
120#define ARGP_INCREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
121#define ARGP_INDEX_FIELD_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_BYTEDATA, ARGP_FIELDLIST)
122#define ARGP_INDEX_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
123#define ARGP_LAND_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
124#define ARGP_LEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
125#define ARGP_LGREATER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
126#define ARGP_LGREATEREQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
127#define ARGP_LLESS_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
128#define ARGP_LLESSEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
129#define ARGP_LNOT_OP ARGP_LIST1 (ARGP_TERMARG)
130#define ARGP_LNOTEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
131#define ARGP_LOAD_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_SUPERNAME)
132#define ARGP_LOAD_TABLE_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
133#define ARGP_LOCAL0 ARG_NONE
134#define ARGP_LOCAL1 ARG_NONE
135#define ARGP_LOCAL2 ARG_NONE
136#define ARGP_LOCAL3 ARG_NONE
137#define ARGP_LOCAL4 ARG_NONE
138#define ARGP_LOCAL5 ARG_NONE
139#define ARGP_LOCAL6 ARG_NONE
140#define ARGP_LOCAL7 ARG_NONE
141#define ARGP_LOR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
142#define ARGP_MATCH_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
143#define ARGP_METHOD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMLIST)
144#define ARGP_METHODCALL_OP ARGP_LIST1 (ARGP_NAMESTRING)
145#define ARGP_MID_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
146#define ARGP_MOD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
147#define ARGP_MULTIPLY_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
148#define ARGP_MUTEX_OP ARGP_LIST2 (ARGP_NAME, ARGP_BYTEDATA)
149#define ARGP_NAME_OP ARGP_LIST2 (ARGP_NAME, ARGP_DATAOBJ)
150#define ARGP_NAMEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
151#define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING)
152#define ARGP_NOOP_OP ARG_NONE
153#define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
154#define ARGP_ONE_OP ARG_NONE
155#define ARGP_ONES_OP ARG_NONE
156#define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
157#define ARGP_POWER_RES_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_WORDDATA, ARGP_OBJLIST)
158#define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST)
159#define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA)
160#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
161#define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
162#define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME)
163#define ARGP_RESERVEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
164#define ARGP_RESET_OP ARGP_LIST1 (ARGP_SUPERNAME)
165#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
166#define ARGP_REVISION_OP ARG_NONE
167#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
168#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
169#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
170#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
171#define ARGP_SIZE_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
172#define ARGP_SLEEP_OP ARGP_LIST1 (ARGP_TERMARG)
173#define ARGP_STALL_OP ARGP_LIST1 (ARGP_TERMARG)
174#define ARGP_STATICSTRING_OP ARGP_LIST1 (ARGP_NAMESTRING)
175#define ARGP_STORE_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SUPERNAME)
176#define ARGP_STRING_OP ARGP_LIST1 (ARGP_CHARLIST)
177#define ARGP_SUBTRACT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
178#define ARGP_THERMAL_ZONE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
179#define ARGP_TIMER_OP ARG_NONE
180#define ARGP_TO_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
181#define ARGP_TO_BUFFER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
182#define ARGP_TO_DEC_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
183#define ARGP_TO_HEX_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
184#define ARGP_TO_INTEGER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
185#define ARGP_TO_STRING_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
186#define ARGP_TYPE_OP ARGP_LIST1 (ARGP_SUPERNAME)
187#define ARGP_UNLOAD_OP ARGP_LIST1 (ARGP_SUPERNAME)
188#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_DATAOBJLIST)
189#define ARGP_WAIT_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
190#define ARGP_WHILE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
191#define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA)
192#define ARGP_ZERO_OP ARG_NONE
193
194
195/*
196 * All AML opcodes and the runtime arguments for each. Used by the AML
197 * interpreter Each list is compressed into a 32-bit number and stored
198 * in the master opcode table (in psopcode.c).
199 *
200 * (Used by prep_operands procedure and the ASL Compiler)
201 */
202#define ARGI_ACCESSFIELD_OP ARGI_INVALID_OPCODE
203#define ARGI_ACQUIRE_OP ARGI_LIST2 (ARGI_MUTEX, ARGI_INTEGER)
204#define ARGI_ADD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
205#define ARGI_ALIAS_OP ARGI_INVALID_OPCODE
206#define ARGI_ARG0 ARG_NONE
207#define ARGI_ARG1 ARG_NONE
208#define ARGI_ARG2 ARG_NONE
209#define ARGI_ARG3 ARG_NONE
210#define ARGI_ARG4 ARG_NONE
211#define ARGI_ARG5 ARG_NONE
212#define ARGI_ARG6 ARG_NONE
213#define ARGI_BANK_FIELD_OP ARGI_INVALID_OPCODE
214#define ARGI_BIT_AND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
215#define ARGI_BIT_NAND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
216#define ARGI_BIT_NOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
217#define ARGI_BIT_NOT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
218#define ARGI_BIT_OR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
219#define ARGI_BIT_XOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
220#define ARGI_BREAK_OP ARG_NONE
221#define ARGI_BREAK_POINT_OP ARG_NONE
222#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER)
223#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
224#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
225#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
226#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
227#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
228#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
229#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
230#define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
231#define ARGI_CREATE_BYTE_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
232#define ARGI_CREATE_DWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
233#define ARGI_CREATE_FIELD_OP ARGI_LIST4 (ARGI_BUFFER, ARGI_INTEGER, ARGI_INTEGER, ARGI_REFERENCE)
234#define ARGI_CREATE_QWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
235#define ARGI_CREATE_WORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
236#define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING)
237#define ARGI_DEBUG_OP ARG_NONE
238#define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
239#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REF_OR_STRING)
240#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE
241#define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF)
242#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
243#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
244#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
245#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
246#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
247#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
248#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
249#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
250#define ARGI_IF_OP ARGI_INVALID_OPCODE
251#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
252#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
253#define ARGI_INDEX_OP ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER, ARGI_TARGETREF)
254#define ARGI_LAND_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
255#define ARGI_LEQUAL_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
256#define ARGI_LGREATER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
257#define ARGI_LGREATEREQUAL_OP ARGI_INVALID_OPCODE
258#define ARGI_LLESS_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
259#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
260#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
261#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
262#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_FIELD,ARGI_TARGETREF)
263#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
264#define ARGI_LOCAL0 ARG_NONE
265#define ARGI_LOCAL1 ARG_NONE
266#define ARGI_LOCAL2 ARG_NONE
267#define ARGI_LOCAL3 ARG_NONE
268#define ARGI_LOCAL4 ARG_NONE
269#define ARGI_LOCAL5 ARG_NONE
270#define ARGI_LOCAL6 ARG_NONE
271#define ARGI_LOCAL7 ARG_NONE
272#define ARGI_LOR_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
273#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_COMPUTEDATA, ARGI_INTEGER,ARGI_COMPUTEDATA,ARGI_INTEGER)
274#define ARGI_METHOD_OP ARGI_INVALID_OPCODE
275#define ARGI_METHODCALL_OP ARGI_INVALID_OPCODE
276#define ARGI_MID_OP ARGI_LIST4 (ARGI_BUFFER_OR_STRING,ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
277#define ARGI_MOD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
278#define ARGI_MULTIPLY_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
279#define ARGI_MUTEX_OP ARGI_INVALID_OPCODE
280#define ARGI_NAME_OP ARGI_INVALID_OPCODE
281#define ARGI_NAMEDFIELD_OP ARGI_INVALID_OPCODE
282#define ARGI_NAMEPATH_OP ARGI_INVALID_OPCODE
283#define ARGI_NOOP_OP ARG_NONE
284#define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
285#define ARGI_ONE_OP ARG_NONE
286#define ARGI_ONES_OP ARG_NONE
287#define ARGI_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
288#define ARGI_POWER_RES_OP ARGI_INVALID_OPCODE
289#define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE
290#define ARGI_QWORD_OP ARGI_INVALID_OPCODE
291#define ARGI_REF_OF_OP ARGI_LIST1 (ARGI_OBJECT_REF)
292#define ARGI_REGION_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
293#define ARGI_RELEASE_OP ARGI_LIST1 (ARGI_MUTEX)
294#define ARGI_RESERVEDFIELD_OP ARGI_INVALID_OPCODE
295#define ARGI_RESET_OP ARGI_LIST1 (ARGI_EVENT)
296#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
297#define ARGI_REVISION_OP ARG_NONE
298#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
299#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
300#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
301#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
302#define ARGI_SIZE_OF_OP ARGI_LIST1 (ARGI_DATAOBJECT)
303#define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER)
304#define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER)
305#define ARGI_STATICSTRING_OP ARGI_INVALID_OPCODE
306#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_TARGETREF)
307#define ARGI_STRING_OP ARGI_INVALID_OPCODE
308#define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
309#define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE
310#define ARGI_TIMER_OP ARG_NONE
311#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
312#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
313#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
314#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
315#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
316#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET)
317#define ARGI_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
318#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
319#define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
320#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
321#define ARGI_WHILE_OP ARGI_INVALID_OPCODE
322#define ARGI_WORD_OP ARGI_INVALID_OPCODE
323#define ARGI_ZERO_OP ARG_NONE
324
325#endif /* __ACOPCODE_H__ */
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index c0395ef2b0d..69827657181 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -64,8 +64,17 @@
64 64
65#define ACPI_PARSE_DEFERRED_OP 0x0100 65#define ACPI_PARSE_DEFERRED_OP 0x0100
66 66
67/* Parser external interfaces */
68 67
68/******************************************************************************
69 *
70 * Parser interfaces
71 *
72 *****************************************************************************/
73
74
75/*
76 * psxface - Parser external interfaces
77 */
69acpi_status 78acpi_status
70acpi_psx_load_table ( 79acpi_psx_load_table (
71 u8 *pcode_addr, 80 u8 *pcode_addr,
@@ -76,23 +85,13 @@ acpi_psx_execute (
76 struct acpi_parameter_info *info); 85 struct acpi_parameter_info *info);
77 86
78 87
79/****************************************************************************** 88/*
80 * 89 * psargs - Parse AML opcode arguments
81 * Parser interfaces 90 */
82 *
83 *****************************************************************************/
84
85
86/* psargs - Parse AML opcode arguments */
87
88u8 * 91u8 *
89acpi_ps_get_next_package_end ( 92acpi_ps_get_next_package_end (
90 struct acpi_parse_state *parser_state); 93 struct acpi_parse_state *parser_state);
91 94
92u32
93acpi_ps_get_next_package_length (
94 struct acpi_parse_state *parser_state);
95
96char * 95char *
97acpi_ps_get_next_namestring ( 96acpi_ps_get_next_namestring (
98 struct acpi_parse_state *parser_state); 97 struct acpi_parse_state *parser_state);
@@ -110,10 +109,6 @@ acpi_ps_get_next_namepath (
110 union acpi_parse_object *arg, 109 union acpi_parse_object *arg,
111 u8 method_call); 110 u8 method_call);
112 111
113union acpi_parse_object *
114acpi_ps_get_next_field (
115 struct acpi_parse_state *parser_state);
116
117acpi_status 112acpi_status
118acpi_ps_get_next_arg ( 113acpi_ps_get_next_arg (
119 struct acpi_walk_state *walk_state, 114 struct acpi_walk_state *walk_state,
@@ -122,8 +117,9 @@ acpi_ps_get_next_arg (
122 union acpi_parse_object **return_arg); 117 union acpi_parse_object **return_arg);
123 118
124 119
125/* psfind */ 120/*
126 121 * psfind
122 */
127union acpi_parse_object * 123union acpi_parse_object *
128acpi_ps_find_name ( 124acpi_ps_find_name (
129 union acpi_parse_object *scope, 125 union acpi_parse_object *scope,
@@ -135,8 +131,9 @@ acpi_ps_get_parent (
135 union acpi_parse_object *op); 131 union acpi_parse_object *op);
136 132
137 133
138/* psopcode - AML Opcode information */ 134/*
139 135 * psopcode - AML Opcode information
136 */
140const struct acpi_opcode_info * 137const struct acpi_opcode_info *
141acpi_ps_get_opcode_info ( 138acpi_ps_get_opcode_info (
142 u16 opcode); 139 u16 opcode);
@@ -146,56 +143,25 @@ acpi_ps_get_opcode_name (
146 u16 opcode); 143 u16 opcode);
147 144
148 145
149/* psparse - top level parsing routines */ 146/*
150 147 * psparse - top level parsing routines
151u32 148 */
152acpi_ps_get_opcode_size (
153 u32 opcode);
154
155void
156acpi_ps_complete_this_op (
157 struct acpi_walk_state *walk_state,
158 union acpi_parse_object *op);
159
160acpi_status
161acpi_ps_next_parse_state (
162 struct acpi_walk_state *walk_state,
163 union acpi_parse_object *op,
164 acpi_status callback_status);
165
166acpi_status
167acpi_ps_find_object (
168 struct acpi_walk_state *walk_state,
169 union acpi_parse_object **out_op);
170
171void
172acpi_ps_delete_parse_tree (
173 union acpi_parse_object *root);
174
175acpi_status
176acpi_ps_parse_loop (
177 struct acpi_walk_state *walk_state);
178
179acpi_status 149acpi_status
180acpi_ps_parse_aml ( 150acpi_ps_parse_aml (
181 struct acpi_walk_state *walk_state); 151 struct acpi_walk_state *walk_state);
182 152
183acpi_status 153u32
184acpi_ps_parse_table ( 154acpi_ps_get_opcode_size (
185 u8 *aml, 155 u32 opcode);
186 u32 aml_size,
187 acpi_parse_downwards descending_callback,
188 acpi_parse_upwards ascending_callback,
189 union acpi_parse_object **root_object);
190 156
191u16 157u16
192acpi_ps_peek_opcode ( 158acpi_ps_peek_opcode (
193 struct acpi_parse_state *state); 159 struct acpi_parse_state *state);
194 160
195 161
196/* psscope - Scope stack management routines */ 162/*
197 163 * psscope - Scope stack management routines
198 164 */
199acpi_status 165acpi_status
200acpi_ps_init_scope ( 166acpi_ps_init_scope (
201 struct acpi_parse_state *parser_state, 167 struct acpi_parse_state *parser_state,
@@ -228,8 +194,9 @@ acpi_ps_cleanup_scope (
228 struct acpi_parse_state *state); 194 struct acpi_parse_state *state);
229 195
230 196
231/* pstree - parse tree manipulation routines */ 197/*
232 198 * pstree - parse tree manipulation routines
199 */
233void 200void
234acpi_ps_append_arg( 201acpi_ps_append_arg(
235 union acpi_parse_object *op, 202 union acpi_parse_object *op,
@@ -247,20 +214,17 @@ acpi_ps_get_arg(
247 union acpi_parse_object *op, 214 union acpi_parse_object *op,
248 u32 argn); 215 u32 argn);
249 216
250#ifdef ACPI_FUTURE_USAGE 217#ifdef ACPI_FUTURE_USAGE
251union acpi_parse_object *
252acpi_ps_get_child (
253 union acpi_parse_object *op);
254
255union acpi_parse_object * 218union acpi_parse_object *
256acpi_ps_get_depth_next ( 219acpi_ps_get_depth_next (
257 union acpi_parse_object *origin, 220 union acpi_parse_object *origin,
258 union acpi_parse_object *op); 221 union acpi_parse_object *op);
259#endif /* ACPI_FUTURE_USAGE */ 222#endif /* ACPI_FUTURE_USAGE */
260
261 223
262/* pswalk - parse tree walk routines */
263 224
225/*
226 * pswalk - parse tree walk routines
227 */
264acpi_status 228acpi_status
265acpi_ps_walk_parsed_aml ( 229acpi_ps_walk_parsed_aml (
266 union acpi_parse_object *start_op, 230 union acpi_parse_object *start_op,
@@ -283,9 +247,14 @@ acpi_status
283acpi_ps_delete_completed_op ( 247acpi_ps_delete_completed_op (
284 struct acpi_walk_state *walk_state); 248 struct acpi_walk_state *walk_state);
285 249
250void
251acpi_ps_delete_parse_tree (
252 union acpi_parse_object *root);
286 253
287/* psutils - parser utilities */
288 254
255/*
256 * psutils - parser utilities
257 */
289union acpi_parse_object * 258union acpi_parse_object *
290acpi_ps_create_scope_op ( 259acpi_ps_create_scope_op (
291 void); 260 void);
@@ -303,12 +272,6 @@ void
303acpi_ps_free_op ( 272acpi_ps_free_op (
304 union acpi_parse_object *op); 273 union acpi_parse_object *op);
305 274
306#ifdef ACPI_ENABLE_OBJECT_CACHE
307void
308acpi_ps_delete_parse_cache (
309 void);
310#endif
311
312u8 275u8
313acpi_ps_is_leading_char ( 276acpi_ps_is_leading_char (
314 u32 c); 277 u32 c);
@@ -317,20 +280,27 @@ u8
317acpi_ps_is_prefix_char ( 280acpi_ps_is_prefix_char (
318 u32 c); 281 u32 c);
319 282
320#ifdef ACPI_FUTURE_USAGE 283#ifdef ACPI_FUTURE_USAGE
321u32 284u32
322acpi_ps_get_name( 285acpi_ps_get_name(
323 union acpi_parse_object *op); 286 union acpi_parse_object *op);
324#endif 287#endif /* ACPI_FUTURE_USAGE */
325 288
326void 289void
327acpi_ps_set_name( 290acpi_ps_set_name(
328 union acpi_parse_object *op, 291 union acpi_parse_object *op,
329 u32 name); 292 u32 name);
330 293
294#ifdef ACPI_ENABLE_OBJECT_CACHE
295void
296acpi_ps_delete_parse_cache (
297 void);
298#endif
331 299
332/* psdump - display parser tree */
333 300
301/*
302 * psdump - display parser tree
303 */
334u32 304u32
335acpi_ps_sprint_path ( 305acpi_ps_sprint_path (
336 char *buffer_start, 306 char *buffer_start,
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index ad53252dd42..a69d7894204 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -49,6 +49,7 @@
49 * We put them here because we don't want to duplicate them 49 * We put them here because we don't want to duplicate them
50 * in the rest of the source code again and again. 50 * in the rest of the source code again and again.
51 */ 51 */
52#include "acnames.h" /* Global ACPI names and strings */
52#include "acconfig.h" /* Configuration constants */ 53#include "acconfig.h" /* Configuration constants */
53#include "platform/acenv.h" /* Target environment specific items */ 54#include "platform/acenv.h" /* Target environment specific items */
54#include "actypes.h" /* Fundamental common data types */ 55#include "actypes.h" /* Fundamental common data types */
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 9ad142476f3..8d0e1290bc7 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -351,6 +351,27 @@ int acpi_match_ids (struct acpi_device *device, char *ids);
351int acpi_create_dir(struct acpi_device *); 351int acpi_create_dir(struct acpi_device *);
352void acpi_remove_dir(struct acpi_device *); 352void acpi_remove_dir(struct acpi_device *);
353 353
354
355/*
356 * Bind physical devices with ACPI devices
357 */
358#include <linux/device.h>
359struct acpi_bus_type {
360 struct list_head list;
361 struct bus_type *bus;
362 /* For general devices under the bus*/
363 int (*find_device)(struct device *, acpi_handle*);
364 /* For bridges, such as PCI root bridge, IDE controller */
365 int (*find_bridge)(struct device *, acpi_handle *);
366};
367int register_acpi_bus_type(struct acpi_bus_type *);
368int unregister_acpi_bus_type(struct acpi_bus_type *);
369struct device *acpi_get_physical_device(acpi_handle);
370/* helper */
371acpi_handle acpi_get_child(acpi_handle, acpi_integer);
372acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
373#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data))
374
354#endif /*CONFIG_ACPI_BUS*/ 375#endif /*CONFIG_ACPI_BUS*/
355 376
356#endif /*__ACPI_BUS_H__*/ 377#endif /*__ACPI_BUS_H__*/
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 4ec722d7338..caeaa71a566 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -109,5 +109,10 @@ int acpi_ec_ecdt_probe (void);
109 109
110int acpi_processor_set_thermal_limit(acpi_handle handle, int type); 110int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
111 111
112/* --------------------------------------------------------------------------
113 Hot Keys
114 -------------------------------------------------------------------------- */
115
116extern int acpi_specific_hotkey_enabled;
112 117
113#endif /*__ACPI_DRIVERS_H__*/ 118#endif /*__ACPI_DRIVERS_H__*/
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 857c8072eb1..ea489f23521 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -79,7 +79,6 @@ struct acpi_signal_fatal_info
79/* 79/*
80 * OSL Initialization and shutdown primitives 80 * OSL Initialization and shutdown primitives
81 */ 81 */
82
83acpi_status 82acpi_status
84acpi_os_initialize ( 83acpi_os_initialize (
85 void); 84 void);
@@ -92,7 +91,6 @@ acpi_os_terminate (
92/* 91/*
93 * ACPI Table interfaces 92 * ACPI Table interfaces
94 */ 93 */
95
96acpi_status 94acpi_status
97acpi_os_get_root_pointer ( 95acpi_os_get_root_pointer (
98 u32 flags, 96 u32 flags,
@@ -112,7 +110,6 @@ acpi_os_table_override (
112/* 110/*
113 * Synchronization primitives 111 * Synchronization primitives
114 */ 112 */
115
116acpi_status 113acpi_status
117acpi_os_create_semaphore ( 114acpi_os_create_semaphore (
118 u32 max_units, 115 u32 max_units,
@@ -156,7 +153,6 @@ acpi_os_release_lock (
156/* 153/*
157 * Memory allocation and mapping 154 * Memory allocation and mapping
158 */ 155 */
159
160void * 156void *
161acpi_os_allocate ( 157acpi_os_allocate (
162 acpi_size size); 158 acpi_size size);
@@ -187,7 +183,6 @@ acpi_os_get_physical_address (
187/* 183/*
188 * Interrupt handlers 184 * Interrupt handlers
189 */ 185 */
190
191acpi_status 186acpi_status
192acpi_os_install_interrupt_handler ( 187acpi_os_install_interrupt_handler (
193 u32 gsi, 188 u32 gsi,
@@ -203,7 +198,6 @@ acpi_os_remove_interrupt_handler (
203/* 198/*
204 * Threads and Scheduling 199 * Threads and Scheduling
205 */ 200 */
206
207u32 201u32
208acpi_os_get_thread_id ( 202acpi_os_get_thread_id (
209 void); 203 void);
@@ -234,7 +228,6 @@ acpi_os_stall (
234/* 228/*
235 * Platform and hardware-independent I/O interfaces 229 * Platform and hardware-independent I/O interfaces
236 */ 230 */
237
238acpi_status 231acpi_status
239acpi_os_read_port ( 232acpi_os_read_port (
240 acpi_io_address address, 233 acpi_io_address address,
@@ -251,7 +244,6 @@ acpi_os_write_port (
251/* 244/*
252 * Platform and hardware-independent physical memory interfaces 245 * Platform and hardware-independent physical memory interfaces
253 */ 246 */
254
255acpi_status 247acpi_status
256acpi_os_read_memory ( 248acpi_os_read_memory (
257 acpi_physical_address address, 249 acpi_physical_address address,
@@ -270,7 +262,6 @@ acpi_os_write_memory (
270 * Note: Can't use "Register" as a parameter, changed to "Reg" -- 262 * Note: Can't use "Register" as a parameter, changed to "Reg" --
271 * certain compilers complain. 263 * certain compilers complain.
272 */ 264 */
273
274acpi_status 265acpi_status
275acpi_os_read_pci_configuration ( 266acpi_os_read_pci_configuration (
276 struct acpi_pci_id *pci_id, 267 struct acpi_pci_id *pci_id,
@@ -288,7 +279,6 @@ acpi_os_write_pci_configuration (
288/* 279/*
289 * Interim function needed for PCI IRQ routing 280 * Interim function needed for PCI IRQ routing
290 */ 281 */
291
292void 282void
293acpi_os_derive_pci_id( 283acpi_os_derive_pci_id(
294 acpi_handle rhandle, 284 acpi_handle rhandle,
@@ -298,7 +288,6 @@ acpi_os_derive_pci_id(
298/* 288/*
299 * Miscellaneous 289 * Miscellaneous
300 */ 290 */
301
302u8 291u8
303acpi_os_readable ( 292acpi_os_readable (
304 void *pointer, 293 void *pointer,
@@ -323,7 +312,6 @@ acpi_os_signal (
323/* 312/*
324 * Debug print routines 313 * Debug print routines
325 */ 314 */
326
327void ACPI_INTERNAL_VAR_XFACE 315void ACPI_INTERNAL_VAR_XFACE
328acpi_os_printf ( 316acpi_os_printf (
329 const char *format, 317 const char *format,
@@ -339,11 +327,10 @@ acpi_os_redirect_output (
339 void *destination); 327 void *destination);
340 328
341 329
330#ifdef ACPI_FUTURE_USAGE
342/* 331/*
343 * Debug input 332 * Debug input
344 */ 333 */
345
346#ifdef ACPI_FUTURE_USAGE
347u32 334u32
348acpi_os_get_line ( 335acpi_os_get_line (
349 char *buffer); 336 char *buffer);
@@ -353,7 +340,6 @@ acpi_os_get_line (
353/* 340/*
354 * Directory manipulation 341 * Directory manipulation
355 */ 342 */
356
357void * 343void *
358acpi_os_open_directory ( 344acpi_os_open_directory (
359 char *pathname, 345 char *pathname,
@@ -377,7 +363,6 @@ acpi_os_close_directory (
377/* 363/*
378 * Debug 364 * Debug
379 */ 365 */
380
381void 366void
382acpi_os_dbg_assert( 367acpi_os_dbg_assert(
383 void *failed_assertion, 368 void *failed_assertion,
@@ -385,5 +370,4 @@ acpi_os_dbg_assert(
385 u32 line_number, 370 u32 line_number,
386 char *message); 371 char *message);
387 372
388
389#endif /* __ACPIOSXF_H__ */ 373#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 00d78b79652..f8f619f8e4f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -50,10 +50,9 @@
50#include "actbl.h" 50#include "actbl.h"
51 51
52 52
53 /* 53/*
54 * Global interfaces 54 * Global interfaces
55 */ 55 */
56
57acpi_status 56acpi_status
58acpi_initialize_subsystem ( 57acpi_initialize_subsystem (
59 void); 58 void);
@@ -106,9 +105,8 @@ acpi_install_initialization_handler (
106#endif 105#endif
107 106
108/* 107/*
109 * ACPI Memory manager 108 * ACPI Memory managment
110 */ 109 */
111
112void * 110void *
113acpi_allocate ( 111acpi_allocate (
114 u32 size); 112 u32 size);
@@ -125,7 +123,6 @@ acpi_free (
125/* 123/*
126 * ACPI table manipulation interfaces 124 * ACPI table manipulation interfaces
127 */ 125 */
128
129acpi_status 126acpi_status
130acpi_find_root_pointer ( 127acpi_find_root_pointer (
131 u32 flags, 128 u32 flags,
@@ -168,7 +165,6 @@ acpi_get_firmware_table (
168/* 165/*
169 * Namespace and name interfaces 166 * Namespace and name interfaces
170 */ 167 */
171
172acpi_status 168acpi_status
173acpi_walk_namespace ( 169acpi_walk_namespace (
174 acpi_object_type type, 170 acpi_object_type type,
@@ -218,7 +214,6 @@ acpi_get_data (
218/* 214/*
219 * Object manipulation and enumeration 215 * Object manipulation and enumeration
220 */ 216 */
221
222acpi_status 217acpi_status
223acpi_evaluate_object ( 218acpi_evaluate_object (
224 acpi_handle object, 219 acpi_handle object,
@@ -262,7 +257,6 @@ acpi_get_parent (
262/* 257/*
263 * Event handler interfaces 258 * Event handler interfaces
264 */ 259 */
265
266acpi_status 260acpi_status
267acpi_install_fixed_event_handler ( 261acpi_install_fixed_event_handler (
268 u32 acpi_event, 262 u32 acpi_event,
@@ -319,7 +313,6 @@ acpi_install_exception_handler (
319/* 313/*
320 * Event interfaces 314 * Event interfaces
321 */ 315 */
322
323acpi_status 316acpi_status
324acpi_acquire_global_lock ( 317acpi_acquire_global_lock (
325 u16 timeout, 318 u16 timeout,
@@ -404,7 +397,6 @@ acpi_remove_gpe_block (
404/* 397/*
405 * Resource interfaces 398 * Resource interfaces
406 */ 399 */
407
408typedef 400typedef
409acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) ( 401acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) (
410 struct acpi_resource *resource, 402 struct acpi_resource *resource,
@@ -448,7 +440,6 @@ acpi_resource_to_address64 (
448/* 440/*
449 * Hardware (ACPI device) interfaces 441 * Hardware (ACPI device) interfaces
450 */ 442 */
451
452acpi_status 443acpi_status
453acpi_get_register ( 444acpi_get_register (
454 u32 register_id, 445 u32 register_id,
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 93c55ff5c23..ed679264c12 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -48,7 +48,6 @@
48/* 48/*
49 * Function prototypes called from Acpi* APIs 49 * Function prototypes called from Acpi* APIs
50 */ 50 */
51
52acpi_status 51acpi_status
53acpi_rs_get_prt_method_data ( 52acpi_rs_get_prt_method_data (
54 acpi_handle handle, 53 acpi_handle handle,
@@ -60,12 +59,12 @@ acpi_rs_get_crs_method_data (
60 acpi_handle handle, 59 acpi_handle handle,
61 struct acpi_buffer *ret_buffer); 60 struct acpi_buffer *ret_buffer);
62 61
63#ifdef ACPI_FUTURE_USAGE 62#ifdef ACPI_FUTURE_USAGE
64acpi_status 63acpi_status
65acpi_rs_get_prs_method_data ( 64acpi_rs_get_prs_method_data (
66 acpi_handle handle, 65 acpi_handle handle,
67 struct acpi_buffer *ret_buffer); 66 struct acpi_buffer *ret_buffer);
68#endif 67#endif /* ACPI_FUTURE_USAGE */
69 68
70acpi_status 69acpi_status
71acpi_rs_get_method_data ( 70acpi_rs_get_method_data (
@@ -95,61 +94,9 @@ acpi_rs_create_pci_routing_table (
95 94
96 95
97/* 96/*
98 * Function prototypes called from acpi_rs_create* 97 * rsdump
99 */ 98 */
100#ifdef ACPI_FUTURE_USAGE 99#ifdef ACPI_FUTURE_USAGE
101void
102acpi_rs_dump_irq (
103 union acpi_resource_data *data);
104
105void
106acpi_rs_dump_address16 (
107 union acpi_resource_data *data);
108
109void
110acpi_rs_dump_address32 (
111 union acpi_resource_data *data);
112
113void
114acpi_rs_dump_address64 (
115 union acpi_resource_data *data);
116
117void
118acpi_rs_dump_dma (
119 union acpi_resource_data *data);
120
121void
122acpi_rs_dump_io (
123 union acpi_resource_data *data);
124
125void
126acpi_rs_dump_extended_irq (
127 union acpi_resource_data *data);
128
129void
130acpi_rs_dump_fixed_io (
131 union acpi_resource_data *data);
132
133void
134acpi_rs_dump_fixed_memory32 (
135 union acpi_resource_data *data);
136
137void
138acpi_rs_dump_memory24 (
139 union acpi_resource_data *data);
140
141void
142acpi_rs_dump_memory32 (
143 union acpi_resource_data *data);
144
145void
146acpi_rs_dump_start_depend_fns (
147 union acpi_resource_data *data);
148
149void
150acpi_rs_dump_vendor_specific (
151 union acpi_resource_data *data);
152
153void 100void
154acpi_rs_dump_resource_list ( 101acpi_rs_dump_resource_list (
155 struct acpi_resource *resource); 102 struct acpi_resource *resource);
@@ -157,8 +104,12 @@ acpi_rs_dump_resource_list (
157void 104void
158acpi_rs_dump_irq_list ( 105acpi_rs_dump_irq_list (
159 u8 *route_table); 106 u8 *route_table);
160#endif /* ACPI_FUTURE_USAGE */ 107#endif /* ACPI_FUTURE_USAGE */
161 108
109
110/*
111 * rscalc
112 */
162acpi_status 113acpi_status
163acpi_rs_get_byte_stream_start ( 114acpi_rs_get_byte_stream_start (
164 u8 *byte_stream_buffer, 115 u8 *byte_stream_buffer,
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index c97843f6bcb..e6b9e36a2ed 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -56,7 +56,6 @@
56 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 56 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through
57 * the tree (for whatever reason), and for control method execution. 57 * the tree (for whatever reason), and for control method execution.
58 */ 58 */
59
60#define ACPI_NEXT_OP_DOWNWARD 1 59#define ACPI_NEXT_OP_DOWNWARD 1
61#define ACPI_NEXT_OP_UPWARD 2 60#define ACPI_NEXT_OP_UPWARD 2
62 61
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index e8f5d4ffd45..39df92e21a0 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -50,17 +50,9 @@
50#define SIZE_IN_HEADER 0 50#define SIZE_IN_HEADER 0
51 51
52 52
53#ifdef ACPI_FUTURE_USAGE
54acpi_status
55acpi_tb_handle_to_object (
56 u16 table_id,
57 struct acpi_table_desc **table_desc);
58#endif
59
60/* 53/*
61 * tbconvrt - Table conversion routines 54 * tbconvrt - Table conversion routines
62 */ 55 */
63
64acpi_status 56acpi_status
65acpi_tb_convert_to_xsdt ( 57acpi_tb_convert_to_xsdt (
66 struct acpi_table_desc *table_info); 58 struct acpi_table_desc *table_info);
@@ -78,10 +70,10 @@ acpi_tb_get_table_count (
78 struct rsdp_descriptor *RSDP, 70 struct rsdp_descriptor *RSDP,
79 struct acpi_table_header *RSDT); 71 struct acpi_table_header *RSDT);
80 72
73
81/* 74/*
82 * tbget - Table "get" routines 75 * tbget - Table "get" routines
83 */ 76 */
84
85acpi_status 77acpi_status
86acpi_tb_get_table ( 78acpi_tb_get_table (
87 struct acpi_pointer *address, 79 struct acpi_pointer *address,
@@ -99,17 +91,6 @@ acpi_tb_get_table_body (
99 struct acpi_table_desc *table_info); 91 struct acpi_table_desc *table_info);
100 92
101acpi_status 93acpi_status
102acpi_tb_get_this_table (
103 struct acpi_pointer *address,
104 struct acpi_table_header *header,
105 struct acpi_table_desc *table_info);
106
107acpi_status
108acpi_tb_table_override (
109 struct acpi_table_header *header,
110 struct acpi_table_desc *table_info);
111
112acpi_status
113acpi_tb_get_table_ptr ( 94acpi_tb_get_table_ptr (
114 acpi_table_type table_type, 95 acpi_table_type table_type,
115 u32 instance, 96 u32 instance,
@@ -127,36 +108,23 @@ acpi_status
127acpi_tb_validate_rsdt ( 108acpi_tb_validate_rsdt (
128 struct acpi_table_header *table_ptr); 109 struct acpi_table_header *table_ptr);
129 110
111
112/*
113 * tbgetall - get multiple required tables
114 */
130acpi_status 115acpi_status
131acpi_tb_get_required_tables ( 116acpi_tb_get_required_tables (
132 void); 117 void);
133 118
134acpi_status
135acpi_tb_get_primary_table (
136 struct acpi_pointer *address,
137 struct acpi_table_desc *table_info);
138
139acpi_status
140acpi_tb_get_secondary_table (
141 struct acpi_pointer *address,
142 acpi_string signature,
143 struct acpi_table_desc *table_info);
144 119
145/* 120/*
146 * tbinstall - Table installation 121 * tbinstall - Table installation
147 */ 122 */
148
149acpi_status 123acpi_status
150acpi_tb_install_table ( 124acpi_tb_install_table (
151 struct acpi_table_desc *table_info); 125 struct acpi_table_desc *table_info);
152 126
153acpi_status 127acpi_status
154acpi_tb_match_signature (
155 char *signature,
156 struct acpi_table_desc *table_info,
157 u8 search_type);
158
159acpi_status
160acpi_tb_recognize_table ( 128acpi_tb_recognize_table (
161 struct acpi_table_desc *table_info, 129 struct acpi_table_desc *table_info,
162 u8 search_type); 130 u8 search_type);
@@ -170,7 +138,6 @@ acpi_tb_init_table_descriptor (
170/* 138/*
171 * tbremove - Table removal and deletion 139 * tbremove - Table removal and deletion
172 */ 140 */
173
174void 141void
175acpi_tb_delete_all_tables ( 142acpi_tb_delete_all_tables (
176 void); 143 void);
@@ -189,35 +156,23 @@ acpi_tb_uninstall_table (
189 156
190 157
191/* 158/*
192 * tbrsd - RSDP, RSDT utilities 159 * tbxfroot - RSDP, RSDT utilities
193 */ 160 */
161acpi_status
162acpi_tb_find_table (
163 char *signature,
164 char *oem_id,
165 char *oem_table_id,
166 struct acpi_table_header **table_ptr);
194 167
195acpi_status 168acpi_status
196acpi_tb_get_table_rsdt ( 169acpi_tb_get_table_rsdt (
197 void); 170 void);
198 171
199u8 *
200acpi_tb_scan_memory_for_rsdp (
201 u8 *start_address,
202 u32 length);
203
204acpi_status
205acpi_tb_find_rsdp (
206 struct acpi_table_desc *table_info,
207 u32 flags);
208
209 172
210/* 173/*
211 * tbutils - common table utilities 174 * tbutils - common table utilities
212 */ 175 */
213
214acpi_status
215acpi_tb_find_table (
216 char *signature,
217 char *oem_id,
218 char *oem_table_id,
219 struct acpi_table_header **table_ptr);
220
221acpi_status 176acpi_status
222acpi_tb_verify_table_checksum ( 177acpi_tb_verify_table_checksum (
223 struct acpi_table_header *table_header); 178 struct acpi_table_header *table_header);
@@ -231,5 +186,4 @@ acpi_status
231acpi_tb_validate_table_header ( 186acpi_tb_validate_table_header (
232 struct acpi_table_header *table_header); 187 struct acpi_table_header *table_header);
233 188
234
235#endif /* __ACTABLES_H__ */ 189#endif /* __ACTABLES_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 7eee731112b..b5cdcca444c 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -133,7 +133,6 @@ struct acpi_table_header /* ACPI common table header */
133#define DUAL_PIC 0 133#define DUAL_PIC 0
134#define MULTIPLE_APIC 1 134#define MULTIPLE_APIC 1
135 135
136
137/* Master MADT */ 136/* Master MADT */
138 137
139struct multiple_apic_table 138struct multiple_apic_table
@@ -144,7 +143,6 @@ struct multiple_apic_table
144 u32 reserved1 : 31; 143 u32 reserved1 : 31;
145}; 144};
146 145
147
148/* Values for Type in APIC_HEADER_DEF */ 146/* Values for Type in APIC_HEADER_DEF */
149 147
150#define APIC_PROCESSOR 0 148#define APIC_PROCESSOR 0
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 7acb550af3e..3a451dc48ac 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -478,7 +478,6 @@ typedef u32 acpi_object_type;
478#define ACPI_TYPE_INVALID 0x1E 478#define ACPI_TYPE_INVALID 0x1E
479#define ACPI_TYPE_NOT_FOUND 0xFF 479#define ACPI_TYPE_NOT_FOUND 0xFF
480 480
481
482/* 481/*
483 * Bitmapped ACPI types. Used internally only 482 * Bitmapped ACPI types. Used internally only
484 */ 483 */
@@ -803,7 +802,6 @@ struct acpi_system_info
803/* 802/*
804 * Types specific to the OS service interfaces 803 * Types specific to the OS service interfaces
805 */ 804 */
806
807typedef u32 805typedef u32
808(ACPI_SYSTEM_XFACE *acpi_osd_handler) ( 806(ACPI_SYSTEM_XFACE *acpi_osd_handler) (
809 void *context); 807 void *context);
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 0de26b8f102..192d0bea388 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -52,13 +52,6 @@ acpi_status (*acpi_pkg_callback) (
52 union acpi_generic_state *state, 52 union acpi_generic_state *state,
53 void *context); 53 void *context);
54 54
55acpi_status
56acpi_ut_walk_package_tree (
57 union acpi_operand_object *source_object,
58 void *target_object,
59 acpi_pkg_callback walk_callback,
60 void *context);
61
62struct acpi_pkg_info 55struct acpi_pkg_info
63{ 56{
64 u8 *free_space; 57 u8 *free_space;
@@ -79,37 +72,13 @@ struct acpi_pkg_info
79#define DB_QWORD_DISPLAY 8 72#define DB_QWORD_DISPLAY 8
80 73
81 74
82/* Global initialization interfaces */
83
84void
85acpi_ut_init_globals (
86 void);
87
88void
89acpi_ut_terminate (
90 void);
91
92
93/* 75/*
94 * ut_init - miscellaneous initialization and shutdown 76 * utglobal - Global data structures and procedures
95 */ 77 */
96
97acpi_status
98acpi_ut_hardware_initialize (
99 void);
100
101void 78void
102acpi_ut_subsystem_shutdown ( 79acpi_ut_init_globals (
103 void);
104
105acpi_status
106acpi_ut_validate_fadt (
107 void); 80 void);
108 81
109/*
110 * ut_global - Global data structures and procedures
111 */
112
113#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 82#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
114 83
115char * 84char *
@@ -157,9 +126,24 @@ acpi_ut_allocate_owner_id (
157 126
158 127
159/* 128/*
160 * ut_clib - Local implementations of C library functions 129 * utinit - miscellaneous initialization and shutdown
161 */ 130 */
131acpi_status
132acpi_ut_hardware_initialize (
133 void);
162 134
135void
136acpi_ut_subsystem_shutdown (
137 void);
138
139acpi_status
140acpi_ut_validate_fadt (
141 void);
142
143
144/*
145 * utclib - Local implementations of C library functions
146 */
163#ifndef ACPI_USE_SYSTEM_CLIBRARY 147#ifndef ACPI_USE_SYSTEM_CLIBRARY
164 148
165acpi_size 149acpi_size
@@ -260,10 +244,10 @@ extern const u8 _acpi_ctype[];
260 244
261#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 245#endif /* ACPI_USE_SYSTEM_CLIBRARY */
262 246
247
263/* 248/*
264 * ut_copy - Object construction and conversion interfaces 249 * utcopy - Object construction and conversion interfaces
265 */ 250 */
266
267acpi_status 251acpi_status
268acpi_ut_build_simple_object( 252acpi_ut_build_simple_object(
269 union acpi_operand_object *obj, 253 union acpi_operand_object *obj,
@@ -278,30 +262,11 @@ acpi_ut_build_package_object (
278 u32 *space_used); 262 u32 *space_used);
279 263
280acpi_status 264acpi_status
281acpi_ut_copy_ielement_to_eelement (
282 u8 object_type,
283 union acpi_operand_object *source_object,
284 union acpi_generic_state *state,
285 void *context);
286
287acpi_status
288acpi_ut_copy_ielement_to_ielement (
289 u8 object_type,
290 union acpi_operand_object *source_object,
291 union acpi_generic_state *state,
292 void *context);
293
294acpi_status
295acpi_ut_copy_iobject_to_eobject ( 265acpi_ut_copy_iobject_to_eobject (
296 union acpi_operand_object *obj, 266 union acpi_operand_object *obj,
297 struct acpi_buffer *ret_buffer); 267 struct acpi_buffer *ret_buffer);
298 268
299acpi_status 269acpi_status
300acpi_ut_copy_esimple_to_isimple(
301 union acpi_object *user_obj,
302 union acpi_operand_object **return_obj);
303
304acpi_status
305acpi_ut_copy_eobject_to_iobject ( 270acpi_ut_copy_eobject_to_iobject (
306 union acpi_object *obj, 271 union acpi_object *obj,
307 union acpi_operand_object **internal_obj); 272 union acpi_operand_object **internal_obj);
@@ -312,17 +277,6 @@ acpi_ut_copy_isimple_to_isimple (
312 union acpi_operand_object *dest_obj); 277 union acpi_operand_object *dest_obj);
313 278
314acpi_status 279acpi_status
315acpi_ut_copy_ipackage_to_ipackage (
316 union acpi_operand_object *source_obj,
317 union acpi_operand_object *dest_obj,
318 struct acpi_walk_state *walk_state);
319
320acpi_status
321acpi_ut_copy_simple_object (
322 union acpi_operand_object *source_desc,
323 union acpi_operand_object *dest_desc);
324
325acpi_status
326acpi_ut_copy_iobject_to_iobject ( 280acpi_ut_copy_iobject_to_iobject (
327 union acpi_operand_object *source_desc, 281 union acpi_operand_object *source_desc,
328 union acpi_operand_object **dest_desc, 282 union acpi_operand_object **dest_desc,
@@ -330,9 +284,8 @@ acpi_ut_copy_iobject_to_iobject (
330 284
331 285
332/* 286/*
333 * ut_create - Object creation 287 * utcreate - Object creation
334 */ 288 */
335
336acpi_status 289acpi_status
337acpi_ut_update_object_reference ( 290acpi_ut_update_object_reference (
338 union acpi_operand_object *object, 291 union acpi_operand_object *object,
@@ -340,9 +293,8 @@ acpi_ut_update_object_reference (
340 293
341 294
342/* 295/*
343 * ut_debug - Debug interfaces 296 * utdebug - Debug interfaces
344 */ 297 */
345
346void 298void
347acpi_ut_init_stack_ptr_trace ( 299acpi_ut_init_stack_ptr_trace (
348 void); 300 void);
@@ -440,11 +392,14 @@ acpi_ut_debug_print_raw (
440 392
441 393
442/* 394/*
443 * ut_delete - Object deletion 395 * utdelete - Object deletion and reference counts
444 */ 396 */
397void
398acpi_ut_add_reference (
399 union acpi_operand_object *object);
445 400
446void 401void
447acpi_ut_delete_internal_obj ( 402acpi_ut_remove_reference (
448 union acpi_operand_object *object); 403 union acpi_operand_object *object);
449 404
450void 405void
@@ -461,25 +416,8 @@ acpi_ut_delete_internal_object_list (
461 416
462 417
463/* 418/*
464 * ut_eval - object evaluation 419 * uteval - object evaluation
465 */ 420 */
466
467/* Method name strings */
468
469#define METHOD_NAME__HID "_HID"
470#define METHOD_NAME__CID "_CID"
471#define METHOD_NAME__UID "_UID"
472#define METHOD_NAME__ADR "_ADR"
473#define METHOD_NAME__STA "_STA"
474#define METHOD_NAME__REG "_REG"
475#define METHOD_NAME__SEG "_SEG"
476#define METHOD_NAME__BBN "_BBN"
477#define METHOD_NAME__PRT "_PRT"
478#define METHOD_NAME__CRS "_CRS"
479#define METHOD_NAME__PRS "_PRS"
480#define METHOD_NAME__PRW "_PRW"
481
482
483acpi_status 421acpi_status
484acpi_ut_osi_implementation ( 422acpi_ut_osi_implementation (
485 struct acpi_walk_state *walk_state); 423 struct acpi_walk_state *walk_state);
@@ -522,39 +460,10 @@ acpi_ut_execute_sxds (
522 struct acpi_namespace_node *device_node, 460 struct acpi_namespace_node *device_node,
523 u8 *highest); 461 u8 *highest);
524 462
525/*
526 * ut_mutex - mutual exclusion interfaces
527 */
528
529acpi_status
530acpi_ut_mutex_initialize (
531 void);
532
533void
534acpi_ut_mutex_terminate (
535 void);
536
537acpi_status
538acpi_ut_create_mutex (
539 acpi_mutex_handle mutex_id);
540
541acpi_status
542acpi_ut_delete_mutex (
543 acpi_mutex_handle mutex_id);
544
545acpi_status
546acpi_ut_acquire_mutex (
547 acpi_mutex_handle mutex_id);
548
549acpi_status
550acpi_ut_release_mutex (
551 acpi_mutex_handle mutex_id);
552
553 463
554/* 464/*
555 * ut_object - internal object create/delete/cache routines 465 * utobject - internal object create/delete/cache routines
556 */ 466 */
557
558union acpi_operand_object * 467union acpi_operand_object *
559acpi_ut_create_internal_object_dbg ( 468acpi_ut_create_internal_object_dbg (
560 char *module_name, 469 char *module_name,
@@ -587,50 +496,15 @@ union acpi_operand_object *
587acpi_ut_create_string_object ( 496acpi_ut_create_string_object (
588 acpi_size string_size); 497 acpi_size string_size);
589 498
590
591/*
592 * ut_ref_cnt - Object reference count management
593 */
594
595void
596acpi_ut_add_reference (
597 union acpi_operand_object *object);
598
599void
600acpi_ut_remove_reference (
601 union acpi_operand_object *object);
602
603/*
604 * ut_size - Object size routines
605 */
606
607acpi_status
608acpi_ut_get_simple_object_size (
609 union acpi_operand_object *obj,
610 acpi_size *obj_length);
611
612acpi_status
613acpi_ut_get_package_object_size (
614 union acpi_operand_object *obj,
615 acpi_size *obj_length);
616
617acpi_status 499acpi_status
618acpi_ut_get_object_size( 500acpi_ut_get_object_size(
619 union acpi_operand_object *obj, 501 union acpi_operand_object *obj,
620 acpi_size *obj_length); 502 acpi_size *obj_length);
621 503
622acpi_status
623acpi_ut_get_element_length (
624 u8 object_type,
625 union acpi_operand_object *source_object,
626 union acpi_generic_state *state,
627 void *context);
628
629 504
630/* 505/*
631 * ut_state - Generic state creation/cache routines 506 * utstate - Generic state creation/cache routines
632 */ 507 */
633
634void 508void
635acpi_ut_push_generic_state ( 509acpi_ut_push_generic_state (
636 union acpi_generic_state **list_head, 510 union acpi_generic_state **list_head,
@@ -666,14 +540,14 @@ acpi_ut_create_update_state_and_push (
666 u16 action, 540 u16 action,
667 union acpi_generic_state **state_list); 541 union acpi_generic_state **state_list);
668 542
669#ifdef ACPI_FUTURE_USAGE 543#ifdef ACPI_FUTURE_USAGE
670acpi_status 544acpi_status
671acpi_ut_create_pkg_state_and_push ( 545acpi_ut_create_pkg_state_and_push (
672 void *internal_object, 546 void *internal_object,
673 void *external_object, 547 void *external_object,
674 u16 index, 548 u16 index,
675 union acpi_generic_state **state_list); 549 union acpi_generic_state **state_list);
676#endif 550#endif /* ACPI_FUTURE_USAGE */
677 551
678union acpi_generic_state * 552union acpi_generic_state *
679acpi_ut_create_control_state ( 553acpi_ut_create_control_state (
@@ -693,15 +567,10 @@ acpi_ut_delete_object_cache (
693 void); 567 void);
694#endif 568#endif
695 569
570
696/* 571/*
697 * utmisc 572 * utmath
698 */ 573 */
699
700void
701acpi_ut_print_string (
702 char *string,
703 u8 max_length);
704
705acpi_status 574acpi_status
706acpi_ut_divide ( 575acpi_ut_divide (
707 acpi_integer in_dividend, 576 acpi_integer in_dividend,
@@ -716,6 +585,25 @@ acpi_ut_short_divide (
716 acpi_integer *out_quotient, 585 acpi_integer *out_quotient,
717 u32 *out_remainder); 586 u32 *out_remainder);
718 587
588/*
589 * utmisc
590 */
591acpi_status
592acpi_ut_walk_package_tree (
593 union acpi_operand_object *source_object,
594 void *target_object,
595 acpi_pkg_callback walk_callback,
596 void *context);
597
598char *
599acpi_ut_strupr (
600 char *src_string);
601
602void
603acpi_ut_print_string (
604 char *string,
605 u8 max_length);
606
719u8 607u8
720acpi_ut_valid_acpi_name ( 608acpi_ut_valid_acpi_name (
721 u32 name); 609 u32 name);
@@ -734,11 +622,21 @@ acpi_ut_strtoul64 (
734 622
735#define ACPI_ANY_BASE 0 623#define ACPI_ANY_BASE 0
736 624
737#ifdef ACPI_FUTURE_USAGE 625acpi_status
738char * 626acpi_ut_mutex_initialize (
739acpi_ut_strupr ( 627 void);
740 char *src_string); 628
741#endif 629void
630acpi_ut_mutex_terminate (
631 void);
632
633acpi_status
634acpi_ut_acquire_mutex (
635 acpi_mutex_handle mutex_id);
636
637acpi_status
638acpi_ut_release_mutex (
639 acpi_mutex_handle mutex_id);
742 640
743u8 * 641u8 *
744acpi_ut_get_resource_end_tag ( 642acpi_ut_get_resource_end_tag (
@@ -768,9 +666,8 @@ acpi_ut_display_init_pathname (
768 666
769 667
770/* 668/*
771 * Utalloc - memory allocation and object caching 669 * utalloc - memory allocation and object caching
772 */ 670 */
773
774void * 671void *
775acpi_ut_acquire_from_cache ( 672acpi_ut_acquire_from_cache (
776 u32 list_id); 673 u32 list_id);
@@ -795,9 +692,6 @@ acpi_ut_initialize_buffer (
795 struct acpi_buffer *buffer, 692 struct acpi_buffer *buffer,
796 acpi_size required_length); 693 acpi_size required_length);
797 694
798
799/* Memory allocation functions */
800
801void * 695void *
802acpi_ut_allocate ( 696acpi_ut_allocate (
803 acpi_size size, 697 acpi_size size,
@@ -812,9 +706,7 @@ acpi_ut_callocate (
812 char *module, 706 char *module,
813 u32 line); 707 u32 line);
814 708
815
816#ifdef ACPI_DBG_TRACK_ALLOCATIONS 709#ifdef ACPI_DBG_TRACK_ALLOCATIONS
817
818void * 710void *
819acpi_ut_allocate_and_track ( 711acpi_ut_allocate_and_track (
820 acpi_size size, 712 acpi_size size,
@@ -836,34 +728,11 @@ acpi_ut_free_and_track (
836 char *module, 728 char *module,
837 u32 line); 729 u32 line);
838 730
839struct acpi_debug_mem_block * 731#ifdef ACPI_FUTURE_USAGE
840acpi_ut_find_allocation (
841 u32 list_id,
842 void *allocation);
843
844acpi_status
845acpi_ut_track_allocation (
846 u32 list_id,
847 struct acpi_debug_mem_block *address,
848 acpi_size size,
849 u8 alloc_type,
850 u32 component,
851 char *module,
852 u32 line);
853
854acpi_status
855acpi_ut_remove_allocation (
856 u32 list_id,
857 struct acpi_debug_mem_block *address,
858 u32 component,
859 char *module,
860 u32 line);
861
862#ifdef ACPI_FUTURE_USAGE
863void 732void
864acpi_ut_dump_allocation_info ( 733acpi_ut_dump_allocation_info (
865 void); 734 void);
866#endif 735#endif /* ACPI_FUTURE_USAGE */
867 736
868void 737void
869acpi_ut_dump_allocations ( 738acpi_ut_dump_allocations (
@@ -871,5 +740,4 @@ acpi_ut_dump_allocations (
871 char *module); 740 char *module);
872#endif 741#endif
873 742
874
875#endif /* _ACUTILS_H */ 743#endif /* _ACUTILS_H */
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index 2ec538eac58..55e97ed2919 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -146,8 +146,7 @@
146 146
147/* prefixed opcodes */ 147/* prefixed opcodes */
148 148
149#define AML_EXTOP (u16) 0x005b 149#define AML_EXTOP (u16) 0x005b /* prefix for 2-byte opcodes */
150
151 150
152#define AML_MUTEX_OP (u16) 0x5b01 151#define AML_MUTEX_OP (u16) 0x5b01
153#define AML_EVENT_OP (u16) 0x5b02 152#define AML_EVENT_OP (u16) 0x5b02
@@ -194,7 +193,6 @@
194 * Use only "Unknown" AML opcodes, don't attempt to use 193 * Use only "Unknown" AML opcodes, don't attempt to use
195 * any valid ACPI ASCII values (A-Z, 0-9, '-') 194 * any valid ACPI ASCII values (A-Z, 0-9, '-')
196 */ 195 */
197
198#define AML_INT_NAMEPATH_OP (u16) 0x002d 196#define AML_INT_NAMEPATH_OP (u16) 0x002d
199#define AML_INT_NAMEDFIELD_OP (u16) 0x0030 197#define AML_INT_NAMEDFIELD_OP (u16) 0x0030
200#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031 198#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031
@@ -214,7 +212,6 @@
214 * There can be up to 31 unique argument types 212 * There can be up to 31 unique argument types
215 * Zero is reserved as end-of-list indicator 213 * Zero is reserved as end-of-list indicator
216 */ 214 */
217
218#define ARGP_BYTEDATA 0x01 215#define ARGP_BYTEDATA 0x01
219#define ARGP_BYTELIST 0x02 216#define ARGP_BYTELIST 0x02
220#define ARGP_CHARLIST 0x03 217#define ARGP_CHARLIST 0x03
@@ -295,7 +292,6 @@
295/* 292/*
296 * opcode groups and types 293 * opcode groups and types
297 */ 294 */
298
299#define OPGRP_NAMED 0x01 295#define OPGRP_NAMED 0x01
300#define OPGRP_FIELD 0x02 296#define OPGRP_FIELD 0x02
301#define OPGRP_BYTELIST 0x04 297#define OPGRP_BYTELIST 0x04
@@ -381,6 +377,12 @@
381#define AML_TYPE_UNDEFINED 0x19 377#define AML_TYPE_UNDEFINED 0x19
382#define AML_TYPE_BOGUS 0x1A 378#define AML_TYPE_BOGUS 0x1A
383 379
380/* AML Package Length encodings */
381
382#define ACPI_AML_PACKAGE_TYPE1 0x40
383#define ACPI_AML_PACKAGE_TYPE2 0x4000
384#define ACPI_AML_PACKAGE_TYPE3 0x400000
385#define ACPI_AML_PACKAGE_TYPE4 0x40000000
384 386
385/* 387/*
386 * Opcode classes 388 * Opcode classes
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h
new file mode 100644
index 00000000000..fd6730e4e56
--- /dev/null
+++ b/include/acpi/pdc_intel.h
@@ -0,0 +1,29 @@
1
2/* _PDC bit definition for Intel processors */
3
4#ifndef __PDC_INTEL_H__
5#define __PDC_INTEL_H__
6
7#define ACPI_PDC_P_FFH (0x0001)
8#define ACPI_PDC_C_C1_HALT (0x0002)
9#define ACPI_PDC_T_FFH (0x0004)
10#define ACPI_PDC_SMP_C1PT (0x0008)
11#define ACPI_PDC_SMP_C2C3 (0x0010)
12#define ACPI_PDC_SMP_P_SWCOORD (0x0020)
13#define ACPI_PDC_SMP_C_SWCOORD (0x0040)
14#define ACPI_PDC_SMP_T_SWCOORD (0x0080)
15#define ACPI_PDC_C_C1_FFH (0x0100)
16
17
18#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \
19 ACPI_PDC_C_C1_HALT)
20
21#define ACPI_PDC_EST_CAPABILITY_SMP_MSR (ACPI_PDC_EST_CAPABILITY_SMP | \
22 ACPI_PDC_P_FFH)
23
24#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \
25 ACPI_PDC_SMP_C1PT | \
26 ACPI_PDC_C_C1_HALT)
27
28#endif /* __PDC_INTEL_H__ */
29
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 57bf9362335..adf969efa51 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -198,6 +198,7 @@
198#endif 198#endif
199#endif /* !DEBUGGER_THREADING */ 199#endif /* !DEBUGGER_THREADING */
200 200
201
201/****************************************************************************** 202/******************************************************************************
202 * 203 *
203 * C library configuration 204 * C library configuration
@@ -209,7 +210,6 @@
209 * Use the standard C library headers. 210 * Use the standard C library headers.
210 * We want to keep these to a minimum. 211 * We want to keep these to a minimum.
211 */ 212 */
212
213#ifdef ACPI_USE_STANDARD_HEADERS 213#ifdef ACPI_USE_STANDARD_HEADERS
214/* 214/*
215 * Use the standard headers from the standard locations 215 * Use the standard headers from the standard locations
@@ -224,14 +224,8 @@
224/* 224/*
225 * We will be linking to the standard Clib functions 225 * We will be linking to the standard Clib functions
226 */ 226 */
227
228#define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) 227#define ACPI_STRSTR(s1,s2) strstr((s1), (s2))
229#define ACPI_STRCHR(s1,c) strchr((s1), (c)) 228#define ACPI_STRCHR(s1,c) strchr((s1), (c))
230
231#ifdef ACPI_FUTURE_USAGE
232#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
233#endif
234
235#define ACPI_STRLEN(s) (acpi_size) strlen((s)) 229#define ACPI_STRLEN(s) (acpi_size) strlen((s))
236#define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) 230#define ACPI_STRCPY(d,s) (void) strcpy((d), (s))
237#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n)) 231#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n))
@@ -254,14 +248,15 @@
254#define ACPI_IS_ALPHA isalpha 248#define ACPI_IS_ALPHA isalpha
255#define ACPI_IS_ASCII isascii 249#define ACPI_IS_ASCII isascii
256 250
251#else
252
257/****************************************************************************** 253/******************************************************************************
258 * 254 *
259 * Not using native C library, use local implementations 255 * Not using native C library, use local implementations
260 * 256 *
261 *****************************************************************************/ 257 *****************************************************************************/
262#else
263 258
264/* 259 /*
265 * Use local definitions of C library macros and functions 260 * Use local definitions of C library macros and functions
266 * NOTE: The function implementations may not be as efficient 261 * NOTE: The function implementations may not be as efficient
267 * as an inline or assembly code implementation provided by a 262 * as an inline or assembly code implementation provided by a
@@ -278,14 +273,12 @@ typedef char *va_list;
278/* 273/*
279 * Storage alignment properties 274 * Storage alignment properties
280 */ 275 */
281
282#define _AUPBND (sizeof (acpi_native_int) - 1) 276#define _AUPBND (sizeof (acpi_native_int) - 1)
283#define _ADNBND (sizeof (acpi_native_int) - 1) 277#define _ADNBND (sizeof (acpi_native_int) - 1)
284 278
285/* 279/*
286 * Variable argument list macro definitions 280 * Variable argument list macro definitions
287 */ 281 */
288
289#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 282#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd)))
290#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) 283#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
291#define va_end(ap) (void) 0 284#define va_end(ap) (void) 0
@@ -296,11 +289,6 @@ typedef char *va_list;
296 289
297#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) 290#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2))
298#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) 291#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c))
299
300#ifdef ACPI_FUTURE_USAGE
301#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
302#endif
303
304#define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) 292#define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s))
305#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s)) 293#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s))
306#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n)) 294#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n))
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 2f50a5bb0c7..50cfea4ff6c 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -4,6 +4,8 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/config.h> 5#include <linux/config.h>
6 6
7#include <asm/acpi.h>
8
7#define ACPI_PROCESSOR_BUSY_METRIC 10 9#define ACPI_PROCESSOR_BUSY_METRIC 10
8 10
9#define ACPI_PROCESSOR_MAX_POWER 8 11#define ACPI_PROCESSOR_MAX_POWER 8
@@ -14,6 +16,8 @@
14#define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */ 16#define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */
15#define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4 17#define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4
16 18
19#define ACPI_PDC_REVISION_ID 0x1
20
17/* Power Management */ 21/* Power Management */
18 22
19struct acpi_processor_cx; 23struct acpi_processor_cx;
@@ -59,6 +63,9 @@ struct acpi_processor_power {
59 u32 bm_activity; 63 u32 bm_activity;
60 int count; 64 int count;
61 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; 65 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
66
67 /* the _PDC objects passed by the driver, if any */
68 struct acpi_object_list *pdc;
62}; 69};
63 70
64/* Performance Management */ 71/* Performance Management */
@@ -82,8 +89,6 @@ struct acpi_processor_px {
82 acpi_integer status; /* success indicator */ 89 acpi_integer status; /* success indicator */
83}; 90};
84 91
85#define ACPI_PDC_REVISION_ID 0x1
86
87struct acpi_processor_performance { 92struct acpi_processor_performance {
88 unsigned int state; 93 unsigned int state;
89 unsigned int platform_limit; 94 unsigned int platform_limit;
@@ -179,7 +184,32 @@ int acpi_processor_notify_smm(struct module *calling_module);
179extern struct acpi_processor *processors[NR_CPUS]; 184extern struct acpi_processor *processors[NR_CPUS];
180extern struct acpi_processor_errata errata; 185extern struct acpi_processor_errata errata;
181 186
187int acpi_processor_set_pdc(struct acpi_processor *pr,
188 struct acpi_object_list *pdc_in);
189
190#ifdef ARCH_HAS_POWER_PDC_INIT
191void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
192 unsigned int cpu);
193void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
194 unsigned int cpu);
195#else
196static inline void acpi_processor_power_init_pdc(
197 struct acpi_processor_power *pow, unsigned int cpu)
198{
199 pow->pdc = NULL;
200 return;
201}
202
203static inline void acpi_processor_power_init_bm_check(
204 struct acpi_processor_flags *flags, unsigned int cpu)
205{
206 flags->bm_check = 1;
207 return;
208}
209#endif
210
182/* in processor_perflib.c */ 211/* in processor_perflib.c */
212
183#ifdef CONFIG_CPU_FREQ 213#ifdef CONFIG_CPU_FREQ
184void acpi_processor_ppc_init(void); 214void acpi_processor_ppc_init(void);
185void acpi_processor_ppc_exit(void); 215void acpi_processor_ppc_exit(void);
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index b7806aa3785..28957697e59 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -58,7 +58,7 @@ struct pci_controller {
58 58
59extern void pcibios_set_master(struct pci_dev *dev); 59extern void pcibios_set_master(struct pci_dev *dev);
60 60
61extern inline void pcibios_penalize_isa_irq(int irq) 61extern inline void pcibios_penalize_isa_irq(int irq, int active)
62{ 62{
63 /* We don't do dynamic PCI IRQ allocation */ 63 /* We don't do dynamic PCI IRQ allocation */
64} 64}
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index e139463d9a0..22b53e369f5 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -132,6 +132,10 @@
132#define __S110 _PAGE_S(0) 132#define __S110 _PAGE_S(0)
133#define __S111 _PAGE_S(0) 133#define __S111 _PAGE_S(0)
134 134
135/*
136 * pgprot_noncached() is only for infiniband pci support, and a real
137 * implementation for RAM would be more complicated.
138 */
135#define pgprot_noncached(prot) (prot) 139#define pgprot_noncached(prot) (prot)
136 140
137/* 141/*
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index e300646fe65..b28f1c95dd6 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -14,7 +14,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
14 /* No special bus mastering setup handling */ 14 /* No special bus mastering setup handling */
15} 15}
16 16
17static inline void pcibios_penalize_isa_irq(int irq) 17static inline void pcibios_penalize_isa_irq(int irq, int active)
18{ 18{
19 /* We don't do dynamic PCI IRQ allocation */ 19 /* We don't do dynamic PCI IRQ allocation */
20} 20}
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h
index 6c6c60adbba..dbb4d859c58 100644
--- a/include/asm-arm/smp.h
+++ b/include/asm-arm/smp.h
@@ -23,9 +23,6 @@
23 23
24#define raw_smp_processor_id() (current_thread_info()->cpu) 24#define raw_smp_processor_id() (current_thread_info()->cpu)
25 25
26extern cpumask_t cpu_present_mask;
27#define cpu_possible_map cpu_present_mask
28
29/* 26/*
30 * at the moment, there's not a big penalty for changing CPUs 27 * at the moment, there's not a big penalty for changing CPUs
31 * (the >big< penalty is running SMP in the first place) 28 * (the >big< penalty is running SMP in the first place)
diff --git a/include/asm-h8300/pci.h b/include/asm-h8300/pci.h
index d032729b19d..5edad5b70fd 100644
--- a/include/asm-h8300/pci.h
+++ b/include/asm-h8300/pci.h
@@ -15,7 +15,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
15 /* No special bus mastering setup handling */ 15 /* No special bus mastering setup handling */
16} 16}
17 17
18extern inline void pcibios_penalize_isa_irq(int irq) 18extern inline void pcibios_penalize_isa_irq(int irq, int active)
19{ 19{
20 /* We don't do dynamic PCI IRQ allocation */ 20 /* We don't do dynamic PCI IRQ allocation */
21} 21}
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index c976c1dadec..cf828ace13f 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -28,6 +28,8 @@
28 28
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <acpi/pdc_intel.h>
32
31#include <asm/system.h> /* defines cmpxchg */ 33#include <asm/system.h> /* defines cmpxchg */
32 34
33#define COMPILER_DEPENDENT_INT64 long long 35#define COMPILER_DEPENDENT_INT64 long long
@@ -101,12 +103,6 @@ __acpi_release_global_lock (unsigned int *lock)
101 :"=r"(n_hi), "=r"(n_lo) \ 103 :"=r"(n_hi), "=r"(n_lo) \
102 :"0"(n_hi), "1"(n_lo)) 104 :"0"(n_hi), "1"(n_lo))
103 105
104/*
105 * Refer Intel ACPI _PDC support document for bit definitions
106 */
107#define ACPI_PDC_EST_CAPABILITY_SMP 0xa
108#define ACPI_PDC_EST_CAPABILITY_MSR 0x1
109
110#ifdef CONFIG_ACPI_BOOT 106#ifdef CONFIG_ACPI_BOOT
111extern int acpi_lapic; 107extern int acpi_lapic;
112extern int acpi_ioapic; 108extern int acpi_ioapic;
@@ -185,6 +181,8 @@ extern void acpi_reserve_bootmem(void);
185 181
186extern u8 x86_acpiid_to_apicid[]; 182extern u8 x86_acpiid_to_apicid[];
187 183
184#define ARCH_HAS_POWER_PDC_INIT 1
185
188#endif /*__KERNEL__*/ 186#endif /*__KERNEL__*/
189 187
190#endif /*_ASM_ACPI_H*/ 188#endif /*_ASM_ACPI_H*/
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index 0fed5e3c699..a96a8f48fbf 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -109,11 +109,7 @@
109 109
110#define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) 110#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))
111 111
112#ifdef CONFIG_NUMA 112#define MAX_IO_APICS 64
113 #define MAX_IO_APICS 32
114#else
115 #define MAX_IO_APICS 8
116#endif
117 113
118/* 114/*
119 * the local APIC register structure, memory mapped. Not terribly well 115 * the local APIC register structure, memory mapped. Not terribly well
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index 3561899eb82..78c85985aee 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -27,7 +27,7 @@ void pcibios_config_init(void);
27struct pci_bus * pcibios_scan_root(int bus); 27struct pci_bus * pcibios_scan_root(int bus);
28 28
29void pcibios_set_master(struct pci_dev *dev); 29void pcibios_set_master(struct pci_dev *dev);
30void pcibios_penalize_isa_irq(int irq); 30void pcibios_penalize_isa_irq(int irq, int active);
31struct irq_routing_table *pcibios_get_irq_routing_table(void); 31struct irq_routing_table *pcibios_get_irq_routing_table(void);
32int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); 32int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
33 33
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index e25e4c71a87..a7cb377745b 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -296,8 +296,11 @@
296#define __NR_keyctl 288 296#define __NR_keyctl 288
297#define __NR_ioprio_set 289 297#define __NR_ioprio_set 289
298#define __NR_ioprio_get 290 298#define __NR_ioprio_get 290
299#define __NR_inotify_init 291
300#define __NR_inotify_add_watch 292
301#define __NR_inotify_rm_watch 293
299 302
300#define NR_syscalls 291 303#define NR_syscalls 294
301 304
302/* 305/*
303 * user-visible error numbers are in the range -1 - -128: see 306 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 6a26a977f25..4c06d455139 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -98,6 +98,15 @@ const char *acpi_get_sysname (void);
98int acpi_request_vector (u32 int_type); 98int acpi_request_vector (u32 int_type);
99int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 99int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
100 100
101/*
102 * Record the cpei override flag and current logical cpu. This is
103 * useful for CPU removal.
104 */
105extern unsigned int can_cpei_retarget(void);
106extern unsigned int is_cpu_cpei_target(unsigned int cpu);
107extern void set_cpei_target_cpu(unsigned int cpu);
108extern unsigned int get_cpei_target_cpu(void);
109
101#ifdef CONFIG_ACPI_NUMA 110#ifdef CONFIG_ACPI_NUMA
102/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/ 111/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/
103#define MAX_PXM_DOMAINS (256) 112#define MAX_PXM_DOMAINS (256)
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
index 8b7237cc84c..dba9f220be7 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -47,7 +47,7 @@ pcibios_set_master (struct pci_dev *dev)
47} 47}
48 48
49static inline void 49static inline void
50pcibios_penalize_isa_irq (int irq) 50pcibios_penalize_isa_irq (int irq, int active)
51{ 51{
52 /* We don't do dynamic PCI IRQ allocation */ 52 /* We don't do dynamic PCI IRQ allocation */
53} 53}
diff --git a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h
index 9e7d79ab5d1..9d2c07abe44 100644
--- a/include/asm-m68k/pci.h
+++ b/include/asm-m68k/pci.h
@@ -43,7 +43,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
43 /* No special bus mastering setup handling */ 43 /* No special bus mastering setup handling */
44} 44}
45 45
46static inline void pcibios_penalize_isa_irq(int irq) 46static inline void pcibios_penalize_isa_irq(int irq, int active)
47{ 47{
48 /* We don't do dynamic PCI IRQ allocation */ 48 /* We don't do dynamic PCI IRQ allocation */
49} 49}
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 2d323b6e147..d70dc355c1f 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -69,7 +69,7 @@ extern unsigned long PCIBIOS_MIN_MEM;
69 69
70extern void pcibios_set_master(struct pci_dev *dev); 70extern void pcibios_set_master(struct pci_dev *dev);
71 71
72static inline void pcibios_penalize_isa_irq(int irq) 72static inline void pcibios_penalize_isa_irq(int irq, int active)
73{ 73{
74 /* We don't do dynamic PCI IRQ allocation */ 74 /* We don't do dynamic PCI IRQ allocation */
75} 75}
diff --git a/include/asm-ppc/kexec.h b/include/asm-ppc/kexec.h
index 73191310d8d..6d2aa0aa464 100644
--- a/include/asm-ppc/kexec.h
+++ b/include/asm-ppc/kexec.h
@@ -27,6 +27,8 @@
27 27
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29 29
30extern void *crash_notes;
31
30struct kimage; 32struct kimage;
31 33
32extern void machine_kexec_simple(struct kimage *image); 34extern void machine_kexec_simple(struct kimage *image);
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index db0a2a0ec74..a13d55870e6 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -37,7 +37,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
37 /* No special bus mastering setup handling */ 37 /* No special bus mastering setup handling */
38} 38}
39 39
40extern inline void pcibios_penalize_isa_irq(int irq) 40extern inline void pcibios_penalize_isa_irq(int irq, int active)
41{ 41{
42 /* We don't do dynamic PCI IRQ allocation */ 42 /* We don't do dynamic PCI IRQ allocation */
43} 43}
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
index d12dfce21e2..faa77222307 100644
--- a/include/asm-ppc64/pci.h
+++ b/include/asm-ppc64/pci.h
@@ -37,7 +37,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
37 /* No special bus mastering setup handling */ 37 /* No special bus mastering setup handling */
38} 38}
39 39
40static inline void pcibios_penalize_isa_irq(int irq) 40static inline void pcibios_penalize_isa_irq(int irq, int active)
41{ 41{
42 /* We don't do dynamic PCI IRQ allocation */ 42 /* We don't do dynamic PCI IRQ allocation */
43} 43}
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
index 26044889c77..0a523c85b11 100644
--- a/include/asm-sh/pci.h
+++ b/include/asm-sh/pci.h
@@ -36,7 +36,7 @@ struct pci_dev;
36 36
37extern void pcibios_set_master(struct pci_dev *dev); 37extern void pcibios_set_master(struct pci_dev *dev);
38 38
39static inline void pcibios_penalize_isa_irq(int irq) 39static inline void pcibios_penalize_isa_irq(int irq, int active)
40{ 40{
41 /* We don't do dynamic PCI IRQ allocation */ 41 /* We don't do dynamic PCI IRQ allocation */
42} 42}
diff --git a/include/asm-sh64/pci.h b/include/asm-sh64/pci.h
index c68870e02d9..aa8043089bb 100644
--- a/include/asm-sh64/pci.h
+++ b/include/asm-sh64/pci.h
@@ -26,7 +26,7 @@ extern void pcibios_set_master(struct pci_dev *dev);
26/* 26/*
27 * Set penalize isa irq function 27 * Set penalize isa irq function
28 */ 28 */
29static inline void pcibios_penalize_isa_irq(int irq) 29static inline void pcibios_penalize_isa_irq(int irq, int active)
30{ 30{
31 /* We don't do dynamic PCI IRQ allocation */ 31 /* We don't do dynamic PCI IRQ allocation */
32} 32}
diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h
index 44bb38758c9..97052baf90c 100644
--- a/include/asm-sparc/pci.h
+++ b/include/asm-sparc/pci.h
@@ -20,7 +20,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
20 /* No special bus mastering setup handling */ 20 /* No special bus mastering setup handling */
21} 21}
22 22
23extern inline void pcibios_penalize_isa_irq(int irq) 23extern inline void pcibios_penalize_isa_irq(int irq, int active)
24{ 24{
25 /* We don't do dynamic PCI IRQ allocation */ 25 /* We don't do dynamic PCI IRQ allocation */
26} 26}
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 84e41c1ef3f..a4ab0ec7143 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -23,7 +23,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
23 /* No special bus mastering setup handling */ 23 /* No special bus mastering setup handling */
24} 24}
25 25
26static inline void pcibios_penalize_isa_irq(int irq) 26static inline void pcibios_penalize_isa_irq(int irq, int active)
27{ 27{
28 /* We don't do dynamic PCI IRQ allocation */ 28 /* We don't do dynamic PCI IRQ allocation */
29} 29}
diff --git a/include/asm-sparc64/seccomp.h b/include/asm-sparc64/seccomp.h
new file mode 100644
index 00000000000..7fcd9968192
--- /dev/null
+++ b/include/asm-sparc64/seccomp.h
@@ -0,0 +1,21 @@
1#ifndef _ASM_SECCOMP_H
2
3#include <linux/thread_info.h> /* already defines TIF_32BIT */
4
5#ifndef TIF_32BIT
6#error "unexpected TIF_32BIT on sparc64"
7#endif
8
9#include <linux/unistd.h>
10
11#define __NR_seccomp_read __NR_read
12#define __NR_seccomp_write __NR_write
13#define __NR_seccomp_exit __NR_exit
14#define __NR_seccomp_sigreturn __NR_rt_sigreturn
15
16#define __NR_seccomp_read_32 __NR_read
17#define __NR_seccomp_write_32 __NR_write
18#define __NR_seccomp_exit_32 __NR_exit
19#define __NR_seccomp_sigreturn_32 __NR_sigreturn
20
21#endif /* _ASM_SECCOMP_H */
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 7529c9c853d..095bb627b96 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -16,8 +16,12 @@
16 16
17#define deactivate_mm(tsk,mm) do { } while (0) 17#define deactivate_mm(tsk,mm) do { } while (0)
18 18
19extern void force_flush_all(void);
20
19static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) 21static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
20{ 22{
23 if (old != new)
24 force_flush_all();
21} 25}
22 26
23static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 27static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index a6b41b89206..dc8c981af27 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -28,6 +28,8 @@
28 28
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <acpi/pdc_intel.h>
32
31#define COMPILER_DEPENDENT_INT64 long long 33#define COMPILER_DEPENDENT_INT64 long long
32#define COMPILER_DEPENDENT_UINT64 unsigned long long 34#define COMPILER_DEPENDENT_UINT64 unsigned long long
33 35
@@ -99,12 +101,6 @@ __acpi_release_global_lock (unsigned int *lock)
99 :"=r"(n_hi), "=r"(n_lo) \ 101 :"=r"(n_hi), "=r"(n_lo) \
100 :"0"(n_hi), "1"(n_lo)) 102 :"0"(n_hi), "1"(n_lo))
101 103
102/*
103 * Refer Intel ACPI _PDC support document for bit definitions
104 */
105#define ACPI_PDC_EST_CAPABILITY_SMP 0xa
106#define ACPI_PDC_EST_CAPABILITY_MSR 0x1
107
108#ifdef CONFIG_ACPI_BOOT 104#ifdef CONFIG_ACPI_BOOT
109extern int acpi_lapic; 105extern int acpi_lapic;
110extern int acpi_ioapic; 106extern int acpi_ioapic;
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index c1961db88fa..eeb3088a1c9 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -33,7 +33,7 @@ extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int le
33extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); 33extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
34 34
35void pcibios_set_master(struct pci_dev *dev); 35void pcibios_set_master(struct pci_dev *dev);
36void pcibios_penalize_isa_irq(int irq); 36void pcibios_penalize_isa_irq(int irq, int active);
37struct irq_routing_table *pcibios_get_irq_routing_table(void); 37struct irq_routing_table *pcibios_get_irq_routing_table(void);
38int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); 38int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
39 39
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index ef8483673aa..f85cbe919e1 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -206,7 +206,10 @@ struct acpi_table_plat_int_src {
206 u8 eid; 206 u8 eid;
207 u8 iosapic_vector; 207 u8 iosapic_vector;
208 u32 global_irq; 208 u32 global_irq;
209 u32 reserved; 209 struct {
210 u32 cpei_override_flag:1;
211 u32 reserved:31;
212 } plint_flags;
210} __attribute__ ((packed)); 213} __attribute__ ((packed));
211 214
212enum acpi_interrupt_id { 215enum acpi_interrupt_id {
@@ -475,7 +478,7 @@ struct acpi_prt_list {
475struct pci_dev; 478struct pci_dev;
476 479
477int acpi_pci_irq_enable (struct pci_dev *dev); 480int acpi_pci_irq_enable (struct pci_dev *dev);
478void acpi_penalize_isa_irq(int irq); 481void acpi_penalize_isa_irq(int irq, int active);
479 482
480#ifdef CONFIG_ACPI_DEALLOCATE_IRQ 483#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
481void acpi_pci_irq_disable (struct pci_dev *dev); 484void acpi_pci_irq_disable (struct pci_dev *dev);
diff --git a/include/linux/device.h b/include/linux/device.h
index f378c846e6d..06e5d42f2c7 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -284,8 +284,10 @@ struct device {
284 struct device_driver *driver; /* which driver has allocated this 284 struct device_driver *driver; /* which driver has allocated this
285 device */ 285 device */
286 void *driver_data; /* data private to the driver */ 286 void *driver_data; /* data private to the driver */
287 void *platform_data; /* Platform specific data (e.g. ACPI, 287 void *platform_data; /* Platform specific data, device
288 BIOS data relevant to device) */ 288 core doesn't touch it */
289 void *firmware_data; /* Firmware specific data (e.g. ACPI,
290 BIOS data),reserved for device core*/
289 struct dev_pm_info power; 291 struct dev_pm_info power;
290 292
291 u64 *dma_mask; /* dma mask (if dma'able device) */ 293 u64 *dma_mask; /* dma mask (if dma'able device) */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index cf3847edc50..ce8518e658b 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -33,7 +33,7 @@ extern int eth_header(struct sk_buff *skb, struct net_device *dev,
33 unsigned short type, void *daddr, 33 unsigned short type, void *daddr,
34 void *saddr, unsigned len); 34 void *saddr, unsigned len);
35extern int eth_rebuild_header(struct sk_buff *skb); 35extern int eth_rebuild_header(struct sk_buff *skb);
36extern unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev); 36extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
37extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, 37extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev,
38 unsigned char * haddr); 38 unsigned char * haddr);
39extern int eth_header_cache(struct neighbour *neigh, 39extern int eth_header_cache(struct neighbour *neigh,
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 4b6e1ab216a..c16662836c5 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -239,6 +239,20 @@ struct ext3_new_group_data {
239#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) 239#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
240 240
241/* 241/*
242 * Mount options
243 */
244struct ext3_mount_options {
245 unsigned long s_mount_opt;
246 uid_t s_resuid;
247 gid_t s_resgid;
248 unsigned long s_commit_interval;
249#ifdef CONFIG_QUOTA
250 int s_jquota_fmt;
251 char *s_qf_names[MAXQUOTAS];
252#endif
253};
254
255/*
242 * Structure of an inode on the disk 256 * Structure of an inode on the disk
243 */ 257 */
244struct ext3_inode { 258struct ext3_inode {
diff --git a/include/linux/fddidevice.h b/include/linux/fddidevice.h
index 002f6367697..e61e42dfd31 100644
--- a/include/linux/fddidevice.h
+++ b/include/linux/fddidevice.h
@@ -25,7 +25,7 @@
25#include <linux/if_fddi.h> 25#include <linux/if_fddi.h>
26 26
27#ifdef __KERNEL__ 27#ifdef __KERNEL__
28extern unsigned short fddi_type_trans(struct sk_buff *skb, 28extern __be16 fddi_type_trans(struct sk_buff *skb,
29 struct net_device *dev); 29 struct net_device *dev);
30extern struct net_device *alloc_fddidev(int sizeof_priv); 30extern struct net_device *alloc_fddidev(int sizeof_priv);
31#endif 31#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 302ec20838c..c9bf3746a9f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -474,6 +474,11 @@ struct inode {
474 struct dnotify_struct *i_dnotify; /* for directory notifications */ 474 struct dnotify_struct *i_dnotify; /* for directory notifications */
475#endif 475#endif
476 476
477#ifdef CONFIG_INOTIFY
478 struct list_head inotify_watches; /* watches on this inode */
479 struct semaphore inotify_sem; /* protects the watches list */
480#endif
481
477 unsigned long i_state; 482 unsigned long i_state;
478 unsigned long dirtied_when; /* jiffies of first dirtying */ 483 unsigned long dirtied_when; /* jiffies of first dirtying */
479 484
@@ -1393,7 +1398,6 @@ extern void emergency_remount(void);
1393extern int do_remount_sb(struct super_block *sb, int flags, 1398extern int do_remount_sb(struct super_block *sb, int flags,
1394 void *data, int force); 1399 void *data, int force);
1395extern sector_t bmap(struct inode *, sector_t); 1400extern sector_t bmap(struct inode *, sector_t);
1396extern int setattr_mask(unsigned int);
1397extern int notify_change(struct dentry *, struct iattr *); 1401extern int notify_change(struct dentry *, struct iattr *);
1398extern int permission(struct inode *, int, struct nameidata *); 1402extern int permission(struct inode *, int, struct nameidata *);
1399extern int generic_permission(struct inode *, int, 1403extern int generic_permission(struct inode *, int,
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
new file mode 100644
index 00000000000..d07a92c9477
--- /dev/null
+++ b/include/linux/fsnotify.h
@@ -0,0 +1,248 @@
1#ifndef _LINUX_FS_NOTIFY_H
2#define _LINUX_FS_NOTIFY_H
3
4/*
5 * include/linux/fsnotify.h - generic hooks for filesystem notification, to
6 * reduce in-source duplication from both dnotify and inotify.
7 *
8 * We don't compile any of this away in some complicated menagerie of ifdefs.
9 * Instead, we rely on the code inside to optimize away as needed.
10 *
11 * (C) Copyright 2005 Robert Love
12 */
13
14#ifdef __KERNEL__
15
16#include <linux/dnotify.h>
17#include <linux/inotify.h>
18
19/*
20 * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
21 */
22static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
23 const char *old_name, const char *new_name,
24 int isdir)
25{
26 u32 cookie = inotify_get_cookie();
27
28 if (old_dir == new_dir)
29 inode_dir_notify(old_dir, DN_RENAME);
30 else {
31 inode_dir_notify(old_dir, DN_DELETE);
32 inode_dir_notify(new_dir, DN_CREATE);
33 }
34
35 if (isdir)
36 isdir = IN_ISDIR;
37 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name);
38 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name);
39}
40
41/*
42 * fsnotify_unlink - file was unlinked
43 */
44static inline void fsnotify_unlink(struct dentry *dentry, struct inode *dir)
45{
46 struct inode *inode = dentry->d_inode;
47
48 inode_dir_notify(dir, DN_DELETE);
49 inotify_inode_queue_event(dir, IN_DELETE, 0, dentry->d_name.name);
50 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL);
51
52 inotify_inode_is_dead(inode);
53}
54
55/*
56 * fsnotify_rmdir - directory was removed
57 */
58static inline void fsnotify_rmdir(struct dentry *dentry, struct inode *inode,
59 struct inode *dir)
60{
61 inode_dir_notify(dir, DN_DELETE);
62 inotify_inode_queue_event(dir,IN_DELETE|IN_ISDIR,0,dentry->d_name.name);
63 inotify_inode_queue_event(inode, IN_DELETE_SELF | IN_ISDIR, 0, NULL);
64 inotify_inode_is_dead(inode);
65}
66
67/*
68 * fsnotify_create - 'name' was linked in
69 */
70static inline void fsnotify_create(struct inode *inode, const char *name)
71{
72 inode_dir_notify(inode, DN_CREATE);
73 inotify_inode_queue_event(inode, IN_CREATE, 0, name);
74}
75
76/*
77 * fsnotify_mkdir - directory 'name' was created
78 */
79static inline void fsnotify_mkdir(struct inode *inode, const char *name)
80{
81 inode_dir_notify(inode, DN_CREATE);
82 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, name);
83}
84
85/*
86 * fsnotify_access - file was read
87 */
88static inline void fsnotify_access(struct dentry *dentry)
89{
90 struct inode *inode = dentry->d_inode;
91 u32 mask = IN_ACCESS;
92
93 if (S_ISDIR(inode->i_mode))
94 mask |= IN_ISDIR;
95
96 dnotify_parent(dentry, DN_ACCESS);
97 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
98 inotify_inode_queue_event(inode, mask, 0, NULL);
99}
100
101/*
102 * fsnotify_modify - file was modified
103 */
104static inline void fsnotify_modify(struct dentry *dentry)
105{
106 struct inode *inode = dentry->d_inode;
107 u32 mask = IN_MODIFY;
108
109 if (S_ISDIR(inode->i_mode))
110 mask |= IN_ISDIR;
111
112 dnotify_parent(dentry, DN_MODIFY);
113 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
114 inotify_inode_queue_event(inode, mask, 0, NULL);
115}
116
117/*
118 * fsnotify_open - file was opened
119 */
120static inline void fsnotify_open(struct dentry *dentry)
121{
122 struct inode *inode = dentry->d_inode;
123 u32 mask = IN_OPEN;
124
125 if (S_ISDIR(inode->i_mode))
126 mask |= IN_ISDIR;
127
128 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
129 inotify_inode_queue_event(inode, mask, 0, NULL);
130}
131
132/*
133 * fsnotify_close - file was closed
134 */
135static inline void fsnotify_close(struct file *file)
136{
137 struct dentry *dentry = file->f_dentry;
138 struct inode *inode = dentry->d_inode;
139 const char *name = dentry->d_name.name;
140 mode_t mode = file->f_mode;
141 u32 mask = (mode & FMODE_WRITE) ? IN_CLOSE_WRITE : IN_CLOSE_NOWRITE;
142
143 if (S_ISDIR(inode->i_mode))
144 mask |= IN_ISDIR;
145
146 inotify_dentry_parent_queue_event(dentry, mask, 0, name);
147 inotify_inode_queue_event(inode, mask, 0, NULL);
148}
149
150/*
151 * fsnotify_xattr - extended attributes were changed
152 */
153static inline void fsnotify_xattr(struct dentry *dentry)
154{
155 struct inode *inode = dentry->d_inode;
156 u32 mask = IN_ATTRIB;
157
158 if (S_ISDIR(inode->i_mode))
159 mask |= IN_ISDIR;
160
161 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
162 inotify_inode_queue_event(inode, mask, 0, NULL);
163}
164
165/*
166 * fsnotify_change - notify_change event. file was modified and/or metadata
167 * was changed.
168 */
169static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
170{
171 struct inode *inode = dentry->d_inode;
172 int dn_mask = 0;
173 u32 in_mask = 0;
174
175 if (ia_valid & ATTR_UID) {
176 in_mask |= IN_ATTRIB;
177 dn_mask |= DN_ATTRIB;
178 }
179 if (ia_valid & ATTR_GID) {
180 in_mask |= IN_ATTRIB;
181 dn_mask |= DN_ATTRIB;
182 }
183 if (ia_valid & ATTR_SIZE) {
184 in_mask |= IN_MODIFY;
185 dn_mask |= DN_MODIFY;
186 }
187 /* both times implies a utime(s) call */
188 if ((ia_valid & (ATTR_ATIME | ATTR_MTIME)) == (ATTR_ATIME | ATTR_MTIME))
189 {
190 in_mask |= IN_ATTRIB;
191 dn_mask |= DN_ATTRIB;
192 } else if (ia_valid & ATTR_ATIME) {
193 in_mask |= IN_ACCESS;
194 dn_mask |= DN_ACCESS;
195 } else if (ia_valid & ATTR_MTIME) {
196 in_mask |= IN_MODIFY;
197 dn_mask |= DN_MODIFY;
198 }
199 if (ia_valid & ATTR_MODE) {
200 in_mask |= IN_ATTRIB;
201 dn_mask |= DN_ATTRIB;
202 }
203
204 if (dn_mask)
205 dnotify_parent(dentry, dn_mask);
206 if (in_mask) {
207 if (S_ISDIR(inode->i_mode))
208 in_mask |= IN_ISDIR;
209 inotify_inode_queue_event(inode, in_mask, 0, NULL);
210 inotify_dentry_parent_queue_event(dentry, in_mask, 0,
211 dentry->d_name.name);
212 }
213}
214
215#ifdef CONFIG_INOTIFY /* inotify helpers */
216
217/*
218 * fsnotify_oldname_init - save off the old filename before we change it
219 */
220static inline const char *fsnotify_oldname_init(const char *name)
221{
222 return kstrdup(name, GFP_KERNEL);
223}
224
225/*
226 * fsnotify_oldname_free - free the name we got from fsnotify_oldname_init
227 */
228static inline void fsnotify_oldname_free(const char *old_name)
229{
230 kfree(old_name);
231}
232
233#else /* CONFIG_INOTIFY */
234
235static inline const char *fsnotify_oldname_init(const char *name)
236{
237 return NULL;
238}
239
240static inline void fsnotify_oldname_free(const char *old_name)
241{
242}
243
244#endif /* ! CONFIG_INOTIFY */
245
246#endif /* __KERNEL__ */
247
248#endif /* _LINUX_FS_NOTIFY_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 8336dba1897..5912874ca83 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -2,6 +2,7 @@
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5#include <linux/preempt.h>
5#include <linux/smp_lock.h> 6#include <linux/smp_lock.h>
6#include <asm/hardirq.h> 7#include <asm/hardirq.h>
7#include <asm/system.h> 8#include <asm/system.h>
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index ed2927ef1ff..df695e9ae32 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -242,8 +242,8 @@ static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
242} 242}
243 243
244 244
245static __inline__ unsigned short hdlc_type_trans(struct sk_buff *skb, 245static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
246 struct net_device *dev) 246 struct net_device *dev)
247{ 247{
248 hdlc_device *hdlc = dev_to_hdlc(dev); 248 hdlc_device *hdlc = dev_to_hdlc(dev);
249 249
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
new file mode 100644
index 00000000000..a40c2bf0408
--- /dev/null
+++ b/include/linux/inotify.h
@@ -0,0 +1,108 @@
1/*
2 * Inode based directory notification for Linux
3 *
4 * Copyright (C) 2005 John McCutchan
5 */
6
7#ifndef _LINUX_INOTIFY_H
8#define _LINUX_INOTIFY_H
9
10#include <linux/types.h>
11
12/*
13 * struct inotify_event - structure read from the inotify device for each event
14 *
15 * When you are watching a directory, you will receive the filename for events
16 * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
17 */
18struct inotify_event {
19 __s32 wd; /* watch descriptor */
20 __u32 mask; /* watch mask */
21 __u32 cookie; /* cookie to synchronize two events */
22 __u32 len; /* length (including nulls) of name */
23 char name[0]; /* stub for possible name */
24};
25
26/* the following are legal, implemented events that user-space can watch for */
27#define IN_ACCESS 0x00000001 /* File was accessed */
28#define IN_MODIFY 0x00000002 /* File was modified */
29#define IN_ATTRIB 0x00000004 /* Metadata changed */
30#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
31#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
32#define IN_OPEN 0x00000020 /* File was opened */
33#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
34#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
35#define IN_CREATE 0x00000100 /* Subfile was created */
36#define IN_DELETE 0x00000200 /* Subfile was deleted */
37#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
38
39/* the following are legal events. they are sent as needed to any watch */
40#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
41#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
42#define IN_IGNORED 0x00008000 /* File was ignored */
43
44/* helper events */
45#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
46#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
47
48/* special flags */
49#define IN_ISDIR 0x40000000 /* event occurred against dir */
50#define IN_ONESHOT 0x80000000 /* only send event once */
51
52/*
53 * All of the events - we build the list by hand so that we can add flags in
54 * the future and not break backward compatibility. Apps will get only the
55 * events that they originally wanted. Be sure to add new events here!
56 */
57#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
58 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
59 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF)
60
61#ifdef __KERNEL__
62
63#include <linux/dcache.h>
64#include <linux/fs.h>
65#include <linux/config.h>
66
67#ifdef CONFIG_INOTIFY
68
69extern void inotify_inode_queue_event(struct inode *, __u32, __u32,
70 const char *);
71extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32,
72 const char *);
73extern void inotify_unmount_inodes(struct list_head *);
74extern void inotify_inode_is_dead(struct inode *);
75extern u32 inotify_get_cookie(void);
76
77#else
78
79static inline void inotify_inode_queue_event(struct inode *inode,
80 __u32 mask, __u32 cookie,
81 const char *filename)
82{
83}
84
85static inline void inotify_dentry_parent_queue_event(struct dentry *dentry,
86 __u32 mask, __u32 cookie,
87 const char *filename)
88{
89}
90
91static inline void inotify_unmount_inodes(struct list_head *list)
92{
93}
94
95static inline void inotify_inode_is_dead(struct inode *inode)
96{
97}
98
99static inline u32 inotify_get_cookie(void)
100{
101 return 0;
102}
103
104#endif /* CONFIG_INOTIFY */
105
106#endif /* __KERNEL __ */
107
108#endif /* _LINUX_INOTIFY_H */
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 74b4727a4e3..f8f39937e30 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -12,6 +12,7 @@
12#define _LINUX_MOUNT_H 12#define _LINUX_MOUNT_H
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14 14
15#include <linux/types.h>
15#include <linux/list.h> 16#include <linux/list.h>
16#include <linux/spinlock.h> 17#include <linux/spinlock.h>
17#include <asm/atomic.h> 18#include <asm/atomic.h>
@@ -76,6 +77,7 @@ extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
76extern void mark_mounts_for_expiry(struct list_head *mounts); 77extern void mark_mounts_for_expiry(struct list_head *mounts);
77 78
78extern spinlock_t vfsmount_lock; 79extern spinlock_t vfsmount_lock;
80extern dev_t name_to_dev_t(char *name);
79 81
80#endif 82#endif
81#endif /* _LINUX_MOUNT_H */ 83#endif /* _LINUX_MOUNT_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 27e4d164a10..2f0c085f2c7 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -16,6 +16,7 @@
16#define NETLINK_AUDIT 9 /* auditing */ 16#define NETLINK_AUDIT 9 /* auditing */
17#define NETLINK_FIB_LOOKUP 10 17#define NETLINK_FIB_LOOKUP 10
18#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ 18#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */
19#define NETLINK_NETFILTER 12 /* netfilter subsystem */
19#define NETLINK_IP6_FW 13 20#define NETLINK_IP6_FW 13
20#define NETLINK_DNRTMSG 14 /* DECnet routing messages */ 21#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
21#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ 22#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 14479325e3f..7aeb208ed71 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -176,7 +176,7 @@ struct pm_ops {
176}; 176};
177 177
178extern void pm_set_ops(struct pm_ops *); 178extern void pm_set_ops(struct pm_ops *);
179 179extern struct pm_ops *pm_ops;
180extern int pm_suspend(suspend_state_t state); 180extern int pm_suspend(suspend_state_t state);
181 181
182 182
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 0760507a545..0a3605099c4 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -4,29 +4,29 @@
4#define REISERFS_ACL_VERSION 0x0001 4#define REISERFS_ACL_VERSION 0x0001
5 5
6typedef struct { 6typedef struct {
7 __le16 e_tag; 7 __le16 e_tag;
8 __le16 e_perm; 8 __le16 e_perm;
9 __le32 e_id; 9 __le32 e_id;
10} reiserfs_acl_entry; 10} reiserfs_acl_entry;
11 11
12typedef struct { 12typedef struct {
13 __le16 e_tag; 13 __le16 e_tag;
14 __le16 e_perm; 14 __le16 e_perm;
15} reiserfs_acl_entry_short; 15} reiserfs_acl_entry_short;
16 16
17typedef struct { 17typedef struct {
18 __le32 a_version; 18 __le32 a_version;
19} reiserfs_acl_header; 19} reiserfs_acl_header;
20 20
21static inline size_t reiserfs_acl_size(int count) 21static inline size_t reiserfs_acl_size(int count)
22{ 22{
23 if (count <= 4) { 23 if (count <= 4) {
24 return sizeof(reiserfs_acl_header) + 24 return sizeof(reiserfs_acl_header) +
25 count * sizeof(reiserfs_acl_entry_short); 25 count * sizeof(reiserfs_acl_entry_short);
26 } else { 26 } else {
27 return sizeof(reiserfs_acl_header) + 27 return sizeof(reiserfs_acl_header) +
28 4 * sizeof(reiserfs_acl_entry_short) + 28 4 * sizeof(reiserfs_acl_entry_short) +
29 (count - 4) * sizeof(reiserfs_acl_entry); 29 (count - 4) * sizeof(reiserfs_acl_entry);
30 } 30 }
31} 31}
32 32
@@ -46,14 +46,14 @@ static inline int reiserfs_acl_count(size_t size)
46 } 46 }
47} 47}
48 48
49
50#ifdef CONFIG_REISERFS_FS_POSIX_ACL 49#ifdef CONFIG_REISERFS_FS_POSIX_ACL
51struct posix_acl * reiserfs_get_acl(struct inode *inode, int type); 50struct posix_acl *reiserfs_get_acl(struct inode *inode, int type);
52int reiserfs_acl_chmod (struct inode *inode); 51int reiserfs_acl_chmod(struct inode *inode);
53int reiserfs_inherit_default_acl (struct inode *dir, struct dentry *dentry, struct inode *inode); 52int reiserfs_inherit_default_acl(struct inode *dir, struct dentry *dentry,
54int reiserfs_cache_default_acl (struct inode *dir); 53 struct inode *inode);
55extern int reiserfs_xattr_posix_acl_init (void) __init; 54int reiserfs_cache_default_acl(struct inode *dir);
56extern int reiserfs_xattr_posix_acl_exit (void); 55extern int reiserfs_xattr_posix_acl_init(void) __init;
56extern int reiserfs_xattr_posix_acl_exit(void);
57extern struct reiserfs_xattr_handler posix_acl_default_handler; 57extern 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
@@ -61,28 +61,26 @@ extern struct reiserfs_xattr_handler posix_acl_access_handler;
61#define reiserfs_get_acl NULL 61#define reiserfs_get_acl NULL
62#define reiserfs_cache_default_acl(inode) 0 62#define reiserfs_cache_default_acl(inode) 0
63 63
64static inline int 64static inline int reiserfs_xattr_posix_acl_init(void)
65reiserfs_xattr_posix_acl_init (void)
66{ 65{
67 return 0; 66 return 0;
68} 67}
69 68
70static inline int 69static inline int reiserfs_xattr_posix_acl_exit(void)
71reiserfs_xattr_posix_acl_exit (void)
72{ 70{
73 return 0; 71 return 0;
74} 72}
75 73
76static inline int 74static inline int reiserfs_acl_chmod(struct inode *inode)
77reiserfs_acl_chmod (struct inode *inode)
78{ 75{
79 return 0; 76 return 0;
80} 77}
81 78
82static inline int 79static inline int
83reiserfs_inherit_default_acl (const struct inode *dir, struct dentry *dentry, struct inode *inode) 80reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry,
81 struct inode *inode)
84{ 82{
85 return 0; 83 return 0;
86} 84}
87 85
88#endif 86#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 4c7c5689ad9..17e458e17e2 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -3,11 +3,10 @@
3 */ 3 */
4 4
5 /* this file has an amazingly stupid 5 /* this file has an amazingly stupid
6 name, yura please fix it to be 6 name, yura please fix it to be
7 reiserfs.h, and merge all the rest 7 reiserfs.h, and merge all the rest
8 of our .h files that are in this 8 of our .h files that are in this
9 directory into it. */ 9 directory into it. */
10
11 10
12#ifndef _LINUX_REISER_FS_H 11#ifndef _LINUX_REISER_FS_H
13#define _LINUX_REISER_FS_H 12#define _LINUX_REISER_FS_H
@@ -74,9 +73,9 @@
74/* debug levels. Right now, CONFIG_REISERFS_CHECK means print all debug 73/* debug levels. Right now, CONFIG_REISERFS_CHECK means print all debug
75** messages. 74** messages.
76*/ 75*/
77#define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ 76#define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */
78 77
79void reiserfs_warning (struct super_block *s, const char * fmt, ...); 78void reiserfs_warning(struct super_block *s, const char *fmt, ...);
80/* assertions handling */ 79/* assertions handling */
81 80
82/** always check a condition and panic if it's false. */ 81/** always check a condition and panic if it's false. */
@@ -105,82 +104,78 @@ if( !( cond ) ) \
105 * Structure of super block on disk, a version of which in RAM is often accessed as REISERFS_SB(s)->s_rs 104 * Structure of super block on disk, a version of which in RAM is often accessed as REISERFS_SB(s)->s_rs
106 * the version in RAM is part of a larger structure containing fields never written to disk. 105 * the version in RAM is part of a larger structure containing fields never written to disk.
107 */ 106 */
108#define UNSET_HASH 0 // read_super will guess about, what hash names 107#define UNSET_HASH 0 // read_super will guess about, what hash names
109 // in directories were sorted with 108 // in directories were sorted with
110#define TEA_HASH 1 109#define TEA_HASH 1
111#define YURA_HASH 2 110#define YURA_HASH 2
112#define R5_HASH 3 111#define R5_HASH 3
113#define DEFAULT_HASH R5_HASH 112#define DEFAULT_HASH R5_HASH
114 113
115
116struct journal_params { 114struct journal_params {
117 __le32 jp_journal_1st_block; /* where does journal start from on its 115 __le32 jp_journal_1st_block; /* where does journal start from on its
118 * device */ 116 * device */
119 __le32 jp_journal_dev; /* journal device st_rdev */ 117 __le32 jp_journal_dev; /* journal device st_rdev */
120 __le32 jp_journal_size; /* size of the journal */ 118 __le32 jp_journal_size; /* size of the journal */
121 __le32 jp_journal_trans_max; /* max number of blocks in a transaction. */ 119 __le32 jp_journal_trans_max; /* max number of blocks in a transaction. */
122 __le32 jp_journal_magic; /* random value made on fs creation (this 120 __le32 jp_journal_magic; /* random value made on fs creation (this
123 * was sb_journal_block_count) */ 121 * was sb_journal_block_count) */
124 __le32 jp_journal_max_batch; /* max number of blocks to batch into a 122 __le32 jp_journal_max_batch; /* max number of blocks to batch into a
125 * trans */ 123 * trans */
126 __le32 jp_journal_max_commit_age; /* in seconds, how old can an async 124 __le32 jp_journal_max_commit_age; /* in seconds, how old can an async
127 * commit be */ 125 * commit be */
128 __le32 jp_journal_max_trans_age; /* in seconds, how old can a transaction 126 __le32 jp_journal_max_trans_age; /* in seconds, how old can a transaction
129 * be */ 127 * be */
130}; 128};
131 129
132/* this is the super from 3.5.X, where X >= 10 */ 130/* this is the super from 3.5.X, where X >= 10 */
133struct reiserfs_super_block_v1 131struct reiserfs_super_block_v1 {
134{ 132 __le32 s_block_count; /* blocks count */
135 __le32 s_block_count; /* blocks count */ 133 __le32 s_free_blocks; /* free blocks count */
136 __le32 s_free_blocks; /* free blocks count */ 134 __le32 s_root_block; /* root block number */
137 __le32 s_root_block; /* root block number */ 135 struct journal_params s_journal;
138 struct journal_params s_journal; 136 __le16 s_blocksize; /* block size */
139 __le16 s_blocksize; /* block size */ 137 __le16 s_oid_maxsize; /* max size of object id array, see
140 __le16 s_oid_maxsize; /* max size of object id array, see 138 * get_objectid() commentary */
141 * get_objectid() commentary */ 139 __le16 s_oid_cursize; /* current size of object id array */
142 __le16 s_oid_cursize; /* current size of object id array */ 140 __le16 s_umount_state; /* this is set to 1 when filesystem was
143 __le16 s_umount_state; /* this is set to 1 when filesystem was 141 * umounted, to 2 - when not */
144 * umounted, to 2 - when not */ 142 char s_magic[10]; /* reiserfs magic string indicates that
145 char s_magic[10]; /* reiserfs magic string indicates that 143 * file system is reiserfs:
146 * file system is reiserfs: 144 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */
147 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */ 145 __le16 s_fs_state; /* it is set to used by fsck to mark which
148 __le16 s_fs_state; /* it is set to used by fsck to mark which 146 * phase of rebuilding is done */
149 * phase of rebuilding is done */ 147 __le32 s_hash_function_code; /* indicate, what hash function is being use
150 __le32 s_hash_function_code; /* indicate, what hash function is being use 148 * to sort names in a directory*/
151 * to sort names in a directory*/ 149 __le16 s_tree_height; /* height of disk tree */
152 __le16 s_tree_height; /* height of disk tree */ 150 __le16 s_bmap_nr; /* amount of bitmap blocks needed to address
153 __le16 s_bmap_nr; /* amount of bitmap blocks needed to address 151 * each block of file system */
154 * each block of file system */ 152 __le16 s_version; /* this field is only reliable on filesystem
155 __le16 s_version; /* this field is only reliable on filesystem 153 * with non-standard journal */
156 * with non-standard journal */ 154 __le16 s_reserved_for_journal; /* size in blocks of journal area on main
157 __le16 s_reserved_for_journal; /* size in blocks of journal area on main 155 * device, we need to keep after
158 * device, we need to keep after 156 * making fs with non-standard journal */
159 * making fs with non-standard journal */
160} __attribute__ ((__packed__)); 157} __attribute__ ((__packed__));
161 158
162#define SB_SIZE_V1 (sizeof(struct reiserfs_super_block_v1)) 159#define SB_SIZE_V1 (sizeof(struct reiserfs_super_block_v1))
163 160
164/* this is the on disk super block */ 161/* this is the on disk super block */
165struct reiserfs_super_block 162struct reiserfs_super_block {
166{ 163 struct reiserfs_super_block_v1 s_v1;
167 struct reiserfs_super_block_v1 s_v1; 164 __le32 s_inode_generation;
168 __le32 s_inode_generation; 165 __le32 s_flags; /* Right now used only by inode-attributes, if enabled */
169 __le32 s_flags; /* Right now used only by inode-attributes, if enabled */ 166 unsigned char s_uuid[16]; /* filesystem unique identifier */
170 unsigned char s_uuid[16]; /* filesystem unique identifier */ 167 unsigned char s_label[16]; /* filesystem volume label */
171 unsigned char s_label[16]; /* filesystem volume label */ 168 char s_unused[88]; /* zero filled by mkreiserfs and
172 char s_unused[88] ; /* zero filled by mkreiserfs and 169 * reiserfs_convert_objectid_map_v1()
173 * reiserfs_convert_objectid_map_v1() 170 * so any additions must be updated
174 * so any additions must be updated 171 * there as well. */
175 * there as well. */ 172} __attribute__ ((__packed__));
176} __attribute__ ((__packed__));
177 173
178#define SB_SIZE (sizeof(struct reiserfs_super_block)) 174#define SB_SIZE (sizeof(struct reiserfs_super_block))
179 175
180#define REISERFS_VERSION_1 0 176#define REISERFS_VERSION_1 0
181#define REISERFS_VERSION_2 2 177#define REISERFS_VERSION_2 2
182 178
183
184// on-disk super block fields converted to cpu form 179// on-disk super block fields converted to cpu form
185#define SB_DISK_SUPER_BLOCK(s) (REISERFS_SB(s)->s_rs) 180#define SB_DISK_SUPER_BLOCK(s) (REISERFS_SB(s)->s_rs)
186#define SB_V1_DISK_SUPER_BLOCK(s) (&(SB_DISK_SUPER_BLOCK(s)->s_v1)) 181#define SB_V1_DISK_SUPER_BLOCK(s) (&(SB_DISK_SUPER_BLOCK(s)->s_v1))
@@ -210,13 +205,12 @@ struct reiserfs_super_block
210#define PUT_SB_TREE_HEIGHT(s, val) \ 205#define PUT_SB_TREE_HEIGHT(s, val) \
211 do { SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height = cpu_to_le16(val); } while (0) 206 do { SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height = cpu_to_le16(val); } while (0)
212#define PUT_SB_REISERFS_STATE(s, val) \ 207#define PUT_SB_REISERFS_STATE(s, val) \
213 do { SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state = cpu_to_le16(val); } while (0) 208 do { SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state = cpu_to_le16(val); } while (0)
214#define PUT_SB_VERSION(s, val) \ 209#define PUT_SB_VERSION(s, val) \
215 do { SB_V1_DISK_SUPER_BLOCK(s)->s_version = cpu_to_le16(val); } while (0) 210 do { SB_V1_DISK_SUPER_BLOCK(s)->s_version = cpu_to_le16(val); } while (0)
216#define PUT_SB_BMAP_NR(s, val) \ 211#define PUT_SB_BMAP_NR(s, val) \
217 do { SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr = cpu_to_le16 (val); } while (0) 212 do { SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr = cpu_to_le16 (val); } while (0)
218 213
219
220#define SB_ONDISK_JP(s) (&SB_V1_DISK_SUPER_BLOCK(s)->s_journal) 214#define SB_ONDISK_JP(s) (&SB_V1_DISK_SUPER_BLOCK(s)->s_journal)
221#define SB_ONDISK_JOURNAL_SIZE(s) \ 215#define SB_ONDISK_JOURNAL_SIZE(s) \
222 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_size)) 216 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_size))
@@ -231,21 +225,19 @@ struct reiserfs_super_block
231 block >= SB_JOURNAL_1st_RESERVED_BLOCK(s) \ 225 block >= SB_JOURNAL_1st_RESERVED_BLOCK(s) \
232 && block < SB_JOURNAL_1st_RESERVED_BLOCK(s) + \ 226 && block < SB_JOURNAL_1st_RESERVED_BLOCK(s) + \
233 ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \ 227 ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \
234 SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s))) 228 SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s)))
235
236
237 229
238 /* used by gcc */ 230 /* used by gcc */
239#define REISERFS_SUPER_MAGIC 0x52654973 231#define REISERFS_SUPER_MAGIC 0x52654973
240 /* used by file system utilities that 232 /* used by file system utilities that
241 look at the superblock, etc. */ 233 look at the superblock, etc. */
242#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" 234#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
243#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" 235#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
244#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" 236#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
245 237
246int is_reiserfs_3_5 (struct reiserfs_super_block * rs); 238int is_reiserfs_3_5(struct reiserfs_super_block *rs);
247int is_reiserfs_3_6 (struct reiserfs_super_block * rs); 239int is_reiserfs_3_6(struct reiserfs_super_block *rs);
248int is_reiserfs_jr (struct reiserfs_super_block * rs); 240int is_reiserfs_jr(struct reiserfs_super_block *rs);
249 241
250/* ReiserFS leaves the first 64k unused, so that partition labels have 242/* ReiserFS leaves the first 64k unused, so that partition labels have
251 enough space. If someone wants to write a fancy bootloader that 243 enough space. If someone wants to write a fancy bootloader that
@@ -272,8 +264,8 @@ typedef __u32 b_blocknr_t;
272typedef __le32 unp_t; 264typedef __le32 unp_t;
273 265
274struct unfm_nodeinfo { 266struct unfm_nodeinfo {
275 unp_t unfm_nodenum; 267 unp_t unfm_nodenum;
276 unsigned short unfm_freespace; 268 unsigned short unfm_freespace;
277}; 269};
278 270
279/* there are two formats of keys: 3.5 and 3.6 271/* there are two formats of keys: 3.5 and 3.6
@@ -285,7 +277,6 @@ struct unfm_nodeinfo {
285#define STAT_DATA_V1 0 277#define STAT_DATA_V1 0
286#define STAT_DATA_V2 1 278#define STAT_DATA_V2 1
287 279
288
289static inline struct reiserfs_inode_info *REISERFS_I(const struct inode *inode) 280static inline struct reiserfs_inode_info *REISERFS_I(const struct inode *inode)
290{ 281{
291 return container_of(inode, struct reiserfs_inode_info, vfs_inode); 282 return container_of(inode, struct reiserfs_inode_info, vfs_inode);
@@ -343,15 +334,13 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
343 file would fit into one DIRECT item. 334 file would fit into one DIRECT item.
344 Primary intention for this one is to increase performance by decreasing 335 Primary intention for this one is to increase performance by decreasing
345 seeking. 336 seeking.
346*/ 337*/
347#define STORE_TAIL_IN_UNFM_S2(n_file_size,n_tail_size,n_block_size) \ 338#define STORE_TAIL_IN_UNFM_S2(n_file_size,n_tail_size,n_block_size) \
348(\ 339(\
349 (!(n_tail_size)) || \ 340 (!(n_tail_size)) || \
350 (((n_file_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) ) \ 341 (((n_file_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) ) \
351) 342)
352 343
353
354
355/* 344/*
356 * values for s_umount_state field 345 * values for s_umount_state field
357 */ 346 */
@@ -364,9 +353,9 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
364#define TYPE_STAT_DATA 0 353#define TYPE_STAT_DATA 0
365#define TYPE_INDIRECT 1 354#define TYPE_INDIRECT 1
366#define TYPE_DIRECT 2 355#define TYPE_DIRECT 2
367#define TYPE_DIRENTRY 3 356#define TYPE_DIRENTRY 3
368#define TYPE_MAXTYPE 3 357#define TYPE_MAXTYPE 3
369#define TYPE_ANY 15 // FIXME: comment is required 358#define TYPE_ANY 15 // FIXME: comment is required
370 359
371/***************************************************************************/ 360/***************************************************************************/
372/* KEY & ITEM HEAD */ 361/* KEY & ITEM HEAD */
@@ -376,60 +365,62 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
376// directories use this key as well as old files 365// directories use this key as well as old files
377// 366//
378struct offset_v1 { 367struct offset_v1 {
379 __le32 k_offset; 368 __le32 k_offset;
380 __le32 k_uniqueness; 369 __le32 k_uniqueness;
381} __attribute__ ((__packed__)); 370} __attribute__ ((__packed__));
382 371
383struct offset_v2 { 372struct offset_v2 {
384 __le64 v; 373 __le64 v;
385} __attribute__ ((__packed__)); 374} __attribute__ ((__packed__));
386 375
387static inline __u16 offset_v2_k_type( const struct offset_v2 *v2 ) 376static inline __u16 offset_v2_k_type(const struct offset_v2 *v2)
388{ 377{
389 __u8 type = le64_to_cpu(v2->v) >> 60; 378 __u8 type = le64_to_cpu(v2->v) >> 60;
390 return (type <= TYPE_MAXTYPE)?type:TYPE_ANY; 379 return (type <= TYPE_MAXTYPE) ? type : TYPE_ANY;
391} 380}
392 381
393static inline void set_offset_v2_k_type( struct offset_v2 *v2, int type ) 382static inline void set_offset_v2_k_type(struct offset_v2 *v2, int type)
394{ 383{
395 v2->v = (v2->v & cpu_to_le64(~0ULL>>4)) | cpu_to_le64((__u64)type<<60); 384 v2->v =
385 (v2->v & cpu_to_le64(~0ULL >> 4)) | cpu_to_le64((__u64) type << 60);
396} 386}
397 387
398static inline loff_t offset_v2_k_offset( const struct offset_v2 *v2 ) 388static inline loff_t offset_v2_k_offset(const struct offset_v2 *v2)
399{ 389{
400 return le64_to_cpu(v2->v) & (~0ULL>>4); 390 return le64_to_cpu(v2->v) & (~0ULL >> 4);
401} 391}
402 392
403static inline void set_offset_v2_k_offset( struct offset_v2 *v2, loff_t offset ){ 393static inline void set_offset_v2_k_offset(struct offset_v2 *v2, loff_t offset)
404 offset &= (~0ULL>>4); 394{
405 v2->v = (v2->v & cpu_to_le64(15ULL<<60)) | cpu_to_le64(offset); 395 offset &= (~0ULL >> 4);
396 v2->v = (v2->v & cpu_to_le64(15ULL << 60)) | cpu_to_le64(offset);
406} 397}
407 398
408/* Key of an item determines its location in the S+tree, and 399/* Key of an item determines its location in the S+tree, and
409 is composed of 4 components */ 400 is composed of 4 components */
410struct reiserfs_key { 401struct reiserfs_key {
411 __le32 k_dir_id; /* packing locality: by default parent 402 __le32 k_dir_id; /* packing locality: by default parent
412 directory object id */ 403 directory object id */
413 __le32 k_objectid; /* object identifier */ 404 __le32 k_objectid; /* object identifier */
414 union { 405 union {
415 struct offset_v1 k_offset_v1; 406 struct offset_v1 k_offset_v1;
416 struct offset_v2 k_offset_v2; 407 struct offset_v2 k_offset_v2;
417 } __attribute__ ((__packed__)) u; 408 } __attribute__ ((__packed__)) u;
418} __attribute__ ((__packed__)); 409} __attribute__ ((__packed__));
419 410
420struct in_core_key { 411struct in_core_key {
421 __u32 k_dir_id; /* packing locality: by default parent 412 __u32 k_dir_id; /* packing locality: by default parent
422 directory object id */ 413 directory object id */
423 __u32 k_objectid; /* object identifier */ 414 __u32 k_objectid; /* object identifier */
424 __u64 k_offset; 415 __u64 k_offset;
425 __u8 k_type; 416 __u8 k_type;
426}; 417};
427 418
428struct cpu_key { 419struct cpu_key {
429 struct in_core_key on_disk_key; 420 struct in_core_key on_disk_key;
430 int version; 421 int version;
431 int key_length; /* 3 in all cases but direct2indirect and 422 int key_length; /* 3 in all cases but direct2indirect and
432 indirect2direct conversion */ 423 indirect2direct conversion */
433}; 424};
434 425
435/* Our function for comparing keys can compare keys of different 426/* Our function for comparing keys can compare keys of different
@@ -475,8 +466,7 @@ struct cpu_key {
475 indirect items) and specifies the location of the item itself 466 indirect items) and specifies the location of the item itself
476 within the block. */ 467 within the block. */
477 468
478struct item_head 469struct item_head {
479{
480 /* Everything in the tree is found by searching for it based on 470 /* Everything in the tree is found by searching for it based on
481 * its key.*/ 471 * its key.*/
482 struct reiserfs_key ih_key; 472 struct reiserfs_key ih_key;
@@ -492,13 +482,13 @@ struct item_head
492 number of directory entries in the directory item. */ 482 number of directory entries in the directory item. */
493 __le16 ih_entry_count; 483 __le16 ih_entry_count;
494 } __attribute__ ((__packed__)) u; 484 } __attribute__ ((__packed__)) u;
495 __le16 ih_item_len; /* total size of the item body */ 485 __le16 ih_item_len; /* total size of the item body */
496 __le16 ih_item_location; /* an offset to the item body 486 __le16 ih_item_location; /* an offset to the item body
497 * within the block */ 487 * within the block */
498 __le16 ih_version; /* 0 for all old items, 2 for new 488 __le16 ih_version; /* 0 for all old items, 2 for new
499 ones. Highest bit is set by fsck 489 ones. Highest bit is set by fsck
500 temporary, cleaned after all 490 temporary, cleaned after all
501 done */ 491 done */
502} __attribute__ ((__packed__)); 492} __attribute__ ((__packed__));
503/* size of item header */ 493/* size of item header */
504#define IH_SIZE (sizeof(struct item_head)) 494#define IH_SIZE (sizeof(struct item_head))
@@ -515,7 +505,6 @@ struct item_head
515#define put_ih_location(ih, val) do { (ih)->ih_item_location = cpu_to_le16(val); } while (0) 505#define put_ih_location(ih, val) do { (ih)->ih_item_location = cpu_to_le16(val); } while (0)
516#define put_ih_item_len(ih, val) do { (ih)->ih_item_len = cpu_to_le16(val); } while (0) 506#define put_ih_item_len(ih, val) do { (ih)->ih_item_len = cpu_to_le16(val); } while (0)
517 507
518
519#define unreachable_item(ih) (ih_version(ih) & (1 << 15)) 508#define unreachable_item(ih) (ih_version(ih) & (1 << 15))
520 509
521#define get_ih_free_space(ih) (ih_version (ih) == KEY_FORMAT_3_6 ? 0 : ih_free_space (ih)) 510#define get_ih_free_space(ih) (ih_version (ih) == KEY_FORMAT_3_6 ? 0 : ih_free_space (ih))
@@ -537,40 +526,48 @@ struct item_head
537#define V1_INDIRECT_UNIQUENESS 0xfffffffe 526#define V1_INDIRECT_UNIQUENESS 0xfffffffe
538#define V1_DIRECT_UNIQUENESS 0xffffffff 527#define V1_DIRECT_UNIQUENESS 0xffffffff
539#define V1_DIRENTRY_UNIQUENESS 500 528#define V1_DIRENTRY_UNIQUENESS 500
540#define V1_ANY_UNIQUENESS 555 // FIXME: comment is required 529#define V1_ANY_UNIQUENESS 555 // FIXME: comment is required
541 530
542// 531//
543// here are conversion routines 532// here are conversion routines
544// 533//
545static inline int uniqueness2type (__u32 uniqueness) CONSTF; 534static inline int uniqueness2type(__u32 uniqueness) CONSTF;
546static inline int uniqueness2type (__u32 uniqueness) 535static inline int uniqueness2type(__u32 uniqueness)
547{ 536{
548 switch ((int)uniqueness) { 537 switch ((int)uniqueness) {
549 case V1_SD_UNIQUENESS: return TYPE_STAT_DATA; 538 case V1_SD_UNIQUENESS:
550 case V1_INDIRECT_UNIQUENESS: return TYPE_INDIRECT; 539 return TYPE_STAT_DATA;
551 case V1_DIRECT_UNIQUENESS: return TYPE_DIRECT; 540 case V1_INDIRECT_UNIQUENESS:
552 case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY; 541 return TYPE_INDIRECT;
553 default: 542 case V1_DIRECT_UNIQUENESS:
554 reiserfs_warning (NULL, "vs-500: unknown uniqueness %d", 543 return TYPE_DIRECT;
555 uniqueness); 544 case V1_DIRENTRY_UNIQUENESS:
545 return TYPE_DIRENTRY;
546 default:
547 reiserfs_warning(NULL, "vs-500: unknown uniqueness %d",
548 uniqueness);
556 case V1_ANY_UNIQUENESS: 549 case V1_ANY_UNIQUENESS:
557 return TYPE_ANY; 550 return TYPE_ANY;
558 } 551 }
559} 552}
560 553
561static inline __u32 type2uniqueness (int type) CONSTF; 554static inline __u32 type2uniqueness(int type) CONSTF;
562static inline __u32 type2uniqueness (int type) 555static inline __u32 type2uniqueness(int type)
563{ 556{
564 switch (type) { 557 switch (type) {
565 case TYPE_STAT_DATA: return V1_SD_UNIQUENESS; 558 case TYPE_STAT_DATA:
566 case TYPE_INDIRECT: return V1_INDIRECT_UNIQUENESS; 559 return V1_SD_UNIQUENESS;
567 case TYPE_DIRECT: return V1_DIRECT_UNIQUENESS; 560 case TYPE_INDIRECT:
568 case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS; 561 return V1_INDIRECT_UNIQUENESS;
569 default: 562 case TYPE_DIRECT:
570 reiserfs_warning (NULL, "vs-501: unknown type %d", type); 563 return V1_DIRECT_UNIQUENESS;
564 case TYPE_DIRENTRY:
565 return V1_DIRENTRY_UNIQUENESS;
566 default:
567 reiserfs_warning(NULL, "vs-501: unknown type %d", type);
571 case TYPE_ANY: 568 case TYPE_ANY:
572 return V1_ANY_UNIQUENESS; 569 return V1_ANY_UNIQUENESS;
573 } 570 }
574} 571}
575 572
576// 573//
@@ -578,57 +575,56 @@ static inline __u32 type2uniqueness (int type)
578// there is no way to get version of object from key, so, provide 575// there is no way to get version of object from key, so, provide
579// version to these defines 576// version to these defines
580// 577//
581static inline loff_t le_key_k_offset (int version, const struct reiserfs_key * key) 578static inline loff_t le_key_k_offset(int version,
579 const struct reiserfs_key *key)
582{ 580{
583 return (version == KEY_FORMAT_3_5) ? 581 return (version == KEY_FORMAT_3_5) ?
584 le32_to_cpu( key->u.k_offset_v1.k_offset ) : 582 le32_to_cpu(key->u.k_offset_v1.k_offset) :
585 offset_v2_k_offset( &(key->u.k_offset_v2) ); 583 offset_v2_k_offset(&(key->u.k_offset_v2));
586} 584}
587 585
588static inline loff_t le_ih_k_offset (const struct item_head * ih) 586static inline loff_t le_ih_k_offset(const struct item_head *ih)
589{ 587{
590 return le_key_k_offset (ih_version (ih), &(ih->ih_key)); 588 return le_key_k_offset(ih_version(ih), &(ih->ih_key));
591} 589}
592 590
593static inline loff_t le_key_k_type (int version, const struct reiserfs_key * key) 591static inline loff_t le_key_k_type(int version, const struct reiserfs_key *key)
594{ 592{
595 return (version == KEY_FORMAT_3_5) ? 593 return (version == KEY_FORMAT_3_5) ?
596 uniqueness2type( le32_to_cpu( key->u.k_offset_v1.k_uniqueness)) : 594 uniqueness2type(le32_to_cpu(key->u.k_offset_v1.k_uniqueness)) :
597 offset_v2_k_type( &(key->u.k_offset_v2) ); 595 offset_v2_k_type(&(key->u.k_offset_v2));
598} 596}
599 597
600static inline loff_t le_ih_k_type (const struct item_head * ih) 598static inline loff_t le_ih_k_type(const struct item_head *ih)
601{ 599{
602 return le_key_k_type (ih_version (ih), &(ih->ih_key)); 600 return le_key_k_type(ih_version(ih), &(ih->ih_key));
603} 601}
604 602
605 603static inline void set_le_key_k_offset(int version, struct reiserfs_key *key,
606static inline void set_le_key_k_offset (int version, struct reiserfs_key * key, loff_t offset) 604 loff_t offset)
607{ 605{
608 (version == KEY_FORMAT_3_5) ? 606 (version == KEY_FORMAT_3_5) ? (void)(key->u.k_offset_v1.k_offset = cpu_to_le32(offset)) : /* jdm check */
609 (void)(key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */ 607 (void)(set_offset_v2_k_offset(&(key->u.k_offset_v2), offset));
610 (void)(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
611} 608}
612 609
613 610static inline void set_le_ih_k_offset(struct item_head *ih, loff_t offset)
614static inline void set_le_ih_k_offset (struct item_head * ih, loff_t offset)
615{ 611{
616 set_le_key_k_offset (ih_version (ih), &(ih->ih_key), offset); 612 set_le_key_k_offset(ih_version(ih), &(ih->ih_key), offset);
617} 613}
618 614
619 615static inline void set_le_key_k_type(int version, struct reiserfs_key *key,
620static inline void set_le_key_k_type (int version, struct reiserfs_key * key, int type) 616 int type)
621{ 617{
622 (version == KEY_FORMAT_3_5) ? 618 (version == KEY_FORMAT_3_5) ?
623 (void)(key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))): 619 (void)(key->u.k_offset_v1.k_uniqueness =
624 (void)(set_offset_v2_k_type( &(key->u.k_offset_v2), type )); 620 cpu_to_le32(type2uniqueness(type)))
621 : (void)(set_offset_v2_k_type(&(key->u.k_offset_v2), type));
625} 622}
626static inline void set_le_ih_k_type (struct item_head * ih, int type) 623static inline void set_le_ih_k_type(struct item_head *ih, int type)
627{ 624{
628 set_le_key_k_type (ih_version (ih), &(ih->ih_key), type); 625 set_le_key_k_type(ih_version(ih), &(ih->ih_key), type);
629} 626}
630 627
631
632#define is_direntry_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRENTRY) 628#define is_direntry_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRENTRY)
633#define is_direct_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRECT) 629#define is_direct_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRECT)
634#define is_indirect_le_key(version,key) (le_key_k_type (version, key) == TYPE_INDIRECT) 630#define is_indirect_le_key(version,key) (le_key_k_type (version, key) == TYPE_INDIRECT)
@@ -642,34 +638,32 @@ static inline void set_le_ih_k_type (struct item_head * ih, int type)
642#define is_indirect_le_ih(ih) is_indirect_le_key (ih_version(ih), &((ih)->ih_key)) 638#define is_indirect_le_ih(ih) is_indirect_le_key (ih_version(ih), &((ih)->ih_key))
643#define is_statdata_le_ih(ih) is_statdata_le_key (ih_version (ih), &((ih)->ih_key)) 639#define is_statdata_le_ih(ih) is_statdata_le_key (ih_version (ih), &((ih)->ih_key))
644 640
645
646
647// 641//
648// key is pointer to cpu key, result is cpu 642// key is pointer to cpu key, result is cpu
649// 643//
650static inline loff_t cpu_key_k_offset (const struct cpu_key * key) 644static inline loff_t cpu_key_k_offset(const struct cpu_key *key)
651{ 645{
652 return key->on_disk_key.k_offset; 646 return key->on_disk_key.k_offset;
653} 647}
654 648
655static inline loff_t cpu_key_k_type (const struct cpu_key * key) 649static inline loff_t cpu_key_k_type(const struct cpu_key *key)
656{ 650{
657 return key->on_disk_key.k_type; 651 return key->on_disk_key.k_type;
658} 652}
659 653
660static inline void set_cpu_key_k_offset (struct cpu_key * key, loff_t offset) 654static inline void set_cpu_key_k_offset(struct cpu_key *key, loff_t offset)
661{ 655{
662 key->on_disk_key.k_offset = offset; 656 key->on_disk_key.k_offset = offset;
663} 657}
664 658
665static inline void set_cpu_key_k_type (struct cpu_key * key, int type) 659static inline void set_cpu_key_k_type(struct cpu_key *key, int type)
666{ 660{
667 key->on_disk_key.k_type = type; 661 key->on_disk_key.k_type = type;
668} 662}
669 663
670static inline void cpu_key_k_offset_dec (struct cpu_key * key) 664static inline void cpu_key_k_offset_dec(struct cpu_key *key)
671{ 665{
672 key->on_disk_key.k_offset --; 666 key->on_disk_key.k_offset--;
673} 667}
674 668
675#define is_direntry_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRENTRY) 669#define is_direntry_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRENTRY)
@@ -677,34 +671,25 @@ static inline void cpu_key_k_offset_dec (struct cpu_key * key)
677#define is_indirect_cpu_key(key) (cpu_key_k_type (key) == TYPE_INDIRECT) 671#define is_indirect_cpu_key(key) (cpu_key_k_type (key) == TYPE_INDIRECT)
678#define is_statdata_cpu_key(key) (cpu_key_k_type (key) == TYPE_STAT_DATA) 672#define is_statdata_cpu_key(key) (cpu_key_k_type (key) == TYPE_STAT_DATA)
679 673
680
681/* are these used ? */ 674/* are these used ? */
682#define is_direntry_cpu_ih(ih) (is_direntry_cpu_key (&((ih)->ih_key))) 675#define is_direntry_cpu_ih(ih) (is_direntry_cpu_key (&((ih)->ih_key)))
683#define is_direct_cpu_ih(ih) (is_direct_cpu_key (&((ih)->ih_key))) 676#define is_direct_cpu_ih(ih) (is_direct_cpu_key (&((ih)->ih_key)))
684#define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key))) 677#define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key)))
685#define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key))) 678#define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key)))
686 679
687
688
689
690
691#define I_K_KEY_IN_ITEM(p_s_ih, p_s_key, n_blocksize) \ 680#define I_K_KEY_IN_ITEM(p_s_ih, p_s_key, n_blocksize) \
692 ( ! COMP_SHORT_KEYS(p_s_ih, p_s_key) && \ 681 ( ! COMP_SHORT_KEYS(p_s_ih, p_s_key) && \
693 I_OFF_BYTE_IN_ITEM(p_s_ih, k_offset (p_s_key), n_blocksize) ) 682 I_OFF_BYTE_IN_ITEM(p_s_ih, k_offset (p_s_key), n_blocksize) )
694 683
695/* maximal length of item */ 684/* maximal length of item */
696#define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE) 685#define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE)
697#define MIN_ITEM_LEN 1 686#define MIN_ITEM_LEN 1
698 687
699
700/* object identifier for root dir */ 688/* object identifier for root dir */
701#define REISERFS_ROOT_OBJECTID 2 689#define REISERFS_ROOT_OBJECTID 2
702#define REISERFS_ROOT_PARENT_OBJECTID 1 690#define REISERFS_ROOT_PARENT_OBJECTID 1
703extern struct reiserfs_key root_key; 691extern struct reiserfs_key root_key;
704 692
705
706
707
708/* 693/*
709 * Picture represents a leaf of the S+tree 694 * Picture represents a leaf of the S+tree
710 * ______________________________________________________ 695 * ______________________________________________________
@@ -716,13 +701,13 @@ extern struct reiserfs_key root_key;
716 701
717/* Header of a disk block. More precisely, header of a formatted leaf 702/* Header of a disk block. More precisely, header of a formatted leaf
718 or internal node, and not the header of an unformatted node. */ 703 or internal node, and not the header of an unformatted node. */
719struct block_head { 704struct block_head {
720 __le16 blk_level; /* Level of a block in the tree. */ 705 __le16 blk_level; /* Level of a block in the tree. */
721 __le16 blk_nr_item; /* Number of keys/items in a block. */ 706 __le16 blk_nr_item; /* Number of keys/items in a block. */
722 __le16 blk_free_space; /* Block free space in bytes. */ 707 __le16 blk_free_space; /* Block free space in bytes. */
723 __le16 blk_reserved; 708 __le16 blk_reserved;
724 /* dump this in v4/planA */ 709 /* dump this in v4/planA */
725 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */ 710 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */
726}; 711};
727 712
728#define BLKH_SIZE (sizeof(struct block_head)) 713#define BLKH_SIZE (sizeof(struct block_head))
@@ -741,12 +726,12 @@ struct block_head {
741 * values for blk_level field of the struct block_head 726 * values for blk_level field of the struct block_head
742 */ 727 */
743 728
744#define FREE_LEVEL 0 /* when node gets removed from the tree its 729#define FREE_LEVEL 0 /* when node gets removed from the tree its
745 blk_level is set to FREE_LEVEL. It is then 730 blk_level is set to FREE_LEVEL. It is then
746 used to see whether the node is still in the 731 used to see whether the node is still in the
747 tree */ 732 tree */
748 733
749#define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level.*/ 734#define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */
750 735
751/* Given the buffer head of a formatted node, resolve to the block head of that node. */ 736/* Given the buffer head of a formatted node, resolve to the block head of that node. */
752#define B_BLK_HEAD(p_s_bh) ((struct block_head *)((p_s_bh)->b_data)) 737#define B_BLK_HEAD(p_s_bh) ((struct block_head *)((p_s_bh)->b_data))
@@ -759,7 +744,6 @@ struct block_head {
759#define PUT_B_LEVEL(p_s_bh,val) do { set_blkh_level(B_BLK_HEAD(p_s_bh),val); } while (0) 744#define PUT_B_LEVEL(p_s_bh,val) do { set_blkh_level(B_BLK_HEAD(p_s_bh),val); } while (0)
760#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0) 745#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0)
761 746
762
763/* Get right delimiting key. -- little endian */ 747/* Get right delimiting key. -- little endian */
764#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh)) 748#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh))
765 749
@@ -770,41 +754,36 @@ struct block_head {
770#define B_IS_KEYS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) > DISK_LEAF_NODE_LEVEL \ 754#define B_IS_KEYS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) > DISK_LEAF_NODE_LEVEL \
771 && B_LEVEL(p_s_bh) <= MAX_HEIGHT) 755 && B_LEVEL(p_s_bh) <= MAX_HEIGHT)
772 756
773
774
775
776/***************************************************************************/ 757/***************************************************************************/
777/* STAT DATA */ 758/* STAT DATA */
778/***************************************************************************/ 759/***************************************************************************/
779 760
780
781// 761//
782// old stat data is 32 bytes long. We are going to distinguish new one by 762// old stat data is 32 bytes long. We are going to distinguish new one by
783// different size 763// different size
784// 764//
785struct stat_data_v1 765struct stat_data_v1 {
786{ 766 __le16 sd_mode; /* file type, permissions */
787 __le16 sd_mode; /* file type, permissions */ 767 __le16 sd_nlink; /* number of hard links */
788 __le16 sd_nlink; /* number of hard links */ 768 __le16 sd_uid; /* owner */
789 __le16 sd_uid; /* owner */ 769 __le16 sd_gid; /* group */
790 __le16 sd_gid; /* group */ 770 __le32 sd_size; /* file size */
791 __le32 sd_size; /* file size */ 771 __le32 sd_atime; /* time of last access */
792 __le32 sd_atime; /* time of last access */ 772 __le32 sd_mtime; /* time file was last modified */
793 __le32 sd_mtime; /* time file was last modified */ 773 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
794 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 774 union {
795 union { 775 __le32 sd_rdev;
796 __le32 sd_rdev; 776 __le32 sd_blocks; /* number of blocks file uses */
797 __le32 sd_blocks; /* number of blocks file uses */ 777 } __attribute__ ((__packed__)) u;
798 } __attribute__ ((__packed__)) u; 778 __le32 sd_first_direct_byte; /* first byte of file which is stored
799 __le32 sd_first_direct_byte; /* first byte of file which is stored 779 in a direct item: except that if it
800 in a direct item: except that if it 780 equals 1 it is a symlink and if it
801 equals 1 it is a symlink and if it 781 equals ~(__u32)0 there is no
802 equals ~(__u32)0 there is no 782 direct item. The existence of this
803 direct item. The existence of this 783 field really grates on me. Let's
804 field really grates on me. Let's 784 replace it with a macro based on
805 replace it with a macro based on 785 sd_size and our tail suppression
806 sd_size and our tail suppression 786 policy. Someday. -Hans */
807 policy. Someday. -Hans */
808} __attribute__ ((__packed__)); 787} __attribute__ ((__packed__));
809 788
810#define SD_V1_SIZE (sizeof(struct stat_data_v1)) 789#define SD_V1_SIZE (sizeof(struct stat_data_v1))
@@ -862,29 +841,29 @@ struct stat_data_v1
862/* Stat Data on disk (reiserfs version of UFS disk inode minus the 841/* Stat Data on disk (reiserfs version of UFS disk inode minus the
863 address blocks) */ 842 address blocks) */
864struct stat_data { 843struct stat_data {
865 __le16 sd_mode; /* file type, permissions */ 844 __le16 sd_mode; /* file type, permissions */
866 __le16 sd_attrs; /* persistent inode flags */ 845 __le16 sd_attrs; /* persistent inode flags */
867 __le32 sd_nlink; /* number of hard links */ 846 __le32 sd_nlink; /* number of hard links */
868 __le64 sd_size; /* file size */ 847 __le64 sd_size; /* file size */
869 __le32 sd_uid; /* owner */ 848 __le32 sd_uid; /* owner */
870 __le32 sd_gid; /* group */ 849 __le32 sd_gid; /* group */
871 __le32 sd_atime; /* time of last access */ 850 __le32 sd_atime; /* time of last access */
872 __le32 sd_mtime; /* time file was last modified */ 851 __le32 sd_mtime; /* time file was last modified */
873 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 852 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
874 __le32 sd_blocks; 853 __le32 sd_blocks;
875 union { 854 union {
876 __le32 sd_rdev; 855 __le32 sd_rdev;
877 __le32 sd_generation; 856 __le32 sd_generation;
878 //__le32 sd_first_direct_byte; 857 //__le32 sd_first_direct_byte;
879 /* first byte of file which is stored in a 858 /* first byte of file which is stored in a
880 direct item: except that if it equals 1 859 direct item: except that if it equals 1
881 it is a symlink and if it equals 860 it is a symlink and if it equals
882 ~(__u32)0 there is no direct item. The 861 ~(__u32)0 there is no direct item. The
883 existence of this field really grates 862 existence of this field really grates
884 on me. Let's replace it with a macro 863 on me. Let's replace it with a macro
885 based on sd_size and our tail 864 based on sd_size and our tail
886 suppression policy? */ 865 suppression policy? */
887 } __attribute__ ((__packed__)) u; 866 } __attribute__ ((__packed__)) u;
888} __attribute__ ((__packed__)); 867} __attribute__ ((__packed__));
889// 868//
890// this is 44 bytes long 869// this is 44 bytes long
@@ -919,7 +898,6 @@ struct stat_data {
919#define sd_v2_attrs(sdp) (le16_to_cpu((sdp)->sd_attrs)) 898#define sd_v2_attrs(sdp) (le16_to_cpu((sdp)->sd_attrs))
920#define set_sd_v2_attrs(sdp,v) ((sdp)->sd_attrs = cpu_to_le16(v)) 899#define set_sd_v2_attrs(sdp,v) ((sdp)->sd_attrs = cpu_to_le16(v))
921 900
922
923/***************************************************************************/ 901/***************************************************************************/
924/* DIRECTORY STRUCTURE */ 902/* DIRECTORY STRUCTURE */
925/***************************************************************************/ 903/***************************************************************************/
@@ -954,17 +932,14 @@ struct stat_data {
954/* NOT IMPLEMENTED: 932/* NOT IMPLEMENTED:
955 Directory will someday contain stat data of object */ 933 Directory will someday contain stat data of object */
956 934
957 935struct reiserfs_de_head {
958 936 __le32 deh_offset; /* third component of the directory entry key */
959struct reiserfs_de_head 937 __le32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced
960{ 938 by directory entry */
961 __le32 deh_offset; /* third component of the directory entry key */ 939 __le32 deh_objectid; /* objectid of the object, that is referenced by directory entry */
962 __le32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced 940 __le16 deh_location; /* offset of name in the whole item */
963 by directory entry */ 941 __le16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether
964 __le32 deh_objectid; /* objectid of the object, that is referenced by directory entry */ 942 entry is hidden (unlinked) */
965 __le16 deh_location; /* offset of name in the whole item */
966 __le16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether
967 entry is hidden (unlinked) */
968} __attribute__ ((__packed__)); 943} __attribute__ ((__packed__));
969#define DEH_SIZE sizeof(struct reiserfs_de_head) 944#define DEH_SIZE sizeof(struct reiserfs_de_head)
970#define deh_offset(p_deh) (le32_to_cpu((p_deh)->deh_offset)) 945#define deh_offset(p_deh) (le32_to_cpu((p_deh)->deh_offset))
@@ -986,7 +961,7 @@ struct reiserfs_de_head
986/* old format directories have this size when empty */ 961/* old format directories have this size when empty */
987#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3) 962#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)
988 963
989#define DEH_Statdata 0 /* not used now */ 964#define DEH_Statdata 0 /* not used now */
990#define DEH_Visible 2 965#define DEH_Visible 2
991 966
992/* 64 bit systems (and the S/390) need to be aligned explicitly -jdm */ 967/* 64 bit systems (and the S/390) need to be aligned explicitly -jdm */
@@ -1023,10 +998,10 @@ struct reiserfs_de_head
1023#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 998#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1024#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 999#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1025 1000
1026extern void make_empty_dir_item_v1 (char * body, __le32 dirid, __le32 objid, 1001extern void make_empty_dir_item_v1(char *body, __le32 dirid, __le32 objid,
1027 __le32 par_dirid, __le32 par_objid); 1002 __le32 par_dirid, __le32 par_objid);
1028extern void make_empty_dir_item (char * body, __le32 dirid, __le32 objid, 1003extern void make_empty_dir_item(char *body, __le32 dirid, __le32 objid,
1029 __le32 par_dirid, __le32 par_objid); 1004 __le32 par_dirid, __le32 par_objid);
1030 1005
1031/* array of the entry headers */ 1006/* array of the entry headers */
1032 /* get item body */ 1007 /* get item body */
@@ -1043,53 +1018,48 @@ extern void make_empty_dir_item (char * body, __le32 dirid, __le32 objid,
1043#define I_DEH_N_ENTRY_LENGTH(ih,deh,i) \ 1018#define I_DEH_N_ENTRY_LENGTH(ih,deh,i) \
1044((i) ? (deh_location((deh)-1) - deh_location((deh))) : (ih_item_len((ih)) - deh_location((deh)))) 1019((i) ? (deh_location((deh)-1) - deh_location((deh))) : (ih_item_len((ih)) - deh_location((deh))))
1045*/ 1020*/
1046static inline int entry_length (const struct buffer_head * bh, 1021static inline int entry_length(const struct buffer_head *bh,
1047 const struct item_head * ih, int pos_in_item) 1022 const struct item_head *ih, int pos_in_item)
1048{ 1023{
1049 struct reiserfs_de_head * deh; 1024 struct reiserfs_de_head *deh;
1050 1025
1051 deh = B_I_DEH (bh, ih) + pos_in_item; 1026 deh = B_I_DEH(bh, ih) + pos_in_item;
1052 if (pos_in_item) 1027 if (pos_in_item)
1053 return deh_location(deh-1) - deh_location(deh); 1028 return deh_location(deh - 1) - deh_location(deh);
1054 1029
1055 return ih_item_len(ih) - deh_location(deh); 1030 return ih_item_len(ih) - deh_location(deh);
1056} 1031}
1057 1032
1058
1059
1060/* number of entries in the directory item, depends on ENTRY_COUNT being at the start of directory dynamic data. */ 1033/* number of entries in the directory item, depends on ENTRY_COUNT being at the start of directory dynamic data. */
1061#define I_ENTRY_COUNT(ih) (ih_entry_count((ih))) 1034#define I_ENTRY_COUNT(ih) (ih_entry_count((ih)))
1062 1035
1063
1064/* name by bh, ih and entry_num */ 1036/* name by bh, ih and entry_num */
1065#define B_I_E_NAME(bh,ih,entry_num) ((char *)(bh->b_data + ih_location(ih) + deh_location(B_I_DEH(bh,ih)+(entry_num)))) 1037#define B_I_E_NAME(bh,ih,entry_num) ((char *)(bh->b_data + ih_location(ih) + deh_location(B_I_DEH(bh,ih)+(entry_num))))
1066 1038
1067// two entries per block (at least) 1039// two entries per block (at least)
1068#define REISERFS_MAX_NAME(block_size) 255 1040#define REISERFS_MAX_NAME(block_size) 255
1069 1041
1070
1071/* this structure is used for operations on directory entries. It is 1042/* this structure is used for operations on directory entries. It is
1072 not a disk structure. */ 1043 not a disk structure. */
1073/* When reiserfs_find_entry or search_by_entry_key find directory 1044/* When reiserfs_find_entry or search_by_entry_key find directory
1074 entry, they return filled reiserfs_dir_entry structure */ 1045 entry, they return filled reiserfs_dir_entry structure */
1075struct reiserfs_dir_entry 1046struct reiserfs_dir_entry {
1076{ 1047 struct buffer_head *de_bh;
1077 struct buffer_head * de_bh; 1048 int de_item_num;
1078 int de_item_num; 1049 struct item_head *de_ih;
1079 struct item_head * de_ih; 1050 int de_entry_num;
1080 int de_entry_num; 1051 struct reiserfs_de_head *de_deh;
1081 struct reiserfs_de_head * de_deh; 1052 int de_entrylen;
1082 int de_entrylen; 1053 int de_namelen;
1083 int de_namelen; 1054 char *de_name;
1084 char * de_name; 1055 char *de_gen_number_bit_string;
1085 char * de_gen_number_bit_string; 1056
1086 1057 __u32 de_dir_id;
1087 __u32 de_dir_id; 1058 __u32 de_objectid;
1088 __u32 de_objectid; 1059
1089 1060 struct cpu_key de_entry_key;
1090 struct cpu_key de_entry_key;
1091}; 1061};
1092 1062
1093/* these defines are useful when a particular member of a reiserfs_dir_entry is needed */ 1063/* these defines are useful when a particular member of a reiserfs_dir_entry is needed */
1094 1064
1095/* pointer to file name, stored in entry */ 1065/* pointer to file name, stored in entry */
@@ -1099,8 +1069,6 @@ struct reiserfs_dir_entry
1099#define I_DEH_N_ENTRY_FILE_NAME_LENGTH(ih,deh,entry_num) \ 1069#define I_DEH_N_ENTRY_FILE_NAME_LENGTH(ih,deh,entry_num) \
1100(I_DEH_N_ENTRY_LENGTH (ih, deh, entry_num) - (de_with_sd (deh) ? SD_SIZE : 0)) 1070(I_DEH_N_ENTRY_LENGTH (ih, deh, entry_num) - (de_with_sd (deh) ? SD_SIZE : 0))
1101 1071
1102
1103
1104/* hash value occupies bits from 7 up to 30 */ 1072/* hash value occupies bits from 7 up to 30 */
1105#define GET_HASH_VALUE(offset) ((offset) & 0x7fffff80LL) 1073#define GET_HASH_VALUE(offset) ((offset) & 0x7fffff80LL)
1106/* generation number occupies 7 bits starting from 0 up to 6 */ 1074/* generation number occupies 7 bits starting from 0 up to 6 */
@@ -1109,7 +1077,6 @@ struct reiserfs_dir_entry
1109 1077
1110#define SET_GENERATION_NUMBER(offset,gen_number) (GET_HASH_VALUE(offset)|(gen_number)) 1078#define SET_GENERATION_NUMBER(offset,gen_number) (GET_HASH_VALUE(offset)|(gen_number))
1111 1079
1112
1113/* 1080/*
1114 * Picture represents an internal node of the reiserfs tree 1081 * Picture represents an internal node of the reiserfs tree
1115 * ______________________________________________________ 1082 * ______________________________________________________
@@ -1125,9 +1092,9 @@ struct reiserfs_dir_entry
1125/* Disk child pointer: The pointer from an internal node of the tree 1092/* Disk child pointer: The pointer from an internal node of the tree
1126 to a node that is on disk. */ 1093 to a node that is on disk. */
1127struct disk_child { 1094struct disk_child {
1128 __le32 dc_block_number; /* Disk child's block number. */ 1095 __le32 dc_block_number; /* Disk child's block number. */
1129 __le16 dc_size; /* Disk child's used space. */ 1096 __le16 dc_size; /* Disk child's used space. */
1130 __le16 dc_reserved; 1097 __le16 dc_reserved;
1131}; 1098};
1132 1099
1133#define DC_SIZE (sizeof(struct disk_child)) 1100#define DC_SIZE (sizeof(struct disk_child))
@@ -1144,7 +1111,7 @@ struct disk_child {
1144#define B_N_CHILD_NUM(p_s_bh,n_pos) (dc_block_number(B_N_CHILD(p_s_bh,n_pos))) 1111#define B_N_CHILD_NUM(p_s_bh,n_pos) (dc_block_number(B_N_CHILD(p_s_bh,n_pos)))
1145#define PUT_B_N_CHILD_NUM(p_s_bh,n_pos, val) (put_dc_block_number(B_N_CHILD(p_s_bh,n_pos), val )) 1112#define PUT_B_N_CHILD_NUM(p_s_bh,n_pos, val) (put_dc_block_number(B_N_CHILD(p_s_bh,n_pos), val ))
1146 1113
1147 /* maximal value of field child_size in structure disk_child */ 1114 /* maximal value of field child_size in structure disk_child */
1148 /* child size is the combined size of all items and their headers */ 1115 /* child size is the combined size of all items and their headers */
1149#define MAX_CHILD_SIZE(bh) ((int)( (bh)->b_size - BLKH_SIZE )) 1116#define MAX_CHILD_SIZE(bh) ((int)( (bh)->b_size - BLKH_SIZE ))
1150 1117
@@ -1159,7 +1126,6 @@ struct disk_child {
1159/* PATH STRUCTURES AND DEFINES */ 1126/* PATH STRUCTURES AND DEFINES */
1160/***************************************************************************/ 1127/***************************************************************************/
1161 1128
1162
1163/* Search_by_key fills up the path from the root to the leaf as it descends the tree looking for the 1129/* Search_by_key fills up the path from the root to the leaf as it descends the tree looking for the
1164 key. It uses reiserfs_bread to try to find buffers in the cache given their block number. If it 1130 key. It uses reiserfs_bread to try to find buffers in the cache given their block number. If it
1165 does not find them in the cache it reads them from disk. For each node search_by_key finds using 1131 does not find them in the cache it reads them from disk. For each node search_by_key finds using
@@ -1168,20 +1134,18 @@ struct disk_child {
1168 is looking through a leaf node bin_search will find the position of the item which has key either 1134 is looking through a leaf node bin_search will find the position of the item which has key either
1169 equal to given key, or which is the maximal key less than the given key. */ 1135 equal to given key, or which is the maximal key less than the given key. */
1170 1136
1171struct path_element { 1137struct path_element {
1172 struct buffer_head * pe_buffer; /* Pointer to the buffer at the path in the tree. */ 1138 struct buffer_head *pe_buffer; /* Pointer to the buffer at the path in the tree. */
1173 int pe_position; /* Position in the tree node which is placed in the */ 1139 int pe_position; /* Position in the tree node which is placed in the */
1174 /* buffer above. */ 1140 /* buffer above. */
1175}; 1141};
1176 1142
1177#define MAX_HEIGHT 5 /* maximal height of a tree. don't change this without changing JOURNAL_PER_BALANCE_CNT */ 1143#define MAX_HEIGHT 5 /* maximal height of a tree. don't change this without changing JOURNAL_PER_BALANCE_CNT */
1178#define EXTENDED_MAX_HEIGHT 7 /* Must be equals MAX_HEIGHT + FIRST_PATH_ELEMENT_OFFSET */ 1144#define EXTENDED_MAX_HEIGHT 7 /* Must be equals MAX_HEIGHT + FIRST_PATH_ELEMENT_OFFSET */
1179#define FIRST_PATH_ELEMENT_OFFSET 2 /* Must be equal to at least 2. */ 1145#define FIRST_PATH_ELEMENT_OFFSET 2 /* Must be equal to at least 2. */
1180
1181#define ILLEGAL_PATH_ELEMENT_OFFSET 1 /* Must be equal to FIRST_PATH_ELEMENT_OFFSET - 1 */
1182#define MAX_FEB_SIZE 6 /* this MUST be MAX_HEIGHT + 1. See about FEB below */
1183
1184 1146
1147#define ILLEGAL_PATH_ELEMENT_OFFSET 1 /* Must be equal to FIRST_PATH_ELEMENT_OFFSET - 1 */
1148#define MAX_FEB_SIZE 6 /* this MUST be MAX_HEIGHT + 1. See about FEB below */
1185 1149
1186/* We need to keep track of who the ancestors of nodes are. When we 1150/* We need to keep track of who the ancestors of nodes are. When we
1187 perform a search we record which nodes were visited while 1151 perform a search we record which nodes were visited while
@@ -1200,14 +1164,14 @@ excessive effort to avoid disturbing the precious VFS code.:-( The
1200gods only know how we are going to SMP the code that uses them. 1164gods only know how we are going to SMP the code that uses them.
1201znodes are the way! */ 1165znodes are the way! */
1202 1166
1203#define PATH_READA 0x1 /* do read ahead */ 1167#define PATH_READA 0x1 /* do read ahead */
1204#define PATH_READA_BACK 0x2 /* read backwards */ 1168#define PATH_READA_BACK 0x2 /* read backwards */
1205 1169
1206struct path { 1170struct path {
1207 int path_length; /* Length of the array above. */ 1171 int path_length; /* Length of the array above. */
1208 int reada; 1172 int reada;
1209 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ 1173 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */
1210 int pos_in_item; 1174 int pos_in_item;
1211}; 1175};
1212 1176
1213#define pos_in_item(path) ((path)->pos_in_item) 1177#define pos_in_item(path) ((path)->pos_in_item)
@@ -1224,25 +1188,23 @@ struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1224/* Get position in the element at the path by path and path position. */ 1188/* Get position in the element at the path by path and path position. */
1225#define PATH_OFFSET_POSITION(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_position) 1189#define PATH_OFFSET_POSITION(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_position)
1226 1190
1227
1228#define PATH_PLAST_BUFFER(p_s_path) (PATH_OFFSET_PBUFFER((p_s_path), (p_s_path)->path_length)) 1191#define PATH_PLAST_BUFFER(p_s_path) (PATH_OFFSET_PBUFFER((p_s_path), (p_s_path)->path_length))
1229 /* you know, to the person who didn't 1192 /* you know, to the person who didn't
1230 write this the macro name does not 1193 write this the macro name does not
1231 at first suggest what it does. 1194 at first suggest what it does.
1232 Maybe POSITION_FROM_PATH_END? Or 1195 Maybe POSITION_FROM_PATH_END? Or
1233 maybe we should just focus on 1196 maybe we should just focus on
1234 dumping paths... -Hans */ 1197 dumping paths... -Hans */
1235#define PATH_LAST_POSITION(p_s_path) (PATH_OFFSET_POSITION((p_s_path), (p_s_path)->path_length)) 1198#define PATH_LAST_POSITION(p_s_path) (PATH_OFFSET_POSITION((p_s_path), (p_s_path)->path_length))
1236 1199
1237
1238#define PATH_PITEM_HEAD(p_s_path) B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_path),PATH_LAST_POSITION(p_s_path)) 1200#define PATH_PITEM_HEAD(p_s_path) B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_path),PATH_LAST_POSITION(p_s_path))
1239 1201
1240/* in do_balance leaf has h == 0 in contrast with path structure, 1202/* in do_balance leaf has h == 0 in contrast with path structure,
1241 where root has level == 0. That is why we need these defines */ 1203 where root has level == 0. That is why we need these defines */
1242#define PATH_H_PBUFFER(p_s_path, h) PATH_OFFSET_PBUFFER (p_s_path, p_s_path->path_length - (h)) /* tb->S[h] */ 1204#define PATH_H_PBUFFER(p_s_path, h) PATH_OFFSET_PBUFFER (p_s_path, p_s_path->path_length - (h)) /* tb->S[h] */
1243#define PATH_H_PPARENT(path, h) PATH_H_PBUFFER (path, (h) + 1) /* tb->F[h] or tb->S[0]->b_parent */ 1205#define PATH_H_PPARENT(path, h) PATH_H_PBUFFER (path, (h) + 1) /* tb->F[h] or tb->S[0]->b_parent */
1244#define PATH_H_POSITION(path, h) PATH_OFFSET_POSITION (path, path->path_length - (h)) 1206#define PATH_H_POSITION(path, h) PATH_OFFSET_POSITION (path, path->path_length - (h))
1245#define PATH_H_B_ITEM_ORDER(path, h) PATH_H_POSITION(path, h + 1) /* tb->S[h]->b_item_order */ 1207#define PATH_H_B_ITEM_ORDER(path, h) PATH_H_POSITION(path, h + 1) /* tb->S[h]->b_item_order */
1246 1208
1247#define PATH_H_PATH_OFFSET(p_s_path, n_h) ((p_s_path)->path_length - (n_h)) 1209#define PATH_H_PATH_OFFSET(p_s_path, n_h) ((p_s_path)->path_length - (n_h))
1248 1210
@@ -1253,7 +1215,6 @@ struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1253#define item_moved(ih,path) comp_items(ih, path) 1215#define item_moved(ih,path) comp_items(ih, path)
1254#define path_changed(ih,path) comp_items (ih, path) 1216#define path_changed(ih,path) comp_items (ih, path)
1255 1217
1256
1257/***************************************************************************/ 1218/***************************************************************************/
1258/* MISC */ 1219/* MISC */
1259/***************************************************************************/ 1220/***************************************************************************/
@@ -1272,30 +1233,26 @@ struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1272// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset 1233// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
1273#define U32_MAX (~(__u32)0) 1234#define U32_MAX (~(__u32)0)
1274 1235
1275static inline loff_t max_reiserfs_offset (struct inode * inode) 1236static inline loff_t max_reiserfs_offset(struct inode *inode)
1276{ 1237{
1277 if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5) 1238 if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5)
1278 return (loff_t)U32_MAX; 1239 return (loff_t) U32_MAX;
1279 1240
1280 return (loff_t)((~(__u64)0) >> 4); 1241 return (loff_t) ((~(__u64) 0) >> 4);
1281} 1242}
1282 1243
1283
1284/*#define MAX_KEY_UNIQUENESS MAX_UL_INT*/ 1244/*#define MAX_KEY_UNIQUENESS MAX_UL_INT*/
1285#define MAX_KEY_OBJECTID MAX_UL_INT 1245#define MAX_KEY_OBJECTID MAX_UL_INT
1286 1246
1287
1288#define MAX_B_NUM MAX_UL_INT 1247#define MAX_B_NUM MAX_UL_INT
1289#define MAX_FC_NUM MAX_US_INT 1248#define MAX_FC_NUM MAX_US_INT
1290 1249
1291
1292/* the purpose is to detect overflow of an unsigned short */ 1250/* the purpose is to detect overflow of an unsigned short */
1293#define REISERFS_LINK_MAX (MAX_US_INT - 1000) 1251#define REISERFS_LINK_MAX (MAX_US_INT - 1000)
1294 1252
1295
1296/* The following defines are used in reiserfs_insert_item and reiserfs_append_item */ 1253/* The following defines are used in reiserfs_insert_item and reiserfs_append_item */
1297#define REISERFS_KERNEL_MEM 0 /* reiserfs kernel memory mode */ 1254#define REISERFS_KERNEL_MEM 0 /* reiserfs kernel memory mode */
1298#define REISERFS_USER_MEM 1 /* reiserfs user memory mode */ 1255#define REISERFS_USER_MEM 1 /* reiserfs user memory mode */
1299 1256
1300#define fs_generation(s) (REISERFS_SB(s)->s_generation_counter) 1257#define fs_generation(s) (REISERFS_SB(s)->s_generation_counter)
1301#define get_generation(s) atomic_read (&fs_generation(s)) 1258#define get_generation(s) atomic_read (&fs_generation(s))
@@ -1303,7 +1260,6 @@ static inline loff_t max_reiserfs_offset (struct inode * inode)
1303#define __fs_changed(gen,s) (gen != get_generation (s)) 1260#define __fs_changed(gen,s) (gen != get_generation (s))
1304#define fs_changed(gen,s) ({cond_resched(); __fs_changed(gen, s);}) 1261#define fs_changed(gen,s) ({cond_resched(); __fs_changed(gen, s);})
1305 1262
1306
1307/***************************************************************************/ 1263/***************************************************************************/
1308/* FIXATE NODES */ 1264/* FIXATE NODES */
1309/***************************************************************************/ 1265/***************************************************************************/
@@ -1324,38 +1280,34 @@ static inline loff_t max_reiserfs_offset (struct inode * inode)
1324 calculating what we can shift to neighbors and how many nodes we 1280 calculating what we can shift to neighbors and how many nodes we
1325 have to have if we do not any shiftings, if we shift to left/right 1281 have to have if we do not any shiftings, if we shift to left/right
1326 neighbor or to both. */ 1282 neighbor or to both. */
1327struct virtual_item 1283struct virtual_item {
1328{ 1284 int vi_index; // index in the array of item operations
1329 int vi_index; // index in the array of item operations 1285 unsigned short vi_type; // left/right mergeability
1330 unsigned short vi_type; // left/right mergeability 1286 unsigned short vi_item_len; /* length of item that it will have after balancing */
1331 unsigned short vi_item_len; /* length of item that it will have after balancing */ 1287 struct item_head *vi_ih;
1332 struct item_head * vi_ih; 1288 const char *vi_item; // body of item (old or new)
1333 const char * vi_item; // body of item (old or new) 1289 const void *vi_new_data; // 0 always but paste mode
1334 const void * vi_new_data; // 0 always but paste mode 1290 void *vi_uarea; // item specific area
1335 void * vi_uarea; // item specific area
1336}; 1291};
1337 1292
1338 1293struct virtual_node {
1339struct virtual_node 1294 char *vn_free_ptr; /* this is a pointer to the free space in the buffer */
1340{ 1295 unsigned short vn_nr_item; /* number of items in virtual node */
1341 char * vn_free_ptr; /* this is a pointer to the free space in the buffer */ 1296 short vn_size; /* size of node , that node would have if it has unlimited size and no balancing is performed */
1342 unsigned short vn_nr_item; /* number of items in virtual node */ 1297 short vn_mode; /* mode of balancing (paste, insert, delete, cut) */
1343 short vn_size; /* size of node , that node would have if it has unlimited size and no balancing is performed */ 1298 short vn_affected_item_num;
1344 short vn_mode; /* mode of balancing (paste, insert, delete, cut) */ 1299 short vn_pos_in_item;
1345 short vn_affected_item_num; 1300 struct item_head *vn_ins_ih; /* item header of inserted item, 0 for other modes */
1346 short vn_pos_in_item; 1301 const void *vn_data;
1347 struct item_head * vn_ins_ih; /* item header of inserted item, 0 for other modes */ 1302 struct virtual_item *vn_vi; /* array of items (including a new one, excluding item to be deleted) */
1348 const void * vn_data;
1349 struct virtual_item * vn_vi; /* array of items (including a new one, excluding item to be deleted) */
1350}; 1303};
1351 1304
1352/* used by directory items when creating virtual nodes */ 1305/* used by directory items when creating virtual nodes */
1353struct direntry_uarea { 1306struct direntry_uarea {
1354 int flags; 1307 int flags;
1355 __u16 entry_count; 1308 __u16 entry_count;
1356 __u16 entry_sizes[1]; 1309 __u16 entry_sizes[1];
1357} __attribute__ ((__packed__)) ; 1310} __attribute__ ((__packed__));
1358
1359 1311
1360/***************************************************************************/ 1312/***************************************************************************/
1361/* TREE BALANCE */ 1313/* TREE BALANCE */
@@ -1378,73 +1330,72 @@ struct direntry_uarea {
1378#define MAX_AMOUNT_NEEDED 2 1330#define MAX_AMOUNT_NEEDED 2
1379 1331
1380/* someday somebody will prefix every field in this struct with tb_ */ 1332/* someday somebody will prefix every field in this struct with tb_ */
1381struct tree_balance 1333struct tree_balance {
1382{ 1334 int tb_mode;
1383 int tb_mode; 1335 int need_balance_dirty;
1384 int need_balance_dirty; 1336 struct super_block *tb_sb;
1385 struct super_block * tb_sb; 1337 struct reiserfs_transaction_handle *transaction_handle;
1386 struct reiserfs_transaction_handle *transaction_handle ; 1338 struct path *tb_path;
1387 struct path * tb_path; 1339 struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */
1388 struct buffer_head * L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ 1340 struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */
1389 struct buffer_head * R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path*/ 1341 struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */
1390 struct buffer_head * FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ 1342 struct buffer_head *FR[MAX_HEIGHT]; /* array of fathers of the right neighbors */
1391 struct buffer_head * FR[MAX_HEIGHT]; /* array of fathers of the right neighbors */ 1343 struct buffer_head *CFL[MAX_HEIGHT]; /* array of common parents of center node and its left neighbor */
1392 struct buffer_head * CFL[MAX_HEIGHT]; /* array of common parents of center node and its left neighbor */ 1344 struct buffer_head *CFR[MAX_HEIGHT]; /* array of common parents of center node and its right neighbor */
1393 struct buffer_head * CFR[MAX_HEIGHT]; /* array of common parents of center node and its right neighbor */ 1345
1394 1346 struct buffer_head *FEB[MAX_FEB_SIZE]; /* array of empty buffers. Number of buffers in array equals
1395 struct buffer_head * FEB[MAX_FEB_SIZE]; /* array of empty buffers. Number of buffers in array equals 1347 cur_blknum. */
1396 cur_blknum. */ 1348 struct buffer_head *used[MAX_FEB_SIZE];
1397 struct buffer_head * used[MAX_FEB_SIZE]; 1349 struct buffer_head *thrown[MAX_FEB_SIZE];
1398 struct buffer_head * thrown[MAX_FEB_SIZE]; 1350 int lnum[MAX_HEIGHT]; /* array of number of items which must be
1399 int lnum[MAX_HEIGHT]; /* array of number of items which must be 1351 shifted to the left in order to balance the
1400 shifted to the left in order to balance the 1352 current node; for leaves includes item that
1401 current node; for leaves includes item that 1353 will be partially shifted; for internal
1402 will be partially shifted; for internal 1354 nodes, it is the number of child pointers
1403 nodes, it is the number of child pointers 1355 rather than items. It includes the new item
1404 rather than items. It includes the new item 1356 being created. The code sometimes subtracts
1405 being created. The code sometimes subtracts 1357 one to get the number of wholly shifted
1406 one to get the number of wholly shifted 1358 items for other purposes. */
1407 items for other purposes. */ 1359 int rnum[MAX_HEIGHT]; /* substitute right for left in comment above */
1408 int rnum[MAX_HEIGHT]; /* substitute right for left in comment above */ 1360 int lkey[MAX_HEIGHT]; /* array indexed by height h mapping the key delimiting L[h] and
1409 int lkey[MAX_HEIGHT]; /* array indexed by height h mapping the key delimiting L[h] and 1361 S[h] to its item number within the node CFL[h] */
1410 S[h] to its item number within the node CFL[h] */ 1362 int rkey[MAX_HEIGHT]; /* substitute r for l in comment above */
1411 int rkey[MAX_HEIGHT]; /* substitute r for l in comment above */ 1363 int insert_size[MAX_HEIGHT]; /* the number of bytes by we are trying to add or remove from
1412 int insert_size[MAX_HEIGHT]; /* the number of bytes by we are trying to add or remove from 1364 S[h]. A negative value means removing. */
1413 S[h]. A negative value means removing. */ 1365 int blknum[MAX_HEIGHT]; /* number of nodes that will replace node S[h] after
1414 int blknum[MAX_HEIGHT]; /* number of nodes that will replace node S[h] after 1366 balancing on the level h of the tree. If 0 then S is
1415 balancing on the level h of the tree. If 0 then S is 1367 being deleted, if 1 then S is remaining and no new nodes
1416 being deleted, if 1 then S is remaining and no new nodes 1368 are being created, if 2 or 3 then 1 or 2 new nodes is
1417 are being created, if 2 or 3 then 1 or 2 new nodes is 1369 being created */
1418 being created */ 1370
1419 1371 /* fields that are used only for balancing leaves of the tree */
1420 /* fields that are used only for balancing leaves of the tree */ 1372 int cur_blknum; /* number of empty blocks having been already allocated */
1421 int cur_blknum; /* number of empty blocks having been already allocated */ 1373 int s0num; /* number of items that fall into left most node when S[0] splits */
1422 int s0num; /* number of items that fall into left most node when S[0] splits */ 1374 int s1num; /* number of items that fall into first new node when S[0] splits */
1423 int s1num; /* number of items that fall into first new node when S[0] splits */ 1375 int s2num; /* number of items that fall into second new node when S[0] splits */
1424 int s2num; /* number of items that fall into second new node when S[0] splits */ 1376 int lbytes; /* number of bytes which can flow to the left neighbor from the left */
1425 int lbytes; /* number of bytes which can flow to the left neighbor from the left */ 1377 /* most liquid item that cannot be shifted from S[0] entirely */
1426 /* most liquid item that cannot be shifted from S[0] entirely */ 1378 /* if -1 then nothing will be partially shifted */
1427 /* if -1 then nothing will be partially shifted */ 1379 int rbytes; /* number of bytes which will flow to the right neighbor from the right */
1428 int rbytes; /* number of bytes which will flow to the right neighbor from the right */ 1380 /* most liquid item that cannot be shifted from S[0] entirely */
1429 /* most liquid item that cannot be shifted from S[0] entirely */ 1381 /* if -1 then nothing will be partially shifted */
1430 /* if -1 then nothing will be partially shifted */ 1382 int s1bytes; /* number of bytes which flow to the first new node when S[0] splits */
1431 int s1bytes; /* number of bytes which flow to the first new node when S[0] splits */ 1383 /* note: if S[0] splits into 3 nodes, then items do not need to be cut */
1432 /* note: if S[0] splits into 3 nodes, then items do not need to be cut */ 1384 int s2bytes;
1433 int s2bytes; 1385 struct buffer_head *buf_to_free[MAX_FREE_BLOCK]; /* buffers which are to be freed after do_balance finishes by unfix_nodes */
1434 struct buffer_head * buf_to_free[MAX_FREE_BLOCK]; /* buffers which are to be freed after do_balance finishes by unfix_nodes */ 1386 char *vn_buf; /* kmalloced memory. Used to create
1435 char * vn_buf; /* kmalloced memory. Used to create
1436 virtual node and keep map of 1387 virtual node and keep map of
1437 dirtied bitmap blocks */ 1388 dirtied bitmap blocks */
1438 int vn_buf_size; /* size of the vn_buf */ 1389 int vn_buf_size; /* size of the vn_buf */
1439 struct virtual_node * tb_vn; /* VN starts after bitmap of bitmap blocks */ 1390 struct virtual_node *tb_vn; /* VN starts after bitmap of bitmap blocks */
1440 1391
1441 int fs_gen; /* saved value of `reiserfs_generation' counter 1392 int fs_gen; /* saved value of `reiserfs_generation' counter
1442 see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */ 1393 see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */
1443#ifdef DISPLACE_NEW_PACKING_LOCALITIES 1394#ifdef DISPLACE_NEW_PACKING_LOCALITIES
1444 struct in_core_key key; /* key pointer, to pass to block allocator or 1395 struct in_core_key key; /* key pointer, to pass to block allocator or
1445 another low-level subsystem */ 1396 another low-level subsystem */
1446#endif 1397#endif
1447} ; 1398};
1448 1399
1449/* These are modes of balancing */ 1400/* These are modes of balancing */
1450 1401
@@ -1479,13 +1430,12 @@ struct tree_balance
1479/* used in do_balance for passing parent of node information that has 1430/* used in do_balance for passing parent of node information that has
1480 been gotten from tb struct */ 1431 been gotten from tb struct */
1481struct buffer_info { 1432struct buffer_info {
1482 struct tree_balance * tb; 1433 struct tree_balance *tb;
1483 struct buffer_head * bi_bh; 1434 struct buffer_head *bi_bh;
1484 struct buffer_head * bi_parent; 1435 struct buffer_head *bi_parent;
1485 int bi_position; 1436 int bi_position;
1486}; 1437};
1487 1438
1488
1489/* there are 4 types of items: stat data, directory item, indirect, direct. 1439/* there are 4 types of items: stat data, directory item, indirect, direct.
1490+-------------------+------------+--------------+------------+ 1440+-------------------+------------+--------------+------------+
1491| | k_offset | k_uniqueness | mergeable? | 1441| | k_offset | k_uniqueness | mergeable? |
@@ -1503,24 +1453,24 @@ struct buffer_info {
1503*/ 1453*/
1504 1454
1505struct item_operations { 1455struct item_operations {
1506 int (*bytes_number) (struct item_head * ih, int block_size); 1456 int (*bytes_number) (struct item_head * ih, int block_size);
1507 void (*decrement_key) (struct cpu_key *); 1457 void (*decrement_key) (struct cpu_key *);
1508 int (*is_left_mergeable) (struct reiserfs_key * ih, unsigned long bsize); 1458 int (*is_left_mergeable) (struct reiserfs_key * ih,
1509 void (*print_item) (struct item_head *, char * item); 1459 unsigned long bsize);
1510 void (*check_item) (struct item_head *, char * item); 1460 void (*print_item) (struct item_head *, char *item);
1511 1461 void (*check_item) (struct item_head *, char *item);
1512 int (*create_vi) (struct virtual_node * vn, struct virtual_item * vi, 1462
1513 int is_affected, int insert_size); 1463 int (*create_vi) (struct virtual_node * vn, struct virtual_item * vi,
1514 int (*check_left) (struct virtual_item * vi, int free, 1464 int is_affected, int insert_size);
1515 int start_skip, int end_skip); 1465 int (*check_left) (struct virtual_item * vi, int free,
1516 int (*check_right) (struct virtual_item * vi, int free); 1466 int start_skip, int end_skip);
1517 int (*part_size) (struct virtual_item * vi, int from, int to); 1467 int (*check_right) (struct virtual_item * vi, int free);
1518 int (*unit_num) (struct virtual_item * vi); 1468 int (*part_size) (struct virtual_item * vi, int from, int to);
1519 void (*print_vi) (struct virtual_item * vi); 1469 int (*unit_num) (struct virtual_item * vi);
1470 void (*print_vi) (struct virtual_item * vi);
1520}; 1471};
1521 1472
1522 1473extern struct item_operations *item_ops[TYPE_ANY + 1];
1523extern struct item_operations * item_ops [TYPE_ANY + 1];
1524 1474
1525#define op_bytes_number(ih,bsize) item_ops[le_ih_k_type (ih)]->bytes_number (ih, bsize) 1475#define op_bytes_number(ih,bsize) item_ops[le_ih_k_type (ih)]->bytes_number (ih, bsize)
1526#define op_is_left_mergeable(key,bsize) item_ops[le_key_k_type (le_key_version (key), key)]->is_left_mergeable (key, bsize) 1476#define op_is_left_mergeable(key,bsize) item_ops[le_key_k_type (le_key_version (key), key)]->is_left_mergeable (key, bsize)
@@ -1533,8 +1483,6 @@ extern struct item_operations * item_ops [TYPE_ANY + 1];
1533#define op_unit_num(vi) item_ops[(vi)->vi_index]->unit_num (vi) 1483#define op_unit_num(vi) item_ops[(vi)->vi_index]->unit_num (vi)
1534#define op_print_vi(vi) item_ops[(vi)->vi_index]->print_vi (vi) 1484#define op_print_vi(vi) item_ops[(vi)->vi_index]->print_vi (vi)
1535 1485
1536
1537
1538#define COMP_SHORT_KEYS comp_short_keys 1486#define COMP_SHORT_KEYS comp_short_keys
1539 1487
1540/* number of blocks pointed to by the indirect item */ 1488/* number of blocks pointed to by the indirect item */
@@ -1545,8 +1493,7 @@ extern struct item_operations * item_ops [TYPE_ANY + 1];
1545 1493
1546/* number of bytes contained by the direct item or the unformatted nodes the indirect item points to */ 1494/* number of bytes contained by the direct item or the unformatted nodes the indirect item points to */
1547 1495
1548 1496/* get the item header */
1549/* get the item header */
1550#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) ) 1497#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
1551 1498
1552/* get key */ 1499/* get key */
@@ -1577,9 +1524,9 @@ extern struct item_operations * item_ops [TYPE_ANY + 1];
1577#define PUT_B_I_POS_UNFM_POINTER(bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0) 1524#define PUT_B_I_POS_UNFM_POINTER(bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0)
1578 1525
1579struct reiserfs_iget_args { 1526struct reiserfs_iget_args {
1580 __u32 objectid ; 1527 __u32 objectid;
1581 __u32 dirid ; 1528 __u32 dirid;
1582} ; 1529};
1583 1530
1584/***************************************************************************/ 1531/***************************************************************************/
1585/* FUNCTION DECLARATIONS */ 1532/* FUNCTION DECLARATIONS */
@@ -1595,11 +1542,11 @@ struct reiserfs_iget_args {
1595 1542
1596/* first block written in a commit. */ 1543/* first block written in a commit. */
1597struct reiserfs_journal_desc { 1544struct reiserfs_journal_desc {
1598 __le32 j_trans_id ; /* id of commit */ 1545 __le32 j_trans_id; /* id of commit */
1599 __le32 j_len ; /* length of commit. len +1 is the commit block */ 1546 __le32 j_len; /* length of commit. len +1 is the commit block */
1600 __le32 j_mount_id ; /* mount id of this trans*/ 1547 __le32 j_mount_id; /* mount id of this trans */
1601 __le32 j_realblock[1] ; /* real locations for each block */ 1548 __le32 j_realblock[1]; /* real locations for each block */
1602} ; 1549};
1603 1550
1604#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id) 1551#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id)
1605#define get_desc_trans_len(d) le32_to_cpu((d)->j_len) 1552#define get_desc_trans_len(d) le32_to_cpu((d)->j_len)
@@ -1611,10 +1558,10 @@ struct reiserfs_journal_desc {
1611 1558
1612/* last block written in a commit */ 1559/* last block written in a commit */
1613struct reiserfs_journal_commit { 1560struct reiserfs_journal_commit {
1614 __le32 j_trans_id ; /* must match j_trans_id from the desc block */ 1561 __le32 j_trans_id; /* must match j_trans_id from the desc block */
1615 __le32 j_len ; /* ditto */ 1562 __le32 j_len; /* ditto */
1616 __le32 j_realblock[1] ; /* real locations for each block */ 1563 __le32 j_realblock[1]; /* real locations for each block */
1617} ; 1564};
1618 1565
1619#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id) 1566#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id)
1620#define get_commit_trans_len(c) le32_to_cpu((c)->j_len) 1567#define get_commit_trans_len(c) le32_to_cpu((c)->j_len)
@@ -1628,19 +1575,19 @@ struct reiserfs_journal_commit {
1628** and this transaction does not need to be replayed. 1575** and this transaction does not need to be replayed.
1629*/ 1576*/
1630struct reiserfs_journal_header { 1577struct reiserfs_journal_header {
1631 __le32 j_last_flush_trans_id ; /* id of last fully flushed transaction */ 1578 __le32 j_last_flush_trans_id; /* id of last fully flushed transaction */
1632 __le32 j_first_unflushed_offset ; /* offset in the log of where to start replay after a crash */ 1579 __le32 j_first_unflushed_offset; /* offset in the log of where to start replay after a crash */
1633 __le32 j_mount_id ; 1580 __le32 j_mount_id;
1634 /* 12 */ struct journal_params jh_journal; 1581 /* 12 */ struct journal_params jh_journal;
1635} ; 1582};
1636 1583
1637/* biggest tunable defines are right here */ 1584/* biggest tunable defines are right here */
1638#define JOURNAL_BLOCK_COUNT 8192 /* number of blocks in the journal */ 1585#define JOURNAL_BLOCK_COUNT 8192 /* number of blocks in the journal */
1639#define JOURNAL_TRANS_MAX_DEFAULT 1024 /* biggest possible single transaction, don't change for now (8/3/99) */ 1586#define JOURNAL_TRANS_MAX_DEFAULT 1024 /* biggest possible single transaction, don't change for now (8/3/99) */
1640#define JOURNAL_TRANS_MIN_DEFAULT 256 1587#define JOURNAL_TRANS_MIN_DEFAULT 256
1641#define JOURNAL_MAX_BATCH_DEFAULT 900 /* max blocks to batch into one transaction, don't make this any bigger than 900 */ 1588#define JOURNAL_MAX_BATCH_DEFAULT 900 /* max blocks to batch into one transaction, don't make this any bigger than 900 */
1642#define JOURNAL_MIN_RATIO 2 1589#define JOURNAL_MIN_RATIO 2
1643#define JOURNAL_MAX_COMMIT_AGE 30 1590#define JOURNAL_MAX_COMMIT_AGE 30
1644#define JOURNAL_MAX_TRANS_AGE 30 1591#define JOURNAL_MAX_TRANS_AGE 30
1645#define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9) 1592#define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9)
1646#ifdef CONFIG_QUOTA 1593#ifdef CONFIG_QUOTA
@@ -1664,10 +1611,10 @@ struct reiserfs_journal_header {
1664** the current number of nodes is > max, the node is freed, otherwise, 1611** the current number of nodes is > max, the node is freed, otherwise,
1665** it is put on a free list for faster use later. 1612** it is put on a free list for faster use later.
1666*/ 1613*/
1667#define REISERFS_MIN_BITMAP_NODES 10 1614#define REISERFS_MIN_BITMAP_NODES 10
1668#define REISERFS_MAX_BITMAP_NODES 100 1615#define REISERFS_MAX_BITMAP_NODES 100
1669 1616
1670#define JBH_HASH_SHIFT 13 /* these are based on journal hash size of 8192 */ 1617#define JBH_HASH_SHIFT 13 /* these are based on journal hash size of 8192 */
1671#define JBH_HASH_MASK 8191 1618#define JBH_HASH_MASK 8191
1672 1619
1673#define _jhashfn(sb,block) \ 1620#define _jhashfn(sb,block) \
@@ -1681,14 +1628,14 @@ struct reiserfs_journal_header {
1681#define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize) 1628#define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
1682 1629
1683enum reiserfs_bh_state_bits { 1630enum reiserfs_bh_state_bits {
1684 BH_JDirty = BH_PrivateStart, /* buffer is in current transaction */ 1631 BH_JDirty = BH_PrivateStart, /* buffer is in current transaction */
1685 BH_JDirty_wait, 1632 BH_JDirty_wait,
1686 BH_JNew, /* disk block was taken off free list before 1633 BH_JNew, /* disk block was taken off free list before
1687 * being in a finished transaction, or 1634 * being in a finished transaction, or
1688 * written to disk. Can be reused immed. */ 1635 * written to disk. Can be reused immed. */
1689 BH_JPrepared, 1636 BH_JPrepared,
1690 BH_JRestore_dirty, 1637 BH_JRestore_dirty,
1691 BH_JTest, // debugging only will go away 1638 BH_JTest, // debugging only will go away
1692}; 1639};
1693 1640
1694BUFFER_FNS(JDirty, journaled); 1641BUFFER_FNS(JDirty, journaled);
@@ -1708,175 +1655,192 @@ TAS_BUFFER_FNS(JTest, journal_test);
1708** transaction handle which is passed around for all journal calls 1655** transaction handle which is passed around for all journal calls
1709*/ 1656*/
1710struct reiserfs_transaction_handle { 1657struct reiserfs_transaction_handle {
1711 struct super_block *t_super ; /* super for this FS when journal_begin was 1658 struct super_block *t_super; /* super for this FS when journal_begin was
1712 called. saves calls to reiserfs_get_super 1659 called. saves calls to reiserfs_get_super
1713 also used by nested transactions to make 1660 also used by nested transactions to make
1714 sure they are nesting on the right FS 1661 sure they are nesting on the right FS
1715 _must_ be first in the handle 1662 _must_ be first in the handle
1716 */ 1663 */
1717 int t_refcount; 1664 int t_refcount;
1718 int t_blocks_logged ; /* number of blocks this writer has logged */ 1665 int t_blocks_logged; /* number of blocks this writer has logged */
1719 int t_blocks_allocated ; /* number of blocks this writer allocated */ 1666 int t_blocks_allocated; /* number of blocks this writer allocated */
1720 unsigned long t_trans_id ; /* sanity check, equals the current trans id */ 1667 unsigned long t_trans_id; /* sanity check, equals the current trans id */
1721 void *t_handle_save ; /* save existing current->journal_info */ 1668 void *t_handle_save; /* save existing current->journal_info */
1722 unsigned displace_new_blocks:1; /* if new block allocation occurres, that block 1669 unsigned displace_new_blocks:1; /* if new block allocation occurres, that block
1723 should be displaced from others */ 1670 should be displaced from others */
1724 struct list_head t_list; 1671 struct list_head t_list;
1725} ; 1672};
1726 1673
1727/* used to keep track of ordered and tail writes, attached to the buffer 1674/* used to keep track of ordered and tail writes, attached to the buffer
1728 * head through b_journal_head. 1675 * head through b_journal_head.
1729 */ 1676 */
1730struct reiserfs_jh { 1677struct reiserfs_jh {
1731 struct reiserfs_journal_list *jl; 1678 struct reiserfs_journal_list *jl;
1732 struct buffer_head *bh; 1679 struct buffer_head *bh;
1733 struct list_head list; 1680 struct list_head list;
1734}; 1681};
1735 1682
1736void reiserfs_free_jh(struct buffer_head *bh); 1683void reiserfs_free_jh(struct buffer_head *bh);
1737int reiserfs_add_tail_list(struct inode *inode, struct buffer_head *bh); 1684int reiserfs_add_tail_list(struct inode *inode, struct buffer_head *bh);
1738int reiserfs_add_ordered_list(struct inode *inode, struct buffer_head *bh); 1685int reiserfs_add_ordered_list(struct inode *inode, struct buffer_head *bh);
1739int journal_mark_dirty(struct reiserfs_transaction_handle *, struct super_block *, struct buffer_head *bh) ; 1686int journal_mark_dirty(struct reiserfs_transaction_handle *,
1740 1687 struct super_block *, struct buffer_head *bh);
1741static inline int 1688
1742reiserfs_file_data_log(struct inode *inode) { 1689static inline int reiserfs_file_data_log(struct inode *inode)
1743 if (reiserfs_data_log(inode->i_sb) || 1690{
1744 (REISERFS_I(inode)->i_flags & i_data_log)) 1691 if (reiserfs_data_log(inode->i_sb) ||
1745 return 1 ; 1692 (REISERFS_I(inode)->i_flags & i_data_log))
1746 return 0 ; 1693 return 1;
1694 return 0;
1747} 1695}
1748 1696
1749static inline int reiserfs_transaction_running(struct super_block *s) { 1697static inline int reiserfs_transaction_running(struct super_block *s)
1750 struct reiserfs_transaction_handle *th = current->journal_info ; 1698{
1751 if (th && th->t_super == s) 1699 struct reiserfs_transaction_handle *th = current->journal_info;
1752 return 1 ; 1700 if (th && th->t_super == s)
1753 if (th && th->t_super == NULL) 1701 return 1;
1754 BUG(); 1702 if (th && th->t_super == NULL)
1755 return 0 ; 1703 BUG();
1704 return 0;
1756} 1705}
1757 1706
1758int reiserfs_async_progress_wait(struct super_block *s); 1707int reiserfs_async_progress_wait(struct super_block *s);
1759 1708
1760struct reiserfs_transaction_handle * 1709struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
1761reiserfs_persistent_transaction(struct super_block *, int count); 1710 super_block
1711 *,
1712 int count);
1762int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *); 1713int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *);
1763int reiserfs_commit_page(struct inode *inode, struct page *page, 1714int reiserfs_commit_page(struct inode *inode, struct page *page,
1764 unsigned from, unsigned to); 1715 unsigned from, unsigned to);
1765int reiserfs_flush_old_commits(struct super_block *); 1716int reiserfs_flush_old_commits(struct super_block *);
1766int reiserfs_commit_for_inode(struct inode *) ; 1717int reiserfs_commit_for_inode(struct inode *);
1767int reiserfs_inode_needs_commit(struct inode *) ; 1718int reiserfs_inode_needs_commit(struct inode *);
1768void reiserfs_update_inode_transaction(struct inode *) ; 1719void reiserfs_update_inode_transaction(struct inode *);
1769void reiserfs_wait_on_write_block(struct super_block *s) ; 1720void reiserfs_wait_on_write_block(struct super_block *s);
1770void reiserfs_block_writes(struct reiserfs_transaction_handle *th) ; 1721void reiserfs_block_writes(struct reiserfs_transaction_handle *th);
1771void reiserfs_allow_writes(struct super_block *s) ; 1722void reiserfs_allow_writes(struct super_block *s);
1772void reiserfs_check_lock_depth(struct super_block *s, char *caller) ; 1723void reiserfs_check_lock_depth(struct super_block *s, char *caller);
1773int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh, int wait) ; 1724int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh,
1774void reiserfs_restore_prepared_buffer(struct super_block *, struct buffer_head *bh) ; 1725 int wait);
1775int journal_init(struct super_block *, const char * j_dev_name, int old_format, unsigned int) ; 1726void reiserfs_restore_prepared_buffer(struct super_block *,
1776int journal_release(struct reiserfs_transaction_handle*, struct super_block *) ; 1727 struct buffer_head *bh);
1777int journal_release_error(struct reiserfs_transaction_handle*, struct super_block *) ; 1728int journal_init(struct super_block *, const char *j_dev_name, int old_format,
1778int journal_end(struct reiserfs_transaction_handle *, struct super_block *, unsigned long) ; 1729 unsigned int);
1779int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *, unsigned long) ; 1730int journal_release(struct reiserfs_transaction_handle *, struct super_block *);
1780int journal_mark_freed(struct reiserfs_transaction_handle *, struct super_block *, b_blocknr_t blocknr) ; 1731int journal_release_error(struct reiserfs_transaction_handle *,
1781int journal_transaction_should_end(struct reiserfs_transaction_handle *, int) ; 1732 struct super_block *);
1782int reiserfs_in_journal(struct super_block *p_s_sb, int bmap_nr, int bit_nr, int searchall, b_blocknr_t *next) ; 1733int journal_end(struct reiserfs_transaction_handle *, struct super_block *,
1783int journal_begin(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; 1734 unsigned long);
1784int journal_join_abort(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; 1735int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *,
1785void reiserfs_journal_abort (struct super_block *sb, int errno); 1736 unsigned long);
1786void reiserfs_abort (struct super_block *sb, int errno, const char *fmt, ...); 1737int journal_mark_freed(struct reiserfs_transaction_handle *,
1787int reiserfs_allocate_list_bitmaps(struct super_block *s, struct reiserfs_list_bitmap *, int) ; 1738 struct super_block *, b_blocknr_t blocknr);
1788 1739int journal_transaction_should_end(struct reiserfs_transaction_handle *, int);
1789void add_save_link (struct reiserfs_transaction_handle * th, 1740int reiserfs_in_journal(struct super_block *p_s_sb, int bmap_nr, int bit_nr,
1790 struct inode * inode, int truncate); 1741 int searchall, b_blocknr_t * next);
1791int remove_save_link (struct inode * inode, int truncate); 1742int journal_begin(struct reiserfs_transaction_handle *,
1743 struct super_block *p_s_sb, unsigned long);
1744int journal_join_abort(struct reiserfs_transaction_handle *,
1745 struct super_block *p_s_sb, unsigned long);
1746void reiserfs_journal_abort(struct super_block *sb, int errno);
1747void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...);
1748int reiserfs_allocate_list_bitmaps(struct super_block *s,
1749 struct reiserfs_list_bitmap *, int);
1750
1751void add_save_link(struct reiserfs_transaction_handle *th,
1752 struct inode *inode, int truncate);
1753int remove_save_link(struct inode *inode, int truncate);
1792 1754
1793/* objectid.c */ 1755/* objectid.c */
1794__u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th); 1756__u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th);
1795void reiserfs_release_objectid (struct reiserfs_transaction_handle *th, __u32 objectid_to_release); 1757void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
1796int reiserfs_convert_objectid_map_v1(struct super_block *) ; 1758 __u32 objectid_to_release);
1759int reiserfs_convert_objectid_map_v1(struct super_block *);
1797 1760
1798/* stree.c */ 1761/* stree.c */
1799int B_IS_IN_TREE(const struct buffer_head *); 1762int B_IS_IN_TREE(const struct buffer_head *);
1800extern void copy_item_head(struct item_head * p_v_to, 1763extern void copy_item_head(struct item_head *p_v_to,
1801 const struct item_head * p_v_from); 1764 const struct item_head *p_v_from);
1802 1765
1803// first key is in cpu form, second - le 1766// first key is in cpu form, second - le
1804extern int comp_short_keys (const struct reiserfs_key * le_key, 1767extern int comp_short_keys(const struct reiserfs_key *le_key,
1805 const struct cpu_key * cpu_key); 1768 const struct cpu_key *cpu_key);
1806extern void le_key2cpu_key (struct cpu_key * to, const struct reiserfs_key * from); 1769extern void le_key2cpu_key(struct cpu_key *to, const struct reiserfs_key *from);
1807 1770
1808// both are in le form 1771// both are in le form
1809extern int comp_le_keys (const struct reiserfs_key *, const struct reiserfs_key *); 1772extern int comp_le_keys(const struct reiserfs_key *,
1810extern int comp_short_le_keys (const struct reiserfs_key *, const struct reiserfs_key *); 1773 const struct reiserfs_key *);
1774extern int comp_short_le_keys(const struct reiserfs_key *,
1775 const struct reiserfs_key *);
1811 1776
1812// 1777//
1813// get key version from on disk key - kludge 1778// get key version from on disk key - kludge
1814// 1779//
1815static inline int le_key_version (const struct reiserfs_key * key) 1780static inline int le_key_version(const struct reiserfs_key *key)
1816{ 1781{
1817 int type; 1782 int type;
1818
1819 type = offset_v2_k_type( &(key->u.k_offset_v2));
1820 if (type != TYPE_DIRECT && type != TYPE_INDIRECT && type != TYPE_DIRENTRY)
1821 return KEY_FORMAT_3_5;
1822
1823 return KEY_FORMAT_3_6;
1824
1825}
1826 1783
1784 type = offset_v2_k_type(&(key->u.k_offset_v2));
1785 if (type != TYPE_DIRECT && type != TYPE_INDIRECT
1786 && type != TYPE_DIRENTRY)
1787 return KEY_FORMAT_3_5;
1788
1789 return KEY_FORMAT_3_6;
1827 1790
1828static inline void copy_key (struct reiserfs_key *to, const struct reiserfs_key *from)
1829{
1830 memcpy (to, from, KEY_SIZE);
1831} 1791}
1832 1792
1793static inline void copy_key(struct reiserfs_key *to,
1794 const struct reiserfs_key *from)
1795{
1796 memcpy(to, from, KEY_SIZE);
1797}
1833 1798
1834int comp_items (const struct item_head * stored_ih, const struct path * p_s_path); 1799int comp_items(const struct item_head *stored_ih, const struct path *p_s_path);
1835const struct reiserfs_key * get_rkey (const struct path * p_s_chk_path, 1800const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path,
1836 const struct super_block * p_s_sb); 1801 const struct super_block *p_s_sb);
1837int search_by_key (struct super_block *, const struct cpu_key *, 1802int search_by_key(struct super_block *, const struct cpu_key *,
1838 struct path *, int); 1803 struct path *, int);
1839#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) 1804#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL)
1840int search_for_position_by_key (struct super_block * p_s_sb, 1805int search_for_position_by_key(struct super_block *p_s_sb,
1841 const struct cpu_key * p_s_cpu_key, 1806 const struct cpu_key *p_s_cpu_key,
1842 struct path * p_s_search_path); 1807 struct path *p_s_search_path);
1843extern void decrement_bcount (struct buffer_head * p_s_bh); 1808extern void decrement_bcount(struct buffer_head *p_s_bh);
1844void decrement_counters_in_path (struct path * p_s_search_path); 1809void decrement_counters_in_path(struct path *p_s_search_path);
1845void pathrelse (struct path * p_s_search_path); 1810void pathrelse(struct path *p_s_search_path);
1846int reiserfs_check_path(struct path *p) ; 1811int reiserfs_check_path(struct path *p);
1847void pathrelse_and_restore (struct super_block *s, struct path * p_s_search_path); 1812void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path);
1848 1813
1849int reiserfs_insert_item (struct reiserfs_transaction_handle *th, 1814int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
1850 struct path * path, 1815 struct path *path,
1851 const struct cpu_key * key, 1816 const struct cpu_key *key,
1852 struct item_head * ih, 1817 struct item_head *ih,
1853 struct inode *inode, const char * body); 1818 struct inode *inode, const char *body);
1854 1819
1855int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th, 1820int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th,
1856 struct path * path, 1821 struct path *path,
1857 const struct cpu_key * key, 1822 const struct cpu_key *key,
1858 struct inode *inode, 1823 struct inode *inode,
1859 const char * body, int paste_size); 1824 const char *body, int paste_size);
1860 1825
1861int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th, 1826int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1862 struct path * path, 1827 struct path *path,
1863 struct cpu_key * key, 1828 struct cpu_key *key,
1864 struct inode * inode, 1829 struct inode *inode,
1865 struct page *page, 1830 struct page *page, loff_t new_file_size);
1866 loff_t new_file_size); 1831
1867 1832int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
1868int reiserfs_delete_item (struct reiserfs_transaction_handle *th, 1833 struct path *path,
1869 struct path * path, 1834 const struct cpu_key *key,
1870 const struct cpu_key * key, 1835 struct inode *inode, struct buffer_head *p_s_un_bh);
1871 struct inode * inode, 1836
1872 struct buffer_head * p_s_un_bh); 1837void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
1873 1838 struct inode *inode, struct reiserfs_key *key);
1874void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th, 1839int reiserfs_delete_object(struct reiserfs_transaction_handle *th,
1875 struct inode *inode, struct reiserfs_key * key); 1840 struct inode *p_s_inode);
1876int reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * p_s_inode); 1841int reiserfs_do_truncate(struct reiserfs_transaction_handle *th,
1877int reiserfs_do_truncate (struct reiserfs_transaction_handle *th, 1842 struct inode *p_s_inode, struct page *,
1878 struct inode * p_s_inode, struct page *, 1843 int update_timestamps);
1879 int update_timestamps);
1880 1844
1881#define i_block_size(inode) ((inode)->i_sb->s_blocksize) 1845#define i_block_size(inode) ((inode)->i_sb->s_blocksize)
1882#define file_size(inode) ((inode)->i_size) 1846#define file_size(inode) ((inode)->i_size)
@@ -1885,66 +1849,67 @@ int reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
1885#define tail_has_to_be_packed(inode) (have_large_tails ((inode)->i_sb)?\ 1849#define tail_has_to_be_packed(inode) (have_large_tails ((inode)->i_sb)?\
1886!STORE_TAIL_IN_UNFM_S1(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):have_small_tails ((inode)->i_sb)?!STORE_TAIL_IN_UNFM_S2(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):0 ) 1850!STORE_TAIL_IN_UNFM_S1(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):have_small_tails ((inode)->i_sb)?!STORE_TAIL_IN_UNFM_S2(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):0 )
1887 1851
1888void padd_item (char * item, int total_length, int length); 1852void padd_item(char *item, int total_length, int length);
1889 1853
1890/* inode.c */ 1854/* inode.c */
1891/* args for the create parameter of reiserfs_get_block */ 1855/* args for the create parameter of reiserfs_get_block */
1892#define GET_BLOCK_NO_CREATE 0 /* don't create new blocks or convert tails */ 1856#define GET_BLOCK_NO_CREATE 0 /* don't create new blocks or convert tails */
1893#define GET_BLOCK_CREATE 1 /* add anything you need to find block */ 1857#define GET_BLOCK_CREATE 1 /* add anything you need to find block */
1894#define GET_BLOCK_NO_HOLE 2 /* return -ENOENT for file holes */ 1858#define GET_BLOCK_NO_HOLE 2 /* return -ENOENT for file holes */
1895#define GET_BLOCK_READ_DIRECT 4 /* read the tail if indirect item not found */ 1859#define GET_BLOCK_READ_DIRECT 4 /* read the tail if indirect item not found */
1896#define GET_BLOCK_NO_ISEM 8 /* i_sem is not held, don't preallocate */ 1860#define GET_BLOCK_NO_ISEM 8 /* i_sem is not held, don't preallocate */
1897#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ 1861#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
1898 1862
1899int restart_transaction(struct reiserfs_transaction_handle *th, struct inode *inode, struct path *path); 1863int restart_transaction(struct reiserfs_transaction_handle *th,
1900void reiserfs_read_locked_inode(struct inode * inode, struct reiserfs_iget_args *args) ; 1864 struct inode *inode, struct path *path);
1901int reiserfs_find_actor(struct inode * inode, void *p) ; 1865void reiserfs_read_locked_inode(struct inode *inode,
1902int reiserfs_init_locked_inode(struct inode * inode, void *p) ; 1866 struct reiserfs_iget_args *args);
1903void reiserfs_delete_inode (struct inode * inode); 1867int reiserfs_find_actor(struct inode *inode, void *p);
1904int reiserfs_write_inode (struct inode * inode, int) ; 1868int reiserfs_init_locked_inode(struct inode *inode, void *p);
1905int reiserfs_get_block (struct inode * inode, sector_t block, struct buffer_head * bh_result, int create); 1869void reiserfs_delete_inode(struct inode *inode);
1906struct dentry *reiserfs_get_dentry(struct super_block *, void *) ; 1870int reiserfs_write_inode(struct inode *inode, int);
1907struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 *data, 1871int reiserfs_get_block(struct inode *inode, sector_t block,
1908 int len, int fhtype, 1872 struct buffer_head *bh_result, int create);
1909 int (*acceptable)(void *contect, struct dentry *de), 1873struct dentry *reiserfs_get_dentry(struct super_block *, void *);
1910 void *context) ; 1874struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 * data,
1911int reiserfs_encode_fh( struct dentry *dentry, __u32 *data, int *lenp, 1875 int len, int fhtype,
1912 int connectable ); 1876 int (*acceptable) (void *contect,
1913 1877 struct dentry * de),
1914int reiserfs_truncate_file(struct inode *, int update_timestamps) ; 1878 void *context);
1915void make_cpu_key (struct cpu_key * cpu_key, struct inode * inode, loff_t offset, 1879int reiserfs_encode_fh(struct dentry *dentry, __u32 * data, int *lenp,
1916 int type, int key_length); 1880 int connectable);
1917void make_le_item_head (struct item_head * ih, const struct cpu_key * key, 1881
1918 int version, 1882int reiserfs_truncate_file(struct inode *, int update_timestamps);
1919 loff_t offset, int type, int length, int entry_count); 1883void make_cpu_key(struct cpu_key *cpu_key, struct inode *inode, loff_t offset,
1920struct inode * reiserfs_iget (struct super_block * s, 1884 int type, int key_length);
1921 const struct cpu_key * key); 1885void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
1922 1886 int version,
1923 1887 loff_t offset, int type, int length, int entry_count);
1924int reiserfs_new_inode (struct reiserfs_transaction_handle *th, 1888struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key);
1925 struct inode * dir, int mode, 1889
1926 const char * symname, loff_t i_size, 1890int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1927 struct dentry *dentry, struct inode *inode); 1891 struct inode *dir, int mode,
1928 1892 const char *symname, loff_t i_size,
1929void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th, 1893 struct dentry *dentry, struct inode *inode);
1930 struct inode * inode, loff_t size); 1894
1895void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
1896 struct inode *inode, loff_t size);
1931 1897
1932static inline void reiserfs_update_sd(struct reiserfs_transaction_handle *th, 1898static inline void reiserfs_update_sd(struct reiserfs_transaction_handle *th,
1933 struct inode *inode) 1899 struct inode *inode)
1934{ 1900{
1935 reiserfs_update_sd_size(th, inode, inode->i_size) ; 1901 reiserfs_update_sd_size(th, inode, inode->i_size);
1936} 1902}
1937 1903
1938void sd_attrs_to_i_attrs( __u16 sd_attrs, struct inode *inode ); 1904void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode);
1939void i_attrs_to_sd_attrs( struct inode *inode, __u16 *sd_attrs ); 1905void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs);
1940int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); 1906int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
1941 1907
1942/* namei.c */ 1908/* namei.c */
1943void set_de_name_and_namelen (struct reiserfs_dir_entry * de); 1909void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
1944int search_by_entry_key (struct super_block * sb, const struct cpu_key * key, 1910int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
1945 struct path * path, 1911 struct path *path, struct reiserfs_dir_entry *de);
1946 struct reiserfs_dir_entry * de); 1912struct dentry *reiserfs_get_parent(struct dentry *);
1947struct dentry *reiserfs_get_parent(struct dentry *) ;
1948/* procfs.c */ 1913/* procfs.c */
1949 1914
1950#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO ) 1915#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
@@ -1953,15 +1918,15 @@ struct dentry *reiserfs_get_parent(struct dentry *) ;
1953#undef REISERFS_PROC_INFO 1918#undef REISERFS_PROC_INFO
1954#endif 1919#endif
1955 1920
1956int reiserfs_proc_info_init( struct super_block *sb ); 1921int reiserfs_proc_info_init(struct super_block *sb);
1957int reiserfs_proc_info_done( struct super_block *sb ); 1922int reiserfs_proc_info_done(struct super_block *sb);
1958struct proc_dir_entry *reiserfs_proc_register_global( char *name, 1923struct proc_dir_entry *reiserfs_proc_register_global(char *name,
1959 read_proc_t *func ); 1924 read_proc_t * func);
1960void reiserfs_proc_unregister_global( const char *name ); 1925void reiserfs_proc_unregister_global(const char *name);
1961int reiserfs_proc_info_global_init( void ); 1926int reiserfs_proc_info_global_init(void);
1962int reiserfs_proc_info_global_done( void ); 1927int reiserfs_proc_info_global_done(void);
1963int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset, 1928int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset,
1964 int count, int *eof, void *data ); 1929 int count, int *eof, void *data);
1965 1930
1966#if defined( REISERFS_PROC_INFO ) 1931#if defined( REISERFS_PROC_INFO )
1967 1932
@@ -1993,123 +1958,132 @@ extern struct inode_operations reiserfs_special_inode_operations;
1993extern struct file_operations reiserfs_dir_operations; 1958extern struct file_operations reiserfs_dir_operations;
1994 1959
1995/* tail_conversion.c */ 1960/* tail_conversion.c */
1996int direct2indirect (struct reiserfs_transaction_handle *, struct inode *, struct path *, struct buffer_head *, loff_t); 1961int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
1997int indirect2direct (struct reiserfs_transaction_handle *, struct inode *, struct page *, struct path *, const struct cpu_key *, loff_t, char *); 1962 struct path *, struct buffer_head *, loff_t);
1998void reiserfs_unmap_buffer(struct buffer_head *) ; 1963int indirect2direct(struct reiserfs_transaction_handle *, struct inode *,
1999 1964 struct page *, struct path *, const struct cpu_key *,
1965 loff_t, char *);
1966void reiserfs_unmap_buffer(struct buffer_head *);
2000 1967
2001/* file.c */ 1968/* file.c */
2002extern struct inode_operations reiserfs_file_inode_operations; 1969extern struct inode_operations reiserfs_file_inode_operations;
2003extern struct file_operations reiserfs_file_operations; 1970extern struct file_operations reiserfs_file_operations;
2004extern struct address_space_operations reiserfs_address_space_operations ; 1971extern struct address_space_operations reiserfs_address_space_operations;
2005 1972
2006/* fix_nodes.c */ 1973/* fix_nodes.c */
2007#ifdef CONFIG_REISERFS_CHECK 1974#ifdef CONFIG_REISERFS_CHECK
2008void * reiserfs_kmalloc (size_t size, int flags, struct super_block * s); 1975void *reiserfs_kmalloc(size_t size, int flags, struct super_block *s);
2009void reiserfs_kfree (const void * vp, size_t size, struct super_block * s); 1976void reiserfs_kfree(const void *vp, size_t size, struct super_block *s);
2010#else 1977#else
2011static inline void *reiserfs_kmalloc(size_t size, int flags, 1978static inline void *reiserfs_kmalloc(size_t size, int flags,
2012 struct super_block *s) 1979 struct super_block *s)
2013{ 1980{
2014 return kmalloc(size, flags); 1981 return kmalloc(size, flags);
2015} 1982}
2016 1983
2017static inline void reiserfs_kfree(const void *vp, size_t size, 1984static inline void reiserfs_kfree(const void *vp, size_t size,
2018 struct super_block *s) 1985 struct super_block *s)
2019{ 1986{
2020 kfree(vp); 1987 kfree(vp);
2021} 1988}
2022#endif 1989#endif
2023 1990
2024int fix_nodes (int n_op_mode, struct tree_balance * p_s_tb, 1991int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb,
2025 struct item_head * p_s_ins_ih, const void *); 1992 struct item_head *p_s_ins_ih, const void *);
2026void unfix_nodes (struct tree_balance *); 1993void unfix_nodes(struct tree_balance *);
2027
2028 1994
2029/* prints.c */ 1995/* prints.c */
2030void reiserfs_panic (struct super_block * s, const char * fmt, ...) __attribute__ ( ( noreturn ) ); 1996void reiserfs_panic(struct super_block *s, const char *fmt, ...)
2031void reiserfs_info (struct super_block *s, const char * fmt, ...); 1997 __attribute__ ((noreturn));
2032void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...); 1998void reiserfs_info(struct super_block *s, const char *fmt, ...);
2033void print_indirect_item (struct buffer_head * bh, int item_num); 1999void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...);
2034void store_print_tb (struct tree_balance * tb); 2000void print_indirect_item(struct buffer_head *bh, int item_num);
2035void print_cur_tb (char * mes); 2001void store_print_tb(struct tree_balance *tb);
2036void print_de (struct reiserfs_dir_entry * de); 2002void print_cur_tb(char *mes);
2037void print_bi (struct buffer_info * bi, char * mes); 2003void print_de(struct reiserfs_dir_entry *de);
2038#define PRINT_LEAF_ITEMS 1 /* print all items */ 2004void print_bi(struct buffer_info *bi, char *mes);
2039#define PRINT_DIRECTORY_ITEMS 2 /* print directory items */ 2005#define PRINT_LEAF_ITEMS 1 /* print all items */
2040#define PRINT_DIRECT_ITEMS 4 /* print contents of direct items */ 2006#define PRINT_DIRECTORY_ITEMS 2 /* print directory items */
2041void print_block (struct buffer_head * bh, ...); 2007#define PRINT_DIRECT_ITEMS 4 /* print contents of direct items */
2042void print_bmap (struct super_block * s, int silent); 2008void print_block(struct buffer_head *bh, ...);
2043void print_bmap_block (int i, char * data, int size, int silent); 2009void print_bmap(struct super_block *s, int silent);
2010void print_bmap_block(int i, char *data, int size, int silent);
2044/*void print_super_block (struct super_block * s, char * mes);*/ 2011/*void print_super_block (struct super_block * s, char * mes);*/
2045void print_objectid_map (struct super_block * s); 2012void print_objectid_map(struct super_block *s);
2046void print_block_head (struct buffer_head * bh, char * mes); 2013void print_block_head(struct buffer_head *bh, char *mes);
2047void check_leaf (struct buffer_head * bh); 2014void check_leaf(struct buffer_head *bh);
2048void check_internal (struct buffer_head * bh); 2015void check_internal(struct buffer_head *bh);
2049void print_statistics (struct super_block * s); 2016void print_statistics(struct super_block *s);
2050char * reiserfs_hashname(int code); 2017char *reiserfs_hashname(int code);
2051 2018
2052/* lbalance.c */ 2019/* lbalance.c */
2053int leaf_move_items (int shift_mode, struct tree_balance * tb, int mov_num, int mov_bytes, struct buffer_head * Snew); 2020int leaf_move_items(int shift_mode, struct tree_balance *tb, int mov_num,
2054int leaf_shift_left (struct tree_balance * tb, int shift_num, int shift_bytes); 2021 int mov_bytes, struct buffer_head *Snew);
2055int leaf_shift_right (struct tree_balance * tb, int shift_num, int shift_bytes); 2022int leaf_shift_left(struct tree_balance *tb, int shift_num, int shift_bytes);
2056void leaf_delete_items (struct buffer_info * cur_bi, int last_first, int first, int del_num, int del_bytes); 2023int leaf_shift_right(struct tree_balance *tb, int shift_num, int shift_bytes);
2057void leaf_insert_into_buf (struct buffer_info * bi, int before, 2024void leaf_delete_items(struct buffer_info *cur_bi, int last_first, int first,
2058 struct item_head * inserted_item_ih, const char * inserted_item_body, int zeros_number); 2025 int del_num, int del_bytes);
2059void leaf_paste_in_buffer (struct buffer_info * bi, int pasted_item_num, 2026void leaf_insert_into_buf(struct buffer_info *bi, int before,
2060 int pos_in_item, int paste_size, const char * body, int zeros_number); 2027 struct item_head *inserted_item_ih,
2061void leaf_cut_from_buffer (struct buffer_info * bi, int cut_item_num, int pos_in_item, 2028 const char *inserted_item_body, int zeros_number);
2062 int cut_size); 2029void leaf_paste_in_buffer(struct buffer_info *bi, int pasted_item_num,
2063void leaf_paste_entries (struct buffer_head * bh, int item_num, int before, 2030 int pos_in_item, int paste_size, const char *body,
2064 int new_entry_count, struct reiserfs_de_head * new_dehs, const char * records, int paste_size); 2031 int zeros_number);
2032void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
2033 int pos_in_item, int cut_size);
2034void leaf_paste_entries(struct buffer_head *bh, int item_num, int before,
2035 int new_entry_count, struct reiserfs_de_head *new_dehs,
2036 const char *records, int paste_size);
2065/* ibalance.c */ 2037/* ibalance.c */
2066int balance_internal (struct tree_balance * , int, int, struct item_head * , 2038int balance_internal(struct tree_balance *, int, int, struct item_head *,
2067 struct buffer_head **); 2039 struct buffer_head **);
2068 2040
2069/* do_balance.c */ 2041/* do_balance.c */
2070void do_balance_mark_leaf_dirty (struct tree_balance * tb, 2042void do_balance_mark_leaf_dirty(struct tree_balance *tb,
2071 struct buffer_head * bh, int flag); 2043 struct buffer_head *bh, int flag);
2072#define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty 2044#define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty
2073#define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty 2045#define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty
2074 2046
2075void do_balance (struct tree_balance * tb, struct item_head * ih, 2047void do_balance(struct tree_balance *tb, struct item_head *ih,
2076 const char * body, int flag); 2048 const char *body, int flag);
2077void reiserfs_invalidate_buffer (struct tree_balance * tb, struct buffer_head * bh); 2049void reiserfs_invalidate_buffer(struct tree_balance *tb,
2050 struct buffer_head *bh);
2078 2051
2079int get_left_neighbor_position (struct tree_balance * tb, int h); 2052int get_left_neighbor_position(struct tree_balance *tb, int h);
2080int get_right_neighbor_position (struct tree_balance * tb, int h); 2053int get_right_neighbor_position(struct tree_balance *tb, int h);
2081void replace_key (struct tree_balance * tb, struct buffer_head *, int, struct buffer_head *, int); 2054void replace_key(struct tree_balance *tb, struct buffer_head *, int,
2082void make_empty_node (struct buffer_info *); 2055 struct buffer_head *, int);
2083struct buffer_head * get_FEB (struct tree_balance *); 2056void make_empty_node(struct buffer_info *);
2057struct buffer_head *get_FEB(struct tree_balance *);
2084 2058
2085/* bitmap.c */ 2059/* bitmap.c */
2086 2060
2087/* structure contains hints for block allocator, and it is a container for 2061/* structure contains hints for block allocator, and it is a container for
2088 * arguments, such as node, search path, transaction_handle, etc. */ 2062 * arguments, such as node, search path, transaction_handle, etc. */
2089 struct __reiserfs_blocknr_hint { 2063struct __reiserfs_blocknr_hint {
2090 struct inode * inode; /* inode passed to allocator, if we allocate unf. nodes */ 2064 struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */
2091 long block; /* file offset, in blocks */ 2065 long block; /* file offset, in blocks */
2092 struct in_core_key key; 2066 struct in_core_key key;
2093 struct path * path; /* search path, used by allocator to deternine search_start by 2067 struct path *path; /* search path, used by allocator to deternine search_start by
2094 * various ways */ 2068 * various ways */
2095 struct reiserfs_transaction_handle * th; /* transaction handle is needed to log super blocks and 2069 struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and
2096 * bitmap blocks changes */ 2070 * bitmap blocks changes */
2097 b_blocknr_t beg, end; 2071 b_blocknr_t beg, end;
2098 b_blocknr_t search_start; /* a field used to transfer search start value (block number) 2072 b_blocknr_t search_start; /* a field used to transfer search start value (block number)
2099 * between different block allocator procedures 2073 * between different block allocator procedures
2100 * (determine_search_start() and others) */ 2074 * (determine_search_start() and others) */
2101 int prealloc_size; /* is set in determine_prealloc_size() function, used by underlayed 2075 int prealloc_size; /* is set in determine_prealloc_size() function, used by underlayed
2102 * function that do actual allocation */ 2076 * function that do actual allocation */
2103 2077
2104 unsigned formatted_node:1; /* the allocator uses different polices for getting disk space for 2078 unsigned formatted_node:1; /* the allocator uses different polices for getting disk space for
2105 * formatted/unformatted blocks with/without preallocation */ 2079 * formatted/unformatted blocks with/without preallocation */
2106 unsigned preallocate:1; 2080 unsigned preallocate:1;
2107}; 2081};
2108 2082
2109typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t; 2083typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t;
2110 2084
2111int reiserfs_parse_alloc_options (struct super_block *, char *); 2085int reiserfs_parse_alloc_options(struct super_block *, char *);
2112void reiserfs_init_alloc_options (struct super_block *s); 2086void reiserfs_init_alloc_options(struct super_block *s);
2113 2087
2114/* 2088/*
2115 * given a directory, this will tell you what packing locality 2089 * given a directory, this will tell you what packing locality
@@ -2118,68 +2092,72 @@ void reiserfs_init_alloc_options (struct super_block *s);
2118 */ 2092 */
2119__le32 reiserfs_choose_packing(struct inode *dir); 2093__le32 reiserfs_choose_packing(struct inode *dir);
2120 2094
2121int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value); 2095int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value);
2122void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted); 2096void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *,
2123int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t * , int, int); 2097 b_blocknr_t, int for_unformatted);
2124extern inline int reiserfs_new_form_blocknrs (struct tree_balance * tb, 2098int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t *, int,
2125 b_blocknr_t *new_blocknrs, int amount_needed) 2099 int);
2100extern inline int reiserfs_new_form_blocknrs(struct tree_balance *tb,
2101 b_blocknr_t * new_blocknrs,
2102 int amount_needed)
2126{ 2103{
2127 reiserfs_blocknr_hint_t hint = { 2104 reiserfs_blocknr_hint_t hint = {
2128 .th = tb->transaction_handle, 2105 .th = tb->transaction_handle,
2129 .path = tb->tb_path, 2106 .path = tb->tb_path,
2130 .inode = NULL, 2107 .inode = NULL,
2131 .key = tb->key, 2108 .key = tb->key,
2132 .block = 0, 2109 .block = 0,
2133 .formatted_node = 1 2110 .formatted_node = 1
2134 }; 2111 };
2135 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, amount_needed, 0); 2112 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, amount_needed,
2113 0);
2136} 2114}
2137 2115
2138extern inline int reiserfs_new_unf_blocknrs (struct reiserfs_transaction_handle *th, 2116extern inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle
2139 struct inode *inode, 2117 *th, struct inode *inode,
2140 b_blocknr_t *new_blocknrs, 2118 b_blocknr_t * new_blocknrs,
2141 struct path * path, long block) 2119 struct path *path, long block)
2142{ 2120{
2143 reiserfs_blocknr_hint_t hint = { 2121 reiserfs_blocknr_hint_t hint = {
2144 .th = th, 2122 .th = th,
2145 .path = path, 2123 .path = path,
2146 .inode = inode, 2124 .inode = inode,
2147 .block = block, 2125 .block = block,
2148 .formatted_node = 0, 2126 .formatted_node = 0,
2149 .preallocate = 0 2127 .preallocate = 0
2150 }; 2128 };
2151 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0); 2129 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0);
2152} 2130}
2153 2131
2154#ifdef REISERFS_PREALLOCATE 2132#ifdef REISERFS_PREALLOCATE
2155extern inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle *th, 2133extern inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle
2156 struct inode * inode, 2134 *th, struct inode *inode,
2157 b_blocknr_t *new_blocknrs, 2135 b_blocknr_t * new_blocknrs,
2158 struct path * path, long block) 2136 struct path *path, long block)
2159{ 2137{
2160 reiserfs_blocknr_hint_t hint = { 2138 reiserfs_blocknr_hint_t hint = {
2161 .th = th, 2139 .th = th,
2162 .path = path, 2140 .path = path,
2163 .inode = inode, 2141 .inode = inode,
2164 .block = block, 2142 .block = block,
2165 .formatted_node = 0, 2143 .formatted_node = 0,
2166 .preallocate = 1 2144 .preallocate = 1
2167 }; 2145 };
2168 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0); 2146 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0);
2169} 2147}
2170 2148
2171void reiserfs_discard_prealloc (struct reiserfs_transaction_handle *th, 2149void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th,
2172 struct inode * inode); 2150 struct inode *inode);
2173void reiserfs_discard_all_prealloc (struct reiserfs_transaction_handle *th); 2151void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th);
2174#endif 2152#endif
2175void reiserfs_claim_blocks_to_be_allocated( struct super_block *sb, int blocks); 2153void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, int blocks);
2176void reiserfs_release_claimed_blocks( struct super_block *sb, int blocks); 2154void reiserfs_release_claimed_blocks(struct super_block *sb, int blocks);
2177int reiserfs_can_fit_pages(struct super_block *sb); 2155int reiserfs_can_fit_pages(struct super_block *sb);
2178 2156
2179/* hashes.c */ 2157/* hashes.c */
2180__u32 keyed_hash (const signed char *msg, int len); 2158__u32 keyed_hash(const signed char *msg, int len);
2181__u32 yura_hash (const signed char *msg, int len); 2159__u32 yura_hash(const signed char *msg, int len);
2182__u32 r5_hash (const signed char *msg, int len); 2160__u32 r5_hash(const signed char *msg, int len);
2183 2161
2184/* the ext2 bit routines adjust for big or little endian as 2162/* the ext2 bit routines adjust for big or little endian as
2185** appropriate for the arch, so in our laziness we use them rather 2163** appropriate for the arch, so in our laziness we use them rather
@@ -2199,11 +2177,10 @@ __u32 r5_hash (const signed char *msg, int len);
2199 absolutely safe */ 2177 absolutely safe */
2200#define SPARE_SPACE 500 2178#define SPARE_SPACE 500
2201 2179
2202
2203/* prototypes from ioctl.c */ 2180/* prototypes from ioctl.c */
2204int reiserfs_ioctl (struct inode * inode, struct file * filp, 2181int reiserfs_ioctl(struct inode *inode, struct file *filp,
2205 unsigned int cmd, unsigned long arg); 2182 unsigned int cmd, unsigned long arg);
2206 2183
2207/* ioctl's command */ 2184/* ioctl's command */
2208#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) 2185#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
2209/* define following flags to be the same as in ext2, so that chattr(1), 2186/* define following flags to be the same as in ext2, so that chattr(1),
@@ -2218,10 +2195,8 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp,
2218 would evolve into real per-fs locks */ 2195 would evolve into real per-fs locks */
2219#define reiserfs_write_lock( sb ) lock_kernel() 2196#define reiserfs_write_lock( sb ) lock_kernel()
2220#define reiserfs_write_unlock( sb ) unlock_kernel() 2197#define reiserfs_write_unlock( sb ) unlock_kernel()
2221 2198
2222/* xattr stuff */ 2199/* xattr stuff */
2223#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem) 2200#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
2224 2201
2225#endif /* _LINUX_REISER_FS_H */ 2202#endif /* _LINUX_REISER_FS_H */
2226
2227
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index e321eb050d6..149be8d9a0c 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -10,54 +10,53 @@ typedef enum {
10 /** this says what format of key do all items (but stat data) of 10 /** this says what format of key do all items (but stat data) of
11 an object have. If this is set, that format is 3.6 otherwise 11 an object have. If this is set, that format is 3.6 otherwise
12 - 3.5 */ 12 - 3.5 */
13 i_item_key_version_mask = 0x0001, 13 i_item_key_version_mask = 0x0001,
14 /** If this is unset, object has 3.5 stat data, otherwise, it has 14 /** If this is unset, object has 3.5 stat data, otherwise, it has
15 3.6 stat data with 64bit size, 32bit nlink etc. */ 15 3.6 stat data with 64bit size, 32bit nlink etc. */
16 i_stat_data_version_mask = 0x0002, 16 i_stat_data_version_mask = 0x0002,
17 /** file might need tail packing on close */ 17 /** file might need tail packing on close */
18 i_pack_on_close_mask = 0x0004, 18 i_pack_on_close_mask = 0x0004,
19 /** don't pack tail of file */ 19 /** don't pack tail of file */
20 i_nopack_mask = 0x0008, 20 i_nopack_mask = 0x0008,
21 /** If those is set, "safe link" was created for this file during 21 /** If those is set, "safe link" was created for this file during
22 truncate or unlink. Safe link is used to avoid leakage of disk 22 truncate or unlink. Safe link is used to avoid leakage of disk
23 space on crash with some files open, but unlinked. */ 23 space on crash with some files open, but unlinked. */
24 i_link_saved_unlink_mask = 0x0010, 24 i_link_saved_unlink_mask = 0x0010,
25 i_link_saved_truncate_mask = 0x0020, 25 i_link_saved_truncate_mask = 0x0020,
26 i_has_xattr_dir = 0x0040, 26 i_has_xattr_dir = 0x0040,
27 i_data_log = 0x0080, 27 i_data_log = 0x0080,
28} reiserfs_inode_flags; 28} reiserfs_inode_flags;
29 29
30
31struct reiserfs_inode_info { 30struct reiserfs_inode_info {
32 __u32 i_key [4];/* key is still 4 32 bit integers */ 31 __u32 i_key[4]; /* key is still 4 32 bit integers */
33 /** transient inode flags that are never stored on disk. Bitmasks 32 /** transient inode flags that are never stored on disk. Bitmasks
34 for this field are defined above. */ 33 for this field are defined above. */
35 __u32 i_flags; 34 __u32 i_flags;
36 35
37 __u32 i_first_direct_byte; // offset of first byte stored in direct item. 36 __u32 i_first_direct_byte; // offset of first byte stored in direct item.
38 37
39 /* copy of persistent inode flags read from sd_attrs. */ 38 /* copy of persistent inode flags read from sd_attrs. */
40 __u32 i_attrs; 39 __u32 i_attrs;
41 40
42 int i_prealloc_block; /* first unused block of a sequence of unused blocks */ 41 int i_prealloc_block; /* first unused block of a sequence of unused blocks */
43 int i_prealloc_count; /* length of that sequence */ 42 int i_prealloc_count; /* length of that sequence */
44 struct list_head i_prealloc_list; /* per-transaction list of inodes which 43 struct list_head i_prealloc_list; /* per-transaction list of inodes which
45 * have preallocated blocks */ 44 * have preallocated blocks */
46 45
47 unsigned new_packing_locality:1; /* new_packig_locality is created; new blocks 46 unsigned new_packing_locality:1; /* new_packig_locality is created; new blocks
48 * for the contents of this directory should be 47 * for the contents of this directory should be
49 * displaced */ 48 * displaced */
50 49
51 /* we use these for fsync or O_SYNC to decide which transaction 50 /* we use these for fsync or O_SYNC to decide which transaction
52 ** needs to be committed in order for this inode to be properly 51 ** needs to be committed in order for this inode to be properly
53 ** flushed */ 52 ** flushed */
54 unsigned long i_trans_id ; 53 unsigned long i_trans_id;
55 struct reiserfs_journal_list *i_jl; 54 struct reiserfs_journal_list *i_jl;
56 55
57 struct posix_acl *i_acl_access; 56 struct posix_acl *i_acl_access;
58 struct posix_acl *i_acl_default; 57 struct posix_acl *i_acl_default;
59 struct rw_semaphore xattr_sem; 58 struct rw_semaphore xattr_sem;
60 struct inode vfs_inode; 59 struct inode vfs_inode;
61}; 60};
62 61
63#endif 62#endif
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 31c709d0fe1..3e68592e52e 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -10,7 +10,7 @@
10#endif 10#endif
11 11
12typedef enum { 12typedef enum {
13 reiserfs_attrs_cleared = 0x00000001, 13 reiserfs_attrs_cleared = 0x00000001,
14} reiserfs_super_block_flags; 14} reiserfs_super_block_flags;
15 15
16/* struct reiserfs_super_block accessors/mutators 16/* struct reiserfs_super_block accessors/mutators
@@ -61,7 +61,7 @@ typedef enum {
61#define sb_umount_state(sbp) (le16_to_cpu((sbp)->s_v1.s_umount_state)) 61#define sb_umount_state(sbp) (le16_to_cpu((sbp)->s_v1.s_umount_state))
62#define set_sb_umount_state(sbp,v) ((sbp)->s_v1.s_umount_state = cpu_to_le16(v)) 62#define set_sb_umount_state(sbp,v) ((sbp)->s_v1.s_umount_state = cpu_to_le16(v))
63#define sb_fs_state(sbp) (le16_to_cpu((sbp)->s_v1.s_fs_state)) 63#define sb_fs_state(sbp) (le16_to_cpu((sbp)->s_v1.s_fs_state))
64#define set_sb_fs_state(sbp,v) ((sbp)->s_v1.s_fs_state = cpu_to_le16(v)) 64#define set_sb_fs_state(sbp,v) ((sbp)->s_v1.s_fs_state = cpu_to_le16(v))
65#define sb_hash_function_code(sbp) \ 65#define sb_hash_function_code(sbp) \
66 (le32_to_cpu((sbp)->s_v1.s_hash_function_code)) 66 (le32_to_cpu((sbp)->s_v1.s_hash_function_code))
67#define set_sb_hash_function_code(sbp,v) \ 67#define set_sb_hash_function_code(sbp,v) \
@@ -103,10 +103,10 @@ typedef enum {
103 103
104/* don't mess with these for a while */ 104/* don't mess with these for a while */
105 /* we have a node size define somewhere in reiserfs_fs.h. -Hans */ 105 /* we have a node size define somewhere in reiserfs_fs.h. -Hans */
106#define JOURNAL_BLOCK_SIZE 4096 /* BUG gotta get rid of this */ 106#define JOURNAL_BLOCK_SIZE 4096 /* BUG gotta get rid of this */
107#define JOURNAL_MAX_CNODE 1500 /* max cnodes to allocate. */ 107#define JOURNAL_MAX_CNODE 1500 /* max cnodes to allocate. */
108#define JOURNAL_HASH_SIZE 8192 108#define JOURNAL_HASH_SIZE 8192
109#define JOURNAL_NUM_BITMAPS 5 /* number of copies of the bitmaps to have floating. Must be >= 2 */ 109#define JOURNAL_NUM_BITMAPS 5 /* number of copies of the bitmaps to have floating. Must be >= 2 */
110 110
111/* One of these for every block in every transaction 111/* One of these for every block in every transaction
112** Each one is in two hash tables. First, a hash of the current transaction, and after journal_end, a 112** Each one is in two hash tables. First, a hash of the current transaction, and after journal_end, a
@@ -117,27 +117,27 @@ typedef enum {
117** to a given transaction. 117** to a given transaction.
118*/ 118*/
119struct reiserfs_journal_cnode { 119struct reiserfs_journal_cnode {
120 struct buffer_head *bh ; /* real buffer head */ 120 struct buffer_head *bh; /* real buffer head */
121 struct super_block *sb ; /* dev of real buffer head */ 121 struct super_block *sb; /* dev of real buffer head */
122 __u32 blocknr ; /* block number of real buffer head, == 0 when buffer on disk */ 122 __u32 blocknr; /* block number of real buffer head, == 0 when buffer on disk */
123 long state ; 123 long state;
124 struct reiserfs_journal_list *jlist ; /* journal list this cnode lives in */ 124 struct reiserfs_journal_list *jlist; /* journal list this cnode lives in */
125 struct reiserfs_journal_cnode *next ; /* next in transaction list */ 125 struct reiserfs_journal_cnode *next; /* next in transaction list */
126 struct reiserfs_journal_cnode *prev ; /* prev in transaction list */ 126 struct reiserfs_journal_cnode *prev; /* prev in transaction list */
127 struct reiserfs_journal_cnode *hprev ; /* prev in hash list */ 127 struct reiserfs_journal_cnode *hprev; /* prev in hash list */
128 struct reiserfs_journal_cnode *hnext ; /* next in hash list */ 128 struct reiserfs_journal_cnode *hnext; /* next in hash list */
129}; 129};
130 130
131struct reiserfs_bitmap_node { 131struct reiserfs_bitmap_node {
132 int id ; 132 int id;
133 char *data ; 133 char *data;
134 struct list_head list ; 134 struct list_head list;
135} ; 135};
136 136
137struct reiserfs_list_bitmap { 137struct reiserfs_list_bitmap {
138 struct reiserfs_journal_list *journal_list ; 138 struct reiserfs_journal_list *journal_list;
139 struct reiserfs_bitmap_node **bitmaps ; 139 struct reiserfs_bitmap_node **bitmaps;
140} ; 140};
141 141
142/* 142/*
143** one of these for each transaction. The most important part here is the j_realblock. 143** one of these for each transaction. The most important part here is the j_realblock.
@@ -146,273 +146,269 @@ struct reiserfs_list_bitmap {
146** and to make sure every real block in a transaction is on disk before allowing the log area 146** and to make sure every real block in a transaction is on disk before allowing the log area
147** to be overwritten */ 147** to be overwritten */
148struct reiserfs_journal_list { 148struct reiserfs_journal_list {
149 unsigned long j_start ; 149 unsigned long j_start;
150 unsigned long j_state; 150 unsigned long j_state;
151 unsigned long j_len ; 151 unsigned long j_len;
152 atomic_t j_nonzerolen ; 152 atomic_t j_nonzerolen;
153 atomic_t j_commit_left ; 153 atomic_t j_commit_left;
154 atomic_t j_older_commits_done ; /* all commits older than this on disk*/ 154 atomic_t j_older_commits_done; /* all commits older than this on disk */
155 struct semaphore j_commit_lock; 155 struct semaphore j_commit_lock;
156 unsigned long j_trans_id ; 156 unsigned long j_trans_id;
157 time_t j_timestamp ; 157 time_t j_timestamp;
158 struct reiserfs_list_bitmap *j_list_bitmap ; 158 struct reiserfs_list_bitmap *j_list_bitmap;
159 struct buffer_head *j_commit_bh ; /* commit buffer head */ 159 struct buffer_head *j_commit_bh; /* commit buffer head */
160 struct reiserfs_journal_cnode *j_realblock ; 160 struct reiserfs_journal_cnode *j_realblock;
161 struct reiserfs_journal_cnode *j_freedlist ; /* list of buffers that were freed during this trans. free each of these on flush */ 161 struct reiserfs_journal_cnode *j_freedlist; /* list of buffers that were freed during this trans. free each of these on flush */
162 /* time ordered list of all active transactions */ 162 /* time ordered list of all active transactions */
163 struct list_head j_list; 163 struct list_head j_list;
164 164
165 /* time ordered list of all transactions we haven't tried to flush yet */ 165 /* time ordered list of all transactions we haven't tried to flush yet */
166 struct list_head j_working_list; 166 struct list_head j_working_list;
167 167
168 /* list of tail conversion targets in need of flush before commit */ 168 /* list of tail conversion targets in need of flush before commit */
169 struct list_head j_tail_bh_list; 169 struct list_head j_tail_bh_list;
170 /* list of data=ordered buffers in need of flush before commit */ 170 /* list of data=ordered buffers in need of flush before commit */
171 struct list_head j_bh_list; 171 struct list_head j_bh_list;
172 int j_refcount; 172 int j_refcount;
173} ; 173};
174 174
175struct reiserfs_journal { 175struct reiserfs_journal {
176 struct buffer_head ** j_ap_blocks ; /* journal blocks on disk */ 176 struct buffer_head **j_ap_blocks; /* journal blocks on disk */
177 struct reiserfs_journal_cnode *j_last ; /* newest journal block */ 177 struct reiserfs_journal_cnode *j_last; /* newest journal block */
178 struct reiserfs_journal_cnode *j_first ; /* oldest journal block. start here for traverse */ 178 struct reiserfs_journal_cnode *j_first; /* oldest journal block. start here for traverse */
179 179
180 struct file *j_dev_file; 180 struct file *j_dev_file;
181 struct block_device *j_dev_bd; 181 struct block_device *j_dev_bd;
182 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ 182 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */
183 183
184 long j_state ; 184 long j_state;
185 unsigned long j_trans_id ; 185 unsigned long j_trans_id;
186 unsigned long j_mount_id ; 186 unsigned long j_mount_id;
187 unsigned long j_start ; /* start of current waiting commit (index into j_ap_blocks) */ 187 unsigned long j_start; /* start of current waiting commit (index into j_ap_blocks) */
188 unsigned long j_len ; /* lenght of current waiting commit */ 188 unsigned long j_len; /* lenght of current waiting commit */
189 unsigned long j_len_alloc ; /* number of buffers requested by journal_begin() */ 189 unsigned long j_len_alloc; /* number of buffers requested by journal_begin() */
190 atomic_t j_wcount ; /* count of writers for current commit */ 190 atomic_t j_wcount; /* count of writers for current commit */
191 unsigned long j_bcount ; /* batch count. allows turning X transactions into 1 */ 191 unsigned long j_bcount; /* batch count. allows turning X transactions into 1 */
192 unsigned long j_first_unflushed_offset ; /* first unflushed transactions offset */ 192 unsigned long j_first_unflushed_offset; /* first unflushed transactions offset */
193 unsigned long j_last_flush_trans_id ; /* last fully flushed journal timestamp */ 193 unsigned long j_last_flush_trans_id; /* last fully flushed journal timestamp */
194 struct buffer_head *j_header_bh ; 194 struct buffer_head *j_header_bh;
195 195
196 time_t j_trans_start_time ; /* time this transaction started */ 196 time_t j_trans_start_time; /* time this transaction started */
197 struct semaphore j_lock; 197 struct semaphore j_lock;
198 struct semaphore j_flush_sem; 198 struct semaphore j_flush_sem;
199 wait_queue_head_t j_join_wait ; /* wait for current transaction to finish before starting new one */ 199 wait_queue_head_t j_join_wait; /* wait for current transaction to finish before starting new one */
200 atomic_t j_jlock ; /* lock for j_join_wait */ 200 atomic_t j_jlock; /* lock for j_join_wait */
201 int j_list_bitmap_index ; /* number of next list bitmap to use */ 201 int j_list_bitmap_index; /* number of next list bitmap to use */
202 int j_must_wait ; /* no more journal begins allowed. MUST sleep on j_join_wait */ 202 int j_must_wait; /* no more journal begins allowed. MUST sleep on j_join_wait */
203 int j_next_full_flush ; /* next journal_end will flush all journal list */ 203 int j_next_full_flush; /* next journal_end will flush all journal list */
204 int j_next_async_flush ; /* next journal_end will flush all async commits */ 204 int j_next_async_flush; /* next journal_end will flush all async commits */
205 205
206 int j_cnode_used ; /* number of cnodes on the used list */ 206 int j_cnode_used; /* number of cnodes on the used list */
207 int j_cnode_free ; /* number of cnodes on the free list */ 207 int j_cnode_free; /* number of cnodes on the free list */
208 208
209 unsigned int j_trans_max ; /* max number of blocks in a transaction. */ 209 unsigned int j_trans_max; /* max number of blocks in a transaction. */
210 unsigned int j_max_batch ; /* max number of blocks to batch into a trans */ 210 unsigned int j_max_batch; /* max number of blocks to batch into a trans */
211 unsigned int j_max_commit_age ; /* in seconds, how old can an async commit be */ 211 unsigned int j_max_commit_age; /* in seconds, how old can an async commit be */
212 unsigned int j_max_trans_age ; /* in seconds, how old can a transaction be */ 212 unsigned int j_max_trans_age; /* in seconds, how old can a transaction be */
213 unsigned int j_default_max_commit_age ; /* the default for the max commit age */ 213 unsigned int j_default_max_commit_age; /* the default for the max commit age */
214 214
215 struct reiserfs_journal_cnode *j_cnode_free_list ; 215 struct reiserfs_journal_cnode *j_cnode_free_list;
216 struct reiserfs_journal_cnode *j_cnode_free_orig ; /* orig pointer returned from vmalloc */ 216 struct reiserfs_journal_cnode *j_cnode_free_orig; /* orig pointer returned from vmalloc */
217 217
218 struct reiserfs_journal_list *j_current_jl; 218 struct reiserfs_journal_list *j_current_jl;
219 int j_free_bitmap_nodes ; 219 int j_free_bitmap_nodes;
220 int j_used_bitmap_nodes ; 220 int j_used_bitmap_nodes;
221 221
222 int j_num_lists; /* total number of active transactions */ 222 int j_num_lists; /* total number of active transactions */
223 int j_num_work_lists; /* number that need attention from kreiserfsd */ 223 int j_num_work_lists; /* number that need attention from kreiserfsd */
224 224
225 /* debugging to make sure things are flushed in order */ 225 /* debugging to make sure things are flushed in order */
226 int j_last_flush_id; 226 int j_last_flush_id;
227 227
228 /* debugging to make sure things are committed in order */ 228 /* debugging to make sure things are committed in order */
229 int j_last_commit_id; 229 int j_last_commit_id;
230 230
231 struct list_head j_bitmap_nodes ; 231 struct list_head j_bitmap_nodes;
232 struct list_head j_dirty_buffers ; 232 struct list_head j_dirty_buffers;
233 spinlock_t j_dirty_buffers_lock ; /* protects j_dirty_buffers */ 233 spinlock_t j_dirty_buffers_lock; /* protects j_dirty_buffers */
234 234
235 /* list of all active transactions */ 235 /* list of all active transactions */
236 struct list_head j_journal_list; 236 struct list_head j_journal_list;
237 /* lists that haven't been touched by writeback attempts */ 237 /* lists that haven't been touched by writeback attempts */
238 struct list_head j_working_list; 238 struct list_head j_working_list;
239 239
240 struct reiserfs_list_bitmap j_list_bitmap[JOURNAL_NUM_BITMAPS] ; /* array of bitmaps to record the deleted blocks */ 240 struct reiserfs_list_bitmap j_list_bitmap[JOURNAL_NUM_BITMAPS]; /* array of bitmaps to record the deleted blocks */
241 struct reiserfs_journal_cnode *j_hash_table[JOURNAL_HASH_SIZE] ; /* hash table for real buffer heads in current trans */ 241 struct reiserfs_journal_cnode *j_hash_table[JOURNAL_HASH_SIZE]; /* hash table for real buffer heads in current trans */
242 struct reiserfs_journal_cnode *j_list_hash_table[JOURNAL_HASH_SIZE] ; /* hash table for all the real buffer heads in all 242 struct reiserfs_journal_cnode *j_list_hash_table[JOURNAL_HASH_SIZE]; /* hash table for all the real buffer heads in all
243 the transactions */ 243 the transactions */
244 struct list_head j_prealloc_list; /* list of inodes which have preallocated blocks */ 244 struct list_head j_prealloc_list; /* list of inodes which have preallocated blocks */
245 int j_persistent_trans; 245 int j_persistent_trans;
246 unsigned long j_max_trans_size ; 246 unsigned long j_max_trans_size;
247 unsigned long j_max_batch_size ; 247 unsigned long j_max_batch_size;
248 248
249 int j_errno; 249 int j_errno;
250 250
251 /* when flushing ordered buffers, throttle new ordered writers */ 251 /* when flushing ordered buffers, throttle new ordered writers */
252 struct work_struct j_work; 252 struct work_struct j_work;
253 atomic_t j_async_throttle; 253 atomic_t j_async_throttle;
254}; 254};
255 255
256enum journal_state_bits { 256enum journal_state_bits {
257 J_WRITERS_BLOCKED = 1, /* set when new writers not allowed */ 257 J_WRITERS_BLOCKED = 1, /* set when new writers not allowed */
258 J_WRITERS_QUEUED, /* set when log is full due to too many writers */ 258 J_WRITERS_QUEUED, /* set when log is full due to too many writers */
259 J_ABORTED, /* set when log is aborted */ 259 J_ABORTED, /* set when log is aborted */
260}; 260};
261 261
262#define JOURNAL_DESC_MAGIC "ReIsErLB" /* ick. magic string to find desc blocks in the journal */
262 263
263#define JOURNAL_DESC_MAGIC "ReIsErLB" /* ick. magic string to find desc blocks in the journal */ 264typedef __u32(*hashf_t) (const signed char *, int);
264 265
265typedef __u32 (*hashf_t) (const signed char *, int); 266struct reiserfs_bitmap_info {
266 267 // FIXME: Won't work with block sizes > 8K
267struct reiserfs_bitmap_info 268 __u16 first_zero_hint;
268{ 269 __u16 free_count;
269 // FIXME: Won't work with block sizes > 8K 270 struct buffer_head *bh; /* the actual bitmap */
270 __u16 first_zero_hint;
271 __u16 free_count;
272 struct buffer_head *bh; /* the actual bitmap */
273}; 271};
274 272
275struct proc_dir_entry; 273struct proc_dir_entry;
276 274
277#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO ) 275#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
278typedef unsigned long int stat_cnt_t; 276typedef unsigned long int stat_cnt_t;
279typedef struct reiserfs_proc_info_data 277typedef struct reiserfs_proc_info_data {
280{ 278 spinlock_t lock;
281 spinlock_t lock; 279 int exiting;
282 int exiting; 280 int max_hash_collisions;
283 int max_hash_collisions; 281
284 282 stat_cnt_t breads;
285 stat_cnt_t breads; 283 stat_cnt_t bread_miss;
286 stat_cnt_t bread_miss; 284 stat_cnt_t search_by_key;
287 stat_cnt_t search_by_key; 285 stat_cnt_t search_by_key_fs_changed;
288 stat_cnt_t search_by_key_fs_changed; 286 stat_cnt_t search_by_key_restarted;
289 stat_cnt_t search_by_key_restarted; 287
290 288 stat_cnt_t insert_item_restarted;
291 stat_cnt_t insert_item_restarted; 289 stat_cnt_t paste_into_item_restarted;
292 stat_cnt_t paste_into_item_restarted; 290 stat_cnt_t cut_from_item_restarted;
293 stat_cnt_t cut_from_item_restarted; 291 stat_cnt_t delete_solid_item_restarted;
294 stat_cnt_t delete_solid_item_restarted; 292 stat_cnt_t delete_item_restarted;
295 stat_cnt_t delete_item_restarted; 293
296 294 stat_cnt_t leaked_oid;
297 stat_cnt_t leaked_oid; 295 stat_cnt_t leaves_removable;
298 stat_cnt_t leaves_removable; 296
299 297 /* balances per level. Use explicit 5 as MAX_HEIGHT is not visible yet. */
300 /* balances per level. Use explicit 5 as MAX_HEIGHT is not visible yet. */ 298 stat_cnt_t balance_at[5]; /* XXX */
301 stat_cnt_t balance_at[ 5 ]; /* XXX */ 299 /* sbk == search_by_key */
302 /* sbk == search_by_key */ 300 stat_cnt_t sbk_read_at[5]; /* XXX */
303 stat_cnt_t sbk_read_at[ 5 ]; /* XXX */ 301 stat_cnt_t sbk_fs_changed[5];
304 stat_cnt_t sbk_fs_changed[ 5 ]; 302 stat_cnt_t sbk_restarted[5];
305 stat_cnt_t sbk_restarted[ 5 ]; 303 stat_cnt_t items_at[5]; /* XXX */
306 stat_cnt_t items_at[ 5 ]; /* XXX */ 304 stat_cnt_t free_at[5]; /* XXX */
307 stat_cnt_t free_at[ 5 ]; /* XXX */ 305 stat_cnt_t can_node_be_removed[5]; /* XXX */
308 stat_cnt_t can_node_be_removed[ 5 ]; /* XXX */ 306 long int lnum[5]; /* XXX */
309 long int lnum[ 5 ]; /* XXX */ 307 long int rnum[5]; /* XXX */
310 long int rnum[ 5 ]; /* XXX */ 308 long int lbytes[5]; /* XXX */
311 long int lbytes[ 5 ]; /* XXX */ 309 long int rbytes[5]; /* XXX */
312 long int rbytes[ 5 ]; /* XXX */ 310 stat_cnt_t get_neighbors[5];
313 stat_cnt_t get_neighbors[ 5 ]; 311 stat_cnt_t get_neighbors_restart[5];
314 stat_cnt_t get_neighbors_restart[ 5 ]; 312 stat_cnt_t need_l_neighbor[5];
315 stat_cnt_t need_l_neighbor[ 5 ]; 313 stat_cnt_t need_r_neighbor[5];
316 stat_cnt_t need_r_neighbor[ 5 ]; 314
317 315 stat_cnt_t free_block;
318 stat_cnt_t free_block; 316 struct __scan_bitmap_stats {
319 struct __scan_bitmap_stats { 317 stat_cnt_t call;
320 stat_cnt_t call; 318 stat_cnt_t wait;
321 stat_cnt_t wait; 319 stat_cnt_t bmap;
322 stat_cnt_t bmap; 320 stat_cnt_t retry;
323 stat_cnt_t retry; 321 stat_cnt_t in_journal_hint;
324 stat_cnt_t in_journal_hint; 322 stat_cnt_t in_journal_nohint;
325 stat_cnt_t in_journal_nohint; 323 stat_cnt_t stolen;
326 stat_cnt_t stolen; 324 } scan_bitmap;
327 } scan_bitmap; 325 struct __journal_stats {
328 struct __journal_stats { 326 stat_cnt_t in_journal;
329 stat_cnt_t in_journal; 327 stat_cnt_t in_journal_bitmap;
330 stat_cnt_t in_journal_bitmap; 328 stat_cnt_t in_journal_reusable;
331 stat_cnt_t in_journal_reusable; 329 stat_cnt_t lock_journal;
332 stat_cnt_t lock_journal; 330 stat_cnt_t lock_journal_wait;
333 stat_cnt_t lock_journal_wait; 331 stat_cnt_t journal_being;
334 stat_cnt_t journal_being; 332 stat_cnt_t journal_relock_writers;
335 stat_cnt_t journal_relock_writers; 333 stat_cnt_t journal_relock_wcount;
336 stat_cnt_t journal_relock_wcount; 334 stat_cnt_t mark_dirty;
337 stat_cnt_t mark_dirty; 335 stat_cnt_t mark_dirty_already;
338 stat_cnt_t mark_dirty_already; 336 stat_cnt_t mark_dirty_notjournal;
339 stat_cnt_t mark_dirty_notjournal; 337 stat_cnt_t restore_prepared;
340 stat_cnt_t restore_prepared; 338 stat_cnt_t prepare;
341 stat_cnt_t prepare; 339 stat_cnt_t prepare_retry;
342 stat_cnt_t prepare_retry; 340 } journal;
343 } journal;
344} reiserfs_proc_info_data_t; 341} reiserfs_proc_info_data_t;
345#else 342#else
346typedef struct reiserfs_proc_info_data 343typedef struct reiserfs_proc_info_data {
347{} reiserfs_proc_info_data_t; 344} reiserfs_proc_info_data_t;
348#endif 345#endif
349 346
350/* reiserfs union of in-core super block data */ 347/* reiserfs union of in-core super block data */
351struct reiserfs_sb_info 348struct reiserfs_sb_info {
352{ 349 struct buffer_head *s_sbh; /* Buffer containing the super block */
353 struct buffer_head * s_sbh; /* Buffer containing the super block */ 350 /* both the comment and the choice of
354 /* both the comment and the choice of 351 name are unclear for s_rs -Hans */
355 name are unclear for s_rs -Hans */ 352 struct reiserfs_super_block *s_rs; /* Pointer to the super block in the buffer */
356 struct reiserfs_super_block * s_rs; /* Pointer to the super block in the buffer */ 353 struct reiserfs_bitmap_info *s_ap_bitmap;
357 struct reiserfs_bitmap_info * s_ap_bitmap; 354 struct reiserfs_journal *s_journal; /* pointer to journal information */
358 struct reiserfs_journal *s_journal ; /* pointer to journal information */ 355 unsigned short s_mount_state; /* reiserfs state (valid, invalid) */
359 unsigned short s_mount_state; /* reiserfs state (valid, invalid) */ 356
360 357 /* Comment? -Hans */
361 /* Comment? -Hans */ 358 void (*end_io_handler) (struct buffer_head *, int);
362 void (*end_io_handler)(struct buffer_head *, int); 359 hashf_t s_hash_function; /* pointer to function which is used
363 hashf_t s_hash_function; /* pointer to function which is used 360 to sort names in directory. Set on
364 to sort names in directory. Set on 361 mount */
365 mount */ 362 unsigned long s_mount_opt; /* reiserfs's mount options are set
366 unsigned long s_mount_opt; /* reiserfs's mount options are set 363 here (currently - NOTAIL, NOLOG,
367 here (currently - NOTAIL, NOLOG, 364 REPLAYONLY) */
368 REPLAYONLY) */ 365
369 366 struct { /* This is a structure that describes block allocator options */
370 struct { /* This is a structure that describes block allocator options */ 367 unsigned long bits; /* Bitfield for enable/disable kind of options */
371 unsigned long bits; /* Bitfield for enable/disable kind of options */ 368 unsigned long large_file_size; /* size started from which we consider file to be a large one(in blocks) */
372 unsigned long large_file_size; /* size started from which we consider file to be a large one(in blocks) */ 369 int border; /* percentage of disk, border takes */
373 int border; /* percentage of disk, border takes */ 370 int preallocmin; /* Minimal file size (in blocks) starting from which we do preallocations */
374 int preallocmin; /* Minimal file size (in blocks) starting from which we do preallocations */ 371 int preallocsize; /* Number of blocks we try to prealloc when file
375 int preallocsize; /* Number of blocks we try to prealloc when file 372 reaches preallocmin size (in blocks) or
376 reaches preallocmin size (in blocks) or 373 prealloc_list is empty. */
377 prealloc_list is empty. */ 374 } s_alloc_options;
378 } s_alloc_options; 375
379 376 /* Comment? -Hans */
380 /* Comment? -Hans */ 377 wait_queue_head_t s_wait;
381 wait_queue_head_t s_wait; 378 /* To be obsoleted soon by per buffer seals.. -Hans */
382 /* To be obsoleted soon by per buffer seals.. -Hans */ 379 atomic_t s_generation_counter; // increased by one every time the
383 atomic_t s_generation_counter; // increased by one every time the 380 // tree gets re-balanced
384 // tree gets re-balanced 381 unsigned long s_properties; /* File system properties. Currently holds
385 unsigned long s_properties; /* File system properties. Currently holds 382 on-disk FS format */
386 on-disk FS format */ 383
387 384 /* session statistics */
388 /* session statistics */ 385 int s_kmallocs;
389 int s_kmallocs; 386 int s_disk_reads;
390 int s_disk_reads; 387 int s_disk_writes;
391 int s_disk_writes; 388 int s_fix_nodes;
392 int s_fix_nodes; 389 int s_do_balance;
393 int s_do_balance; 390 int s_unneeded_left_neighbor;
394 int s_unneeded_left_neighbor; 391 int s_good_search_by_key_reada;
395 int s_good_search_by_key_reada; 392 int s_bmaps;
396 int s_bmaps; 393 int s_bmaps_without_search;
397 int s_bmaps_without_search; 394 int s_direct2indirect;
398 int s_direct2indirect; 395 int s_indirect2direct;
399 int s_indirect2direct;
400 /* set up when it's ok for reiserfs_read_inode2() to read from 396 /* set up when it's ok for reiserfs_read_inode2() to read from
401 disk inode with nlink==0. Currently this is only used during 397 disk inode with nlink==0. Currently this is only used during
402 finish_unfinished() processing at mount time */ 398 finish_unfinished() processing at mount time */
403 int s_is_unlinked_ok; 399 int s_is_unlinked_ok;
404 reiserfs_proc_info_data_t s_proc_info_data; 400 reiserfs_proc_info_data_t s_proc_info_data;
405 struct proc_dir_entry *procdir; 401 struct proc_dir_entry *procdir;
406 int reserved_blocks; /* amount of blocks reserved for further allocations */ 402 int reserved_blocks; /* amount of blocks reserved for further allocations */
407 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ 403 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */
408 struct dentry *priv_root; /* root of /.reiserfs_priv */ 404 struct dentry *priv_root; /* root of /.reiserfs_priv */
409 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ 405 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */
410 struct rw_semaphore xattr_dir_sem; 406 struct rw_semaphore xattr_dir_sem;
411 407
412 int j_errno; 408 int j_errno;
413#ifdef CONFIG_QUOTA 409#ifdef CONFIG_QUOTA
414 char *s_qf_names[MAXQUOTAS]; 410 char *s_qf_names[MAXQUOTAS];
415 int s_jquota_fmt; 411 int s_jquota_fmt;
416#endif 412#endif
417}; 413};
418 414
@@ -422,14 +418,14 @@ struct reiserfs_sb_info
422 418
423enum reiserfs_mount_options { 419enum reiserfs_mount_options {
424/* Mount options */ 420/* Mount options */
425 REISERFS_LARGETAIL, /* large tails will be created in a session */ 421 REISERFS_LARGETAIL, /* large tails will be created in a session */
426 REISERFS_SMALLTAIL, /* small (for files less than block size) tails will be created in a session */ 422 REISERFS_SMALLTAIL, /* small (for files less than block size) tails will be created in a session */
427 REPLAYONLY, /* replay journal and return 0. Use by fsck */ 423 REPLAYONLY, /* replay journal and return 0. Use by fsck */
428 REISERFS_CONVERT, /* -o conv: causes conversion of old 424 REISERFS_CONVERT, /* -o conv: causes conversion of old
429 format super block to the new 425 format super block to the new
430 format. If not specified - old 426 format. If not specified - old
431 partition will be dealt with in a 427 partition will be dealt with in a
432 manner of 3.5.x */ 428 manner of 3.5.x */
433 429
434/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting 430/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting
435** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option 431** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option
@@ -439,41 +435,41 @@ enum reiserfs_mount_options {
439** the existing hash on the FS, so if you have a tea hash disk, and mount 435** the existing hash on the FS, so if you have a tea hash disk, and mount
440** with -o hash=rupasov, the mount will fail. 436** with -o hash=rupasov, the mount will fail.
441*/ 437*/
442 FORCE_TEA_HASH, /* try to force tea hash on mount */ 438 FORCE_TEA_HASH, /* try to force tea hash on mount */
443 FORCE_RUPASOV_HASH, /* try to force rupasov hash on mount */ 439 FORCE_RUPASOV_HASH, /* try to force rupasov hash on mount */
444 FORCE_R5_HASH, /* try to force rupasov hash on mount */ 440 FORCE_R5_HASH, /* try to force rupasov hash on mount */
445 FORCE_HASH_DETECT, /* try to detect hash function on mount */ 441 FORCE_HASH_DETECT, /* try to detect hash function on mount */
446 442
447 REISERFS_DATA_LOG, 443 REISERFS_DATA_LOG,
448 REISERFS_DATA_ORDERED, 444 REISERFS_DATA_ORDERED,
449 REISERFS_DATA_WRITEBACK, 445 REISERFS_DATA_WRITEBACK,
450 446
451/* used for testing experimental features, makes benchmarking new 447/* used for testing experimental features, makes benchmarking new
452 features with and without more convenient, should never be used by 448 features with and without more convenient, should never be used by
453 users in any code shipped to users (ideally) */ 449 users in any code shipped to users (ideally) */
454 450
455 REISERFS_NO_BORDER, 451 REISERFS_NO_BORDER,
456 REISERFS_NO_UNHASHED_RELOCATION, 452 REISERFS_NO_UNHASHED_RELOCATION,
457 REISERFS_HASHED_RELOCATION, 453 REISERFS_HASHED_RELOCATION,
458 REISERFS_ATTRS, 454 REISERFS_ATTRS,
459 REISERFS_XATTRS, 455 REISERFS_XATTRS,
460 REISERFS_XATTRS_USER, 456 REISERFS_XATTRS_USER,
461 REISERFS_POSIXACL, 457 REISERFS_POSIXACL,
462 REISERFS_BARRIER_NONE, 458 REISERFS_BARRIER_NONE,
463 REISERFS_BARRIER_FLUSH, 459 REISERFS_BARRIER_FLUSH,
464 460
465 /* Actions on error */ 461 /* Actions on error */
466 REISERFS_ERROR_PANIC, 462 REISERFS_ERROR_PANIC,
467 REISERFS_ERROR_RO, 463 REISERFS_ERROR_RO,
468 REISERFS_ERROR_CONTINUE, 464 REISERFS_ERROR_CONTINUE,
469 465
470 REISERFS_QUOTA, /* Some quota option specified */ 466 REISERFS_QUOTA, /* Some quota option specified */
471 467
472 REISERFS_TEST1, 468 REISERFS_TEST1,
473 REISERFS_TEST2, 469 REISERFS_TEST2,
474 REISERFS_TEST3, 470 REISERFS_TEST3,
475 REISERFS_TEST4, 471 REISERFS_TEST4,
476 REISERFS_UNSUPPORTED_OPT, 472 REISERFS_UNSUPPORTED_OPT,
477}; 473};
478 474
479#define reiserfs_r5_hash(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_R5_HASH)) 475#define reiserfs_r5_hash(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_R5_HASH))
@@ -504,18 +500,17 @@ enum reiserfs_mount_options {
504#define reiserfs_error_panic(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC)) 500#define reiserfs_error_panic(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC))
505#define reiserfs_error_ro(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO)) 501#define reiserfs_error_ro(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO))
506 502
507void reiserfs_file_buffer (struct buffer_head * bh, int list); 503void reiserfs_file_buffer(struct buffer_head *bh, int list);
508extern struct file_system_type reiserfs_fs_type; 504extern struct file_system_type reiserfs_fs_type;
509int reiserfs_resize(struct super_block *, unsigned long) ; 505int reiserfs_resize(struct super_block *, unsigned long);
510 506
511#define CARRY_ON 0 507#define CARRY_ON 0
512#define SCHEDULE_OCCURRED 1 508#define SCHEDULE_OCCURRED 1
513 509
514
515#define SB_BUFFER_WITH_SB(s) (REISERFS_SB(s)->s_sbh) 510#define SB_BUFFER_WITH_SB(s) (REISERFS_SB(s)->s_sbh)
516#define SB_JOURNAL(s) (REISERFS_SB(s)->s_journal) 511#define SB_JOURNAL(s) (REISERFS_SB(s)->s_journal)
517#define SB_JOURNAL_1st_RESERVED_BLOCK(s) (SB_JOURNAL(s)->j_1st_reserved_block) 512#define SB_JOURNAL_1st_RESERVED_BLOCK(s) (SB_JOURNAL(s)->j_1st_reserved_block)
518#define SB_JOURNAL_LEN_FREE(s) (SB_JOURNAL(s)->j_journal_len_free) 513#define SB_JOURNAL_LEN_FREE(s) (SB_JOURNAL(s)->j_journal_len_free)
519#define SB_AP_BITMAP(s) (REISERFS_SB(s)->s_ap_bitmap) 514#define SB_AP_BITMAP(s) (REISERFS_SB(s)->s_ap_bitmap)
520 515
521#define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->) 516#define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->)
@@ -525,13 +520,14 @@ int reiserfs_resize(struct super_block *, unsigned long) ;
525 */ 520 */
526static inline char *reiserfs_bdevname(struct super_block *s) 521static inline char *reiserfs_bdevname(struct super_block *s)
527{ 522{
528 return (s == NULL) ? "Null superblock" : s -> s_id; 523 return (s == NULL) ? "Null superblock" : s->s_id;
529} 524}
530 525
531#define reiserfs_is_journal_aborted(journal) (unlikely (__reiserfs_is_journal_aborted (journal))) 526#define reiserfs_is_journal_aborted(journal) (unlikely (__reiserfs_is_journal_aborted (journal)))
532static inline int __reiserfs_is_journal_aborted (struct reiserfs_journal *journal) 527static inline int __reiserfs_is_journal_aborted(struct reiserfs_journal
528 *journal)
533{ 529{
534 return test_bit (J_ABORTED, &journal->j_state); 530 return test_bit(J_ABORTED, &journal->j_state);
535} 531}
536 532
537#endif /* _LINUX_REISER_FS_SB */ 533#endif /* _LINUX_REISER_FS_SB */
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 9244c574882..c84354e8374 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -7,48 +7,48 @@
7#include <linux/xattr.h> 7#include <linux/xattr.h>
8 8
9/* Magic value in header */ 9/* Magic value in header */
10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ 10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
11 11
12struct reiserfs_xattr_header { 12struct reiserfs_xattr_header {
13 __le32 h_magic; /* magic number for identification */ 13 __le32 h_magic; /* magic number for identification */
14 __le32 h_hash; /* hash of the value */ 14 __le32 h_hash; /* hash of the value */
15}; 15};
16 16
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19struct reiserfs_xattr_handler { 19struct reiserfs_xattr_handler {
20 char *prefix; 20 char *prefix;
21 int (*init)(void); 21 int (*init) (void);
22 void (*exit)(void); 22 void (*exit) (void);
23 int (*get)(struct inode *inode, const char *name, void *buffer, 23 int (*get) (struct inode * inode, const char *name, void *buffer,
24 size_t size); 24 size_t size);
25 int (*set)(struct inode *inode, const char *name, const void *buffer, 25 int (*set) (struct inode * inode, const char *name, const void *buffer,
26 size_t size, int flags); 26 size_t size, int flags);
27 int (*del)(struct inode *inode, const char *name); 27 int (*del) (struct inode * inode, const char *name);
28 int (*list)(struct inode *inode, const char *name, int namelen, char *out); 28 int (*list) (struct inode * inode, const char *name, int namelen,
29 struct list_head handlers; 29 char *out);
30 struct list_head handlers;
30}; 31};
31 32
32
33#ifdef CONFIG_REISERFS_FS_XATTR 33#ifdef CONFIG_REISERFS_FS_XATTR
34#define is_reiserfs_priv_object(inode) IS_PRIVATE(inode) 34#define is_reiserfs_priv_object(inode) IS_PRIVATE(inode)
35#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 35#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
36ssize_t reiserfs_getxattr (struct dentry *dentry, const char *name, 36ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name,
37 void *buffer, size_t size); 37 void *buffer, size_t size);
38int reiserfs_setxattr (struct dentry *dentry, const char *name, 38int reiserfs_setxattr(struct dentry *dentry, const char *name,
39 const void *value, size_t size, int flags); 39 const void *value, size_t size, int flags);
40ssize_t reiserfs_listxattr (struct dentry *dentry, char *buffer, size_t size); 40ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
41int reiserfs_removexattr (struct dentry *dentry, const char *name); 41int reiserfs_removexattr(struct dentry *dentry, const char *name);
42int reiserfs_delete_xattrs (struct inode *inode); 42int 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, struct nameidata *nd); 46int reiserfs_permission_locked(struct inode *inode, int mask,
47 47 struct nameidata *nd);
48int reiserfs_xattr_del (struct inode *, const char *); 48
49int reiserfs_xattr_get (const struct inode *, const char *, void *, size_t); 49int reiserfs_xattr_del(struct inode *, const char *);
50int reiserfs_xattr_set (struct inode *, const char *, const void *, 50int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t);
51 size_t, int); 51int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int);
52 52
53extern struct reiserfs_xattr_handler user_handler; 53extern struct reiserfs_xattr_handler user_handler;
54extern struct reiserfs_xattr_handler trusted_handler; 54extern struct reiserfs_xattr_handler trusted_handler;
@@ -56,57 +56,48 @@ extern struct reiserfs_xattr_handler trusted_handler;
56extern struct reiserfs_xattr_handler security_handler; 56extern struct reiserfs_xattr_handler security_handler;
57#endif 57#endif
58 58
59int reiserfs_xattr_register_handlers (void) __init; 59int reiserfs_xattr_register_handlers(void) __init;
60void reiserfs_xattr_unregister_handlers (void); 60void reiserfs_xattr_unregister_handlers(void);
61 61
62static inline void 62static inline void reiserfs_write_lock_xattrs(struct super_block *sb)
63reiserfs_write_lock_xattrs(struct super_block *sb)
64{ 63{
65 down_write (&REISERFS_XATTR_DIR_SEM(sb)); 64 down_write(&REISERFS_XATTR_DIR_SEM(sb));
66} 65}
67static inline void 66static inline void reiserfs_write_unlock_xattrs(struct super_block *sb)
68reiserfs_write_unlock_xattrs(struct super_block *sb)
69{ 67{
70 up_write (&REISERFS_XATTR_DIR_SEM(sb)); 68 up_write(&REISERFS_XATTR_DIR_SEM(sb));
71} 69}
72static inline void 70static inline void reiserfs_read_lock_xattrs(struct super_block *sb)
73reiserfs_read_lock_xattrs(struct super_block *sb)
74{ 71{
75 down_read (&REISERFS_XATTR_DIR_SEM(sb)); 72 down_read(&REISERFS_XATTR_DIR_SEM(sb));
76} 73}
77 74
78static inline void 75static inline void reiserfs_read_unlock_xattrs(struct super_block *sb)
79reiserfs_read_unlock_xattrs(struct super_block *sb)
80{ 76{
81 up_read (&REISERFS_XATTR_DIR_SEM(sb)); 77 up_read(&REISERFS_XATTR_DIR_SEM(sb));
82} 78}
83 79
84static inline void 80static inline void reiserfs_write_lock_xattr_i(struct inode *inode)
85reiserfs_write_lock_xattr_i(struct inode *inode)
86{ 81{
87 down_write (&REISERFS_I(inode)->xattr_sem); 82 down_write(&REISERFS_I(inode)->xattr_sem);
88} 83}
89static inline void 84static inline void reiserfs_write_unlock_xattr_i(struct inode *inode)
90reiserfs_write_unlock_xattr_i(struct inode *inode)
91{ 85{
92 up_write (&REISERFS_I(inode)->xattr_sem); 86 up_write(&REISERFS_I(inode)->xattr_sem);
93} 87}
94static inline void 88static inline void reiserfs_read_lock_xattr_i(struct inode *inode)
95reiserfs_read_lock_xattr_i(struct inode *inode)
96{ 89{
97 down_read (&REISERFS_I(inode)->xattr_sem); 90 down_read(&REISERFS_I(inode)->xattr_sem);
98} 91}
99 92
100static inline void 93static inline void reiserfs_read_unlock_xattr_i(struct inode *inode)
101reiserfs_read_unlock_xattr_i(struct inode *inode)
102{ 94{
103 up_read (&REISERFS_I(inode)->xattr_sem); 95 up_read(&REISERFS_I(inode)->xattr_sem);
104} 96}
105 97
106static inline void 98static inline void reiserfs_mark_inode_private(struct inode *inode)
107reiserfs_mark_inode_private(struct inode *inode)
108{ 99{
109 inode->i_flags |= S_PRIVATE; 100 inode->i_flags |= S_PRIVATE;
110} 101}
111 102
112#else 103#else
@@ -127,13 +118,20 @@ reiserfs_mark_inode_private(struct inode *inode)
127#define reiserfs_xattr_register_handlers() 0 118#define reiserfs_xattr_register_handlers() 0
128#define reiserfs_xattr_unregister_handlers() 119#define reiserfs_xattr_unregister_handlers()
129 120
130static inline int reiserfs_delete_xattrs (struct inode *inode) { return 0; }; 121static inline int reiserfs_delete_xattrs(struct inode *inode)
131static inline int reiserfs_chown_xattrs (struct inode *inode, struct iattr *attrs) { return 0; }; 122{
132static inline int reiserfs_xattr_init (struct super_block *sb, int mount_flags) 123 return 0;
124};
125static inline int reiserfs_chown_xattrs(struct inode *inode,
126 struct iattr *attrs)
127{
128 return 0;
129};
130static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags)
133{ 131{
134 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ 132 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */
135 return 0; 133 return 0;
136}; 134};
137#endif 135#endif
138 136
139#endif /* __KERNEL__ */ 137#endif /* __KERNEL__ */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ff48815bd3a..dec5827c774 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -410,6 +410,10 @@ struct user_struct {
410 atomic_t processes; /* How many processes does this user have? */ 410 atomic_t processes; /* How many processes does this user have? */
411 atomic_t files; /* How many open files does this user have? */ 411 atomic_t files; /* How many open files does this user have? */
412 atomic_t sigpending; /* How many pending signals does this user have? */ 412 atomic_t sigpending; /* How many pending signals does this user have? */
413#ifdef CONFIG_INOTIFY
414 atomic_t inotify_watches; /* How many inotify watches does this user have? */
415 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
416#endif
413 /* protected by mq_lock */ 417 /* protected by mq_lock */
414 unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */ 418 unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */
415 unsigned long locked_shm; /* How many pages of mlocked shm ? */ 419 unsigned long locked_shm; /* How many pages of mlocked shm ? */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index c75954f2d86..239f520cc49 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -7,6 +7,8 @@
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/list.h> 8#include <linux/list.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/pagemap.h>
11
10#include <asm/atomic.h> 12#include <asm/atomic.h>
11#include <asm/page.h> 13#include <asm/page.h>
12 14
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 5b5f434ac9a..bfbbe94b297 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -70,6 +70,14 @@ enum
70 CTL_BUS_ISA=1 /* ISA */ 70 CTL_BUS_ISA=1 /* ISA */
71}; 71};
72 72
73/* /proc/sys/fs/inotify/ */
74enum
75{
76 INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */
77 INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */
78 INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */
79};
80
73/* CTL_KERN names: */ 81/* CTL_KERN names: */
74enum 82enum
75{ 83{
@@ -676,6 +684,7 @@ enum
676 FS_XFS=17, /* struct: control xfs parameters */ 684 FS_XFS=17, /* struct: control xfs parameters */
677 FS_AIO_NR=18, /* current system-wide number of aio requests */ 685 FS_AIO_NR=18, /* current system-wide number of aio requests */
678 FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */ 686 FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */
687 FS_INOTIFY=20, /* inotify submenu */
679}; 688};
680 689
681/* /proc/sys/fs/quota/ */ 690/* /proc/sys/fs/quota/ */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index eb282b58154..72463779299 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -938,17 +938,17 @@ static inline void usb_fill_int_urb (struct urb *urb,
938} 938}
939 939
940extern void usb_init_urb(struct urb *urb); 940extern void usb_init_urb(struct urb *urb);
941extern struct urb *usb_alloc_urb(int iso_packets, int mem_flags); 941extern struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags);
942extern void usb_free_urb(struct urb *urb); 942extern void usb_free_urb(struct urb *urb);
943#define usb_put_urb usb_free_urb 943#define usb_put_urb usb_free_urb
944extern struct urb *usb_get_urb(struct urb *urb); 944extern struct urb *usb_get_urb(struct urb *urb);
945extern int usb_submit_urb(struct urb *urb, int mem_flags); 945extern int usb_submit_urb(struct urb *urb, unsigned mem_flags);
946extern int usb_unlink_urb(struct urb *urb); 946extern int usb_unlink_urb(struct urb *urb);
947extern void usb_kill_urb(struct urb *urb); 947extern void usb_kill_urb(struct urb *urb);
948 948
949#define HAVE_USB_BUFFERS 949#define HAVE_USB_BUFFERS
950void *usb_buffer_alloc (struct usb_device *dev, size_t size, 950void *usb_buffer_alloc (struct usb_device *dev, size_t size,
951 int mem_flags, dma_addr_t *dma); 951 unsigned mem_flags, dma_addr_t *dma);
952void usb_buffer_free (struct usb_device *dev, size_t size, 952void usb_buffer_free (struct usb_device *dev, size_t size,
953 void *addr, dma_addr_t dma); 953 void *addr, dma_addr_t dma);
954 954
@@ -1055,7 +1055,7 @@ int usb_sg_init (
1055 struct scatterlist *sg, 1055 struct scatterlist *sg,
1056 int nents, 1056 int nents,
1057 size_t length, 1057 size_t length,
1058 int mem_flags 1058 unsigned mem_flags
1059); 1059);
1060void usb_sg_cancel (struct usb_sg_request *io); 1060void usb_sg_cancel (struct usb_sg_request *io);
1061void usb_sg_wait (struct usb_sg_request *io); 1061void usb_sg_wait (struct usb_sg_request *io);
diff --git a/include/linux/usb_cdc.h b/include/linux/usb_cdc.h
index f22d6beecc7..ba617c37245 100644
--- a/include/linux/usb_cdc.h
+++ b/include/linux/usb_cdc.h
@@ -34,6 +34,7 @@
34#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ 34#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
35#define USB_CDC_UNION_TYPE 0x06 /* union_desc */ 35#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
36#define USB_CDC_COUNTRY_TYPE 0x07 36#define USB_CDC_COUNTRY_TYPE 0x07
37#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */
37#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ 38#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
38#define USB_CDC_WHCM_TYPE 0x11 39#define USB_CDC_WHCM_TYPE 0x11
39#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ 40#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */
@@ -83,6 +84,18 @@ struct usb_cdc_union_desc {
83 /* ... and there could be other slave interfaces */ 84 /* ... and there could be other slave interfaces */
84} __attribute__ ((packed)); 85} __attribute__ ((packed));
85 86
87/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
88struct usb_cdc_network_terminal_desc {
89 __u8 bLength;
90 __u8 bDescriptorType;
91 __u8 bDescriptorSubType;
92
93 __u8 bEntityId;
94 __u8 iName;
95 __u8 bChannelIndex;
96 __u8 bPhysicalInterface;
97} __attribute__ ((packed));
98
86/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */ 99/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */
87struct usb_cdc_ether_desc { 100struct usb_cdc_ether_desc {
88 __u8 bLength; 101 __u8 bLength;
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index b00f127cb44..71e60860732 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -107,18 +107,18 @@ struct usb_ep_ops {
107 int (*disable) (struct usb_ep *ep); 107 int (*disable) (struct usb_ep *ep);
108 108
109 struct usb_request *(*alloc_request) (struct usb_ep *ep, 109 struct usb_request *(*alloc_request) (struct usb_ep *ep,
110 int gfp_flags); 110 unsigned gfp_flags);
111 void (*free_request) (struct usb_ep *ep, struct usb_request *req); 111 void (*free_request) (struct usb_ep *ep, struct usb_request *req);
112 112
113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, 113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes,
114 dma_addr_t *dma, int gfp_flags); 114 dma_addr_t *dma, unsigned gfp_flags);
115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, 115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma,
116 unsigned bytes); 116 unsigned bytes);
117 // NOTE: on 2.6, drivers may also use dma_map() and 117 // NOTE: on 2.6, drivers may also use dma_map() and
118 // dma_sync_single_*() to directly manage dma overhead. 118 // dma_sync_single_*() to directly manage dma overhead.
119 119
120 int (*queue) (struct usb_ep *ep, struct usb_request *req, 120 int (*queue) (struct usb_ep *ep, struct usb_request *req,
121 int gfp_flags); 121 unsigned gfp_flags);
122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req); 122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
123 123
124 int (*set_halt) (struct usb_ep *ep, int value); 124 int (*set_halt) (struct usb_ep *ep, int value);
@@ -214,7 +214,7 @@ usb_ep_disable (struct usb_ep *ep)
214 * Returns the request, or null if one could not be allocated. 214 * Returns the request, or null if one could not be allocated.
215 */ 215 */
216static inline struct usb_request * 216static inline struct usb_request *
217usb_ep_alloc_request (struct usb_ep *ep, int gfp_flags) 217usb_ep_alloc_request (struct usb_ep *ep, unsigned gfp_flags)
218{ 218{
219 return ep->ops->alloc_request (ep, gfp_flags); 219 return ep->ops->alloc_request (ep, gfp_flags);
220} 220}
@@ -254,7 +254,7 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
254 */ 254 */
255static inline void * 255static inline void *
256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, 256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma,
257 int gfp_flags) 257 unsigned gfp_flags)
258{ 258{
259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); 259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags);
260} 260}
@@ -330,7 +330,7 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len)
330 * reported when the usb peripheral is disconnected. 330 * reported when the usb peripheral is disconnected.
331 */ 331 */
332static inline int 332static inline int
333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, int gfp_flags) 333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, unsigned gfp_flags)
334{ 334{
335 return ep->ops->queue (ep, req, gfp_flags); 335 return ep->ops->queue (ep, req, gfp_flags);
336} 336}
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 3e89f0f15f4..1b6b76a4eb5 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -516,8 +516,7 @@ struct wan_device {
516/* Public functions available for device drivers */ 516/* Public functions available for device drivers */
517extern int register_wan_device(struct wan_device *wandev); 517extern int register_wan_device(struct wan_device *wandev);
518extern int unregister_wan_device(char *name); 518extern int unregister_wan_device(char *name);
519unsigned short wanrouter_type_trans(struct sk_buff *skb, 519__be16 wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev);
520 struct net_device *dev);
521int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev, 520int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev,
522 unsigned short type); 521 unsigned short type);
523 522
diff --git a/include/media/audiochip.h b/include/media/audiochip.h
index f345a61c3bd..cd831168fdc 100644
--- a/include/media/audiochip.h
+++ b/include/media/audiochip.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: audiochip.h,v 1.3 2005/06/12 04:19:19 mchehab Exp $ 2 * $Id: audiochip.h,v 1.5 2005/06/16 22:59:16 hhackmann Exp $
3 */ 3 */
4 4
5#ifndef AUDIOCHIP_H 5#ifndef AUDIOCHIP_H
@@ -35,5 +35,4 @@
35 35
36/* misc stuff to pass around config info to i2c chips */ 36/* misc stuff to pass around config info to i2c chips */
37#define AUDC_CONFIG_PINNACLE _IOW('m',32,int) 37#define AUDC_CONFIG_PINNACLE _IOW('m',32,int)
38
39#endif /* AUDIOCHIP_H */ 38#endif /* AUDIOCHIP_H */
diff --git a/include/media/saa6752hs.h b/include/media/saa6752hs.h
index 791bad2b86e..3b8686ead80 100644
--- a/include/media/saa6752hs.h
+++ b/include/media/saa6752hs.h
@@ -18,55 +18,6 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/ 19*/
20 20
21#if 0 /* ndef _SAA6752HS_H */
22#define _SAA6752HS_H
23
24enum mpeg_video_bitrate_mode {
25 MPEG_VIDEO_BITRATE_MODE_VBR = 0, /* Variable bitrate */
26 MPEG_VIDEO_BITRATE_MODE_CBR = 1, /* Constant bitrate */
27
28 MPEG_VIDEO_BITRATE_MODE_MAX
29};
30
31enum mpeg_audio_bitrate {
32 MPEG_AUDIO_BITRATE_256 = 0, /* 256 kBit/sec */
33 MPEG_AUDIO_BITRATE_384 = 1, /* 384 kBit/sec */
34
35 MPEG_AUDIO_BITRATE_MAX
36};
37
38enum mpeg_video_format {
39 MPEG_VIDEO_FORMAT_D1 = 0,
40 MPEG_VIDEO_FORMAT_2_3_D1 = 1,
41 MPEG_VIDEO_FORMAT_1_2_D1 = 2,
42 MPEG_VIDEO_FORMAT_SIF = 3,
43
44 MPEG_VIDEO_FORMAT_MAX
45};
46
47#define MPEG_VIDEO_TARGET_BITRATE_MAX 27000
48#define MPEG_VIDEO_MAX_BITRATE_MAX 27000
49#define MPEG_TOTAL_BITRATE_MAX 27000
50#define MPEG_PID_MAX ((1 << 14) - 1)
51
52struct mpeg_params {
53 enum mpeg_video_bitrate_mode video_bitrate_mode;
54 unsigned int video_target_bitrate;
55 unsigned int video_max_bitrate; // only used for VBR
56 enum mpeg_audio_bitrate audio_bitrate;
57 unsigned int total_bitrate;
58
59 unsigned int pmt_pid;
60 unsigned int video_pid;
61 unsigned int audio_pid;
62 unsigned int pcr_pid;
63
64 enum mpeg_video_format video_format;
65};
66
67#define MPEG_SETPARAMS _IOW('6',100,struct mpeg_params)
68
69#endif // _SAA6752HS_H
70 21
71/* 22/*
72 * Local variables: 23 * Local variables:
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 4794c563236..d8c0a556328 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -1,5 +1,5 @@
1 1
2/* $Id: tuner.h,v 1.33 2005/06/21 14:58:08 mkrufky Exp $ 2/* $Id: tuner.h,v 1.42 2005/07/06 09:42:19 mchehab Exp $
3 * 3 *
4 tuner.h - definition for different tuners 4 tuner.h - definition for different tuners
5 5
@@ -26,8 +26,6 @@
26 26
27#include <linux/videodev2.h> 27#include <linux/videodev2.h>
28 28
29#include "id.h"
30
31#define ADDR_UNSET (255) 29#define ADDR_UNSET (255)
32 30
33#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ 31#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */
@@ -111,8 +109,6 @@
111#define TUNER_TEA5767 62 /* Only FM Radio Tuner */ 109#define TUNER_TEA5767 62 /* Only FM Radio Tuner */
112#define TUNER_PHILIPS_FMD1216ME_MK3 63 110#define TUNER_PHILIPS_FMD1216ME_MK3 63
113 111
114#define TEA5767_TUNER_NAME "Philips TEA5767HN FM Radio"
115
116#define NOTUNER 0 112#define NOTUNER 0
117#define PAL 1 /* PAL_BG */ 113#define PAL 1 /* PAL_BG */
118#define PAL_I 2 114#define PAL_I 2
@@ -135,19 +131,8 @@
135#define TCL 11 131#define TCL 11
136#define THOMSON 12 132#define THOMSON 12
137 133
138enum v4l_radio_tuner { 134#define TUNER_SET_TYPE_ADDR _IOW('T',3,int)
139 TEA5767_LOW_LO_32768 = 0, 135#define TDA9887_SET_CONFIG _IOW('t',5,int)
140 TEA5767_HIGH_LO_32768 = 1,
141 TEA5767_LOW_LO_13MHz = 2,
142 TEA5767_HIGH_LO_13MHz = 3,
143};
144
145
146#define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */
147#define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */
148#define TUNER_SET_TYPE_ADDR _IOW('T',3,int) /* set tuner type and I2C addr */
149
150#define TDA9887_SET_CONFIG _IOW('t',5,int)
151 136
152/* tv card specific */ 137/* tv card specific */
153# define TDA9887_PRESENT (1<<0) 138# define TDA9887_PRESENT (1<<0)
@@ -169,25 +154,34 @@ enum v4l_radio_tuner {
169#define I2C_ADDR_TDA8290 0x4b 154#define I2C_ADDR_TDA8290 0x4b
170#define I2C_ADDR_TDA8275 0x61 155#define I2C_ADDR_TDA8275 0x61
171 156
172struct tuner_addr { 157enum tuner_mode {
173 enum v4l2_tuner_type v4l2_tuner; 158 T_UNINITIALIZED = 0,
174 unsigned int type; 159 T_RADIO = 1 << V4L2_TUNER_RADIO,
160 T_ANALOG_TV = 1 << V4L2_TUNER_ANALOG_TV,
161 T_DIGITAL_TV = 1 << V4L2_TUNER_DIGITAL_TV,
162 T_STANDBY = 1 << 31
163};
164
165struct tuner_setup {
175 unsigned short addr; 166 unsigned short addr;
167 unsigned int type;
168 unsigned int mode_mask;
176}; 169};
177 170
178struct tuner { 171struct tuner {
179 /* device */ 172 /* device */
180 struct i2c_client i2c; 173 struct i2c_client i2c;
181 174
182 /* state + config */
183 unsigned int initialized;
184 unsigned int type; /* chip type */ 175 unsigned int type; /* chip type */
176
177 unsigned int mode;
178 unsigned int mode_mask; /* Combination of allowable modes */
179
185 unsigned int freq; /* keep track of the current settings */ 180 unsigned int freq; /* keep track of the current settings */
181 unsigned int audmode;
186 v4l2_std_id std; 182 v4l2_std_id std;
187 int using_v4l2;
188 183
189 enum v4l2_tuner_type mode; 184 int using_v4l2;
190 unsigned int input;
191 185
192 /* used by MT2032 */ 186 /* used by MT2032 */
193 unsigned int xogc; 187 unsigned int xogc;
@@ -197,15 +191,11 @@ struct tuner {
197 unsigned char i2c_easy_mode[2]; 191 unsigned char i2c_easy_mode[2];
198 unsigned char i2c_set_freq[8]; 192 unsigned char i2c_set_freq[8];
199 193
200 /* used to keep track of audmode */
201 unsigned int audmode;
202
203 /* function ptrs */ 194 /* function ptrs */
204 void (*tv_freq)(struct i2c_client *c, unsigned int freq); 195 void (*tv_freq)(struct i2c_client *c, unsigned int freq);
205 void (*radio_freq)(struct i2c_client *c, unsigned int freq); 196 void (*radio_freq)(struct i2c_client *c, unsigned int freq);
206 int (*has_signal)(struct i2c_client *c); 197 int (*has_signal)(struct i2c_client *c);
207 int (*is_stereo)(struct i2c_client *c); 198 int (*is_stereo)(struct i2c_client *c);
208 int (*set_tuner)(struct i2c_client *c, struct v4l2_tuner *v);
209}; 199};
210 200
211extern unsigned int tuner_debug; 201extern unsigned int tuner_debug;
@@ -215,6 +205,7 @@ extern int microtune_init(struct i2c_client *c);
215extern int tda8290_init(struct i2c_client *c); 205extern int tda8290_init(struct i2c_client *c);
216extern int tea5767_tuner_init(struct i2c_client *c); 206extern int tea5767_tuner_init(struct i2c_client *c);
217extern int default_tuner_init(struct i2c_client *c); 207extern int default_tuner_init(struct i2c_client *c);
208extern int tea5767_autodetection(struct i2c_client *c);
218 209
219#define tuner_warn(fmt, arg...) \ 210#define tuner_warn(fmt, arg...) \
220 dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg) 211 dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg)
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index ef2738159ab..4a26adfaed7 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -125,7 +125,8 @@
125 */ 125 */
126extern struct sock *sctp_get_ctl_sock(void); 126extern struct sock *sctp_get_ctl_sock(void);
127extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, 127extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
128 sctp_scope_t, int gfp, int flags); 128 sctp_scope_t, unsigned int __nocast gfp,
129 int flags);
129extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 130extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
130extern int sctp_register_pf(struct sctp_pf *, sa_family_t); 131extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
131 132
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 88d9fe5975d..58462164d96 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -181,17 +181,17 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t,
181int sctp_chunk_iif(const struct sctp_chunk *); 181int sctp_chunk_iif(const struct sctp_chunk *);
182struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *, 182struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *,
183 struct sctp_chunk *, 183 struct sctp_chunk *,
184 int gfp); 184 unsigned int __nocast gfp);
185__u32 sctp_generate_verification_tag(void); 185__u32 sctp_generate_verification_tag(void);
186void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); 186void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);
187 187
188/* Prototypes for chunk-building functions. */ 188/* Prototypes for chunk-building functions. */
189struct sctp_chunk *sctp_make_init(const struct sctp_association *, 189struct sctp_chunk *sctp_make_init(const struct sctp_association *,
190 const struct sctp_bind_addr *, 190 const struct sctp_bind_addr *,
191 int gfp, int vparam_len); 191 unsigned int __nocast gfp, int vparam_len);
192struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *, 192struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *,
193 const struct sctp_chunk *, 193 const struct sctp_chunk *,
194 const int gfp, 194 const unsigned int __nocast gfp,
195 const int unkparam_len); 195 const int unkparam_len);
196struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *, 196struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *,
197 const struct sctp_chunk *); 197 const struct sctp_chunk *);
@@ -265,7 +265,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
265 struct sctp_endpoint *, 265 struct sctp_endpoint *,
266 struct sctp_association *asoc, 266 struct sctp_association *asoc,
267 void *event_arg, 267 void *event_arg,
268 int gfp); 268 unsigned int __nocast gfp);
269 269
270/* 2nd level prototypes */ 270/* 2nd level prototypes */
271void sctp_generate_t3_rtx_event(unsigned long peer); 271void sctp_generate_t3_rtx_event(unsigned long peer);
@@ -275,7 +275,8 @@ void sctp_ootb_pkt_free(struct sctp_packet *);
275 275
276struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *, 276struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *,
277 const struct sctp_association *, 277 const struct sctp_association *,
278 struct sctp_chunk *, int gfp, int *err, 278 struct sctp_chunk *,
279 unsigned int __nocast gfp, int *err,
279 struct sctp_chunk **err_chk_p); 280 struct sctp_chunk **err_chk_p);
280int sctp_addip_addr_config(struct sctp_association *, sctp_param_t, 281int sctp_addip_addr_config(struct sctp_association *, sctp_param_t,
281 struct sockaddr_storage*, int); 282 struct sockaddr_storage*, int);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7435528a174..994009bbe3b 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -445,7 +445,8 @@ struct sctp_ssnmap {
445 int malloced; 445 int malloced;
446}; 446};
447 447
448struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int gfp); 448struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
449 unsigned int __nocast gfp);
449void sctp_ssnmap_free(struct sctp_ssnmap *map); 450void sctp_ssnmap_free(struct sctp_ssnmap *map);
450void sctp_ssnmap_clear(struct sctp_ssnmap *map); 451void sctp_ssnmap_clear(struct sctp_ssnmap *map);
451 452
@@ -945,7 +946,8 @@ struct sctp_transport {
945 } cacc; 946 } cacc;
946}; 947};
947 948
948struct sctp_transport *sctp_transport_new(const union sctp_addr *, int); 949struct sctp_transport *sctp_transport_new(const union sctp_addr *,
950 unsigned int __nocast);
949void sctp_transport_set_owner(struct sctp_transport *, 951void sctp_transport_set_owner(struct sctp_transport *,
950 struct sctp_association *); 952 struct sctp_association *);
951void sctp_transport_route(struct sctp_transport *, union sctp_addr *, 953void sctp_transport_route(struct sctp_transport *, union sctp_addr *,
@@ -1093,9 +1095,10 @@ void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);
1093void sctp_bind_addr_free(struct sctp_bind_addr *); 1095void sctp_bind_addr_free(struct sctp_bind_addr *);
1094int sctp_bind_addr_copy(struct sctp_bind_addr *dest, 1096int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
1095 const struct sctp_bind_addr *src, 1097 const struct sctp_bind_addr *src,
1096 sctp_scope_t scope, int gfp,int flags); 1098 sctp_scope_t scope, unsigned int __nocast gfp,
1099 int flags);
1097int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, 1100int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
1098 int gfp); 1101 unsigned int __nocast gfp);
1099int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); 1102int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
1100int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, 1103int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
1101 struct sctp_sock *); 1104 struct sctp_sock *);
@@ -1104,9 +1107,10 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
1104 int addrcnt, 1107 int addrcnt,
1105 struct sctp_sock *opt); 1108 struct sctp_sock *opt);
1106union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, 1109union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
1107 int *addrs_len, int gfp); 1110 int *addrs_len,
1111 unsigned int __nocast gfp);
1108int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, 1112int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len,
1109 __u16 port, int gfp); 1113 __u16 port, unsigned int __nocast gfp);
1110 1114
1111sctp_scope_t sctp_scope(const union sctp_addr *); 1115sctp_scope_t sctp_scope(const union sctp_addr *);
1112int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); 1116int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope);
@@ -1235,7 +1239,7 @@ static inline struct sctp_endpoint *sctp_ep(struct sctp_ep_common *base)
1235} 1239}
1236 1240
1237/* These are function signatures for manipulating endpoints. */ 1241/* These are function signatures for manipulating endpoints. */
1238struct sctp_endpoint *sctp_endpoint_new(struct sock *, int); 1242struct sctp_endpoint *sctp_endpoint_new(struct sock *, unsigned int __nocast);
1239void sctp_endpoint_free(struct sctp_endpoint *); 1243void sctp_endpoint_free(struct sctp_endpoint *);
1240void sctp_endpoint_put(struct sctp_endpoint *); 1244void sctp_endpoint_put(struct sctp_endpoint *);
1241void sctp_endpoint_hold(struct sctp_endpoint *); 1245void sctp_endpoint_hold(struct sctp_endpoint *);
@@ -1256,7 +1260,7 @@ int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t,
1256 struct sctp_chunk **err_chunk); 1260 struct sctp_chunk **err_chunk);
1257int sctp_process_init(struct sctp_association *, sctp_cid_t cid, 1261int sctp_process_init(struct sctp_association *, sctp_cid_t cid,
1258 const union sctp_addr *peer, 1262 const union sctp_addr *peer,
1259 sctp_init_chunk_t *init, int gfp); 1263 sctp_init_chunk_t *init, unsigned int __nocast gfp);
1260__u32 sctp_generate_tag(const struct sctp_endpoint *); 1264__u32 sctp_generate_tag(const struct sctp_endpoint *);
1261__u32 sctp_generate_tsn(const struct sctp_endpoint *); 1265__u32 sctp_generate_tsn(const struct sctp_endpoint *);
1262 1266
@@ -1719,7 +1723,7 @@ static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base)
1719 1723
1720struct sctp_association * 1724struct sctp_association *
1721sctp_association_new(const struct sctp_endpoint *, const struct sock *, 1725sctp_association_new(const struct sctp_endpoint *, const struct sock *,
1722 sctp_scope_t scope, int gfp); 1726 sctp_scope_t scope, unsigned int __nocast gfp);
1723void sctp_association_free(struct sctp_association *); 1727void sctp_association_free(struct sctp_association *);
1724void sctp_association_put(struct sctp_association *); 1728void sctp_association_put(struct sctp_association *);
1725void sctp_association_hold(struct sctp_association *); 1729void sctp_association_hold(struct sctp_association *);
@@ -1735,7 +1739,7 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc,
1735 const union sctp_addr *laddr); 1739 const union sctp_addr *laddr);
1736struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, 1740struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *,
1737 const union sctp_addr *address, 1741 const union sctp_addr *address,
1738 const int gfp, 1742 const unsigned int __nocast gfp,
1739 const int peer_state); 1743 const int peer_state);
1740void sctp_assoc_del_peer(struct sctp_association *asoc, 1744void sctp_assoc_del_peer(struct sctp_association *asoc,
1741 const union sctp_addr *addr); 1745 const union sctp_addr *addr);
@@ -1759,9 +1763,11 @@ void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned);
1759void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned); 1763void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned);
1760void sctp_assoc_set_primary(struct sctp_association *, 1764void sctp_assoc_set_primary(struct sctp_association *,
1761 struct sctp_transport *); 1765 struct sctp_transport *);
1762int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, int); 1766int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *,
1767 unsigned int __nocast);
1763int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, 1768int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,
1764 struct sctp_cookie*, int gfp); 1769 struct sctp_cookie*,
1770 unsigned int __nocast gfp);
1765 1771
1766int sctp_cmp_addr_exact(const union sctp_addr *ss1, 1772int sctp_cmp_addr_exact(const union sctp_addr *ss1,
1767 const union sctp_addr *ss2); 1773 const union sctp_addr *ss2);
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 1019d83a580..90fe4bf6754 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -88,7 +88,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
88 __u16 error, 88 __u16 error,
89 __u16 outbound, 89 __u16 outbound,
90 __u16 inbound, 90 __u16 inbound,
91 int gfp); 91 unsigned int __nocast gfp);
92 92
93struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( 93struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
94 const struct sctp_association *asoc, 94 const struct sctp_association *asoc,
@@ -96,35 +96,35 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
96 int flags, 96 int flags,
97 int state, 97 int state,
98 int error, 98 int error,
99 int gfp); 99 unsigned int __nocast gfp);
100 100
101struct sctp_ulpevent *sctp_ulpevent_make_remote_error( 101struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
102 const struct sctp_association *asoc, 102 const struct sctp_association *asoc,
103 struct sctp_chunk *chunk, 103 struct sctp_chunk *chunk,
104 __u16 flags, 104 __u16 flags,
105 int gfp); 105 unsigned int __nocast gfp);
106struct sctp_ulpevent *sctp_ulpevent_make_send_failed( 106struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
107 const struct sctp_association *asoc, 107 const struct sctp_association *asoc,
108 struct sctp_chunk *chunk, 108 struct sctp_chunk *chunk,
109 __u16 flags, 109 __u16 flags,
110 __u32 error, 110 __u32 error,
111 int gfp); 111 unsigned int __nocast gfp);
112 112
113struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( 113struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
114 const struct sctp_association *asoc, 114 const struct sctp_association *asoc,
115 __u16 flags, 115 __u16 flags,
116 int gfp); 116 unsigned int __nocast gfp);
117 117
118struct sctp_ulpevent *sctp_ulpevent_make_pdapi( 118struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
119 const struct sctp_association *asoc, 119 const struct sctp_association *asoc,
120 __u32 indication, int gfp); 120 __u32 indication, unsigned int __nocast gfp);
121 121
122struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( 122struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication(
123 const struct sctp_association *asoc, int gfp); 123 const struct sctp_association *asoc, unsigned int __nocast gfp);
124 124
125struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, 125struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
126 struct sctp_chunk *chunk, 126 struct sctp_chunk *chunk,
127 int gfp); 127 unsigned int __nocast gfp);
128 128
129void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, 129void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
130 struct msghdr *); 130 struct msghdr *);
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 961736d29d2..1a60c6d943c 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -62,19 +62,22 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
62void sctp_ulpq_free(struct sctp_ulpq *); 62void sctp_ulpq_free(struct sctp_ulpq *);
63 63
64/* Add a new DATA chunk for processing. */ 64/* Add a new DATA chunk for processing. */
65int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, int); 65int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *,
66 unsigned int __nocast);
66 67
67/* Add a new event for propagation to the ULP. */ 68/* Add a new event for propagation to the ULP. */
68int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); 69int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev);
69 70
70/* Renege previously received chunks. */ 71/* Renege previously received chunks. */
71void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, int); 72void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *,
73 unsigned int __nocast);
72 74
73/* Perform partial delivery. */ 75/* Perform partial delivery. */
74void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, int); 76void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *,
77 unsigned int __nocast);
75 78
76/* Abort the partial delivery. */ 79/* Abort the partial delivery. */
77void sctp_ulpq_abort_pd(struct sctp_ulpq *, int); 80void sctp_ulpq_abort_pd(struct sctp_ulpq *, unsigned int __nocast);
78 81
79/* Clear the partial data delivery condition on this socket. */ 82/* Clear the partial data delivery condition on this socket. */
80int sctp_clear_pd(struct sock *sk); 83int sctp_clear_pd(struct sock *sk);
diff --git a/include/net/x25device.h b/include/net/x25device.h
index cf36a20ea3c..d45ae883bd1 100644
--- a/include/net/x25device.h
+++ b/include/net/x25device.h
@@ -5,8 +5,7 @@
5#include <linux/if_packet.h> 5#include <linux/if_packet.h>
6#include <linux/skbuff.h> 6#include <linux/skbuff.h>
7 7
8static inline unsigned short x25_type_trans(struct sk_buff *skb, 8static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev)
9 struct net_device *dev)
10{ 9{
11 skb->mac.raw = skb->data; 10 skb->mac.raw = skb->data;
12 skb->input_dev = skb->dev = dev; 11 skb->input_dev = skb->dev = dev;
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 0190e766e1a..b707a603351 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -16,10 +16,13 @@
16#ifndef _LINUX_DS_H 16#ifndef _LINUX_DS_H
17#define _LINUX_DS_H 17#define _LINUX_DS_H
18 18
19#ifdef __KERNEL__
20#include <linux/mod_devicetable.h>
21#endif
22
19#include <pcmcia/bulkmem.h> 23#include <pcmcia/bulkmem.h>
20#include <pcmcia/cs_types.h> 24#include <pcmcia/cs_types.h>
21#include <pcmcia/device_id.h> 25#include <pcmcia/device_id.h>
22#include <linux/mod_devicetable.h>
23 26
24typedef struct tuple_parse_t { 27typedef struct tuple_parse_t {
25 tuple_t tuple; 28 tuple_t tuple;