diff options
Diffstat (limited to 'include')
470 files changed, 6365 insertions, 2397 deletions
diff --git a/include/Kbuild b/include/Kbuild new file mode 100644 index 000000000000..cb2534800b19 --- /dev/null +++ b/include/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y += asm-generic/ linux/ scsi/ sound/ mtd/ rdma/ video/ | ||
2 | header-y += asm-$(ARCH)/ | ||
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index b9beceb33141..9e6c23c360b2 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -63,7 +63,7 @@ | |||
63 | 63 | ||
64 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 64 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
65 | 65 | ||
66 | #define ACPI_CA_VERSION 0x20060608 | 66 | #define ACPI_CA_VERSION 0x20060707 |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, | 69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, |
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 288f84903af7..a22fe9cf8493 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h | |||
@@ -201,7 +201,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | |||
201 | acpi_status | 201 | acpi_status |
202 | acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | 202 | acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, |
203 | union acpi_operand_object *obj_desc, | 203 | union acpi_operand_object *obj_desc, |
204 | struct acpi_namespace_node *calling_method_node); | 204 | struct acpi_walk_state *walk_state); |
205 | 205 | ||
206 | acpi_status | 206 | acpi_status |
207 | acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state); | 207 | acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state); |
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 14531d48f6b6..06972e6637de 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h | |||
@@ -181,6 +181,12 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; | |||
181 | extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1]; | 181 | extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1]; |
182 | extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1]; | 182 | extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1]; |
183 | 183 | ||
184 | /***************************************************************************** | ||
185 | * | ||
186 | * Mutual exlusion within ACPICA subsystem | ||
187 | * | ||
188 | ****************************************************************************/ | ||
189 | |||
184 | /* | 190 | /* |
185 | * Predefined mutex objects. This array contains the | 191 | * Predefined mutex objects. This array contains the |
186 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. | 192 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. |
@@ -188,6 +194,20 @@ extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1]; | |||
188 | */ | 194 | */ |
189 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; | 195 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; |
190 | 196 | ||
197 | /* | ||
198 | * Global lock semaphore works in conjunction with the actual HW global lock | ||
199 | */ | ||
200 | ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore; | ||
201 | |||
202 | /* | ||
203 | * Spinlocks are used for interfaces that can be possibly called at | ||
204 | * interrupt level | ||
205 | */ | ||
206 | ACPI_EXTERN spinlock_t _acpi_gbl_gpe_lock; /* For GPE data structs and registers */ | ||
207 | ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */ | ||
208 | #define acpi_gbl_gpe_lock &_acpi_gbl_gpe_lock | ||
209 | #define acpi_gbl_hardware_lock &_acpi_gbl_hardware_lock | ||
210 | |||
191 | /***************************************************************************** | 211 | /***************************************************************************** |
192 | * | 212 | * |
193 | * Miscellaneous globals | 213 | * Miscellaneous globals |
@@ -217,7 +237,6 @@ ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; | |||
217 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; | 237 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; |
218 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; | 238 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; |
219 | ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; | 239 | ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; |
220 | ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; | ||
221 | 240 | ||
222 | /* Misc */ | 241 | /* Misc */ |
223 | 242 | ||
@@ -315,11 +334,6 @@ ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; | |||
315 | ACPI_EXTERN struct acpi_gpe_block_info | 334 | ACPI_EXTERN struct acpi_gpe_block_info |
316 | *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; | 335 | *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; |
317 | 336 | ||
318 | /* Spinlocks */ | ||
319 | |||
320 | ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; | ||
321 | ACPI_EXTERN acpi_handle acpi_gbl_hardware_lock; | ||
322 | |||
323 | /***************************************************************************** | 337 | /***************************************************************************** |
324 | * | 338 | * |
325 | * Debugger globals | 339 | * Debugger globals |
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 9f22cfcb624b..91586d0d5bb5 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h | |||
@@ -53,10 +53,14 @@ | |||
53 | #define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info)) | 53 | #define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info)) |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * If possible, pack the following structure to byte alignment, since we | 56 | * If possible, pack the following structures to byte alignment, since we |
57 | * don't care about performance for debug output | 57 | * don't care about performance for debug output. Two cases where we cannot |
58 | * pack the structures: | ||
59 | * | ||
60 | * 1) Hardware does not support misaligned memory transfers | ||
61 | * 2) Compiler does not support pointers within packed structures | ||
58 | */ | 62 | */ |
59 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | 63 | #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED)) |
60 | #pragma pack(1) | 64 | #pragma pack(1) |
61 | #endif | 65 | #endif |
62 | 66 | ||
@@ -287,7 +291,10 @@ acpi_ex_system_wait_event(union acpi_operand_object *time, | |||
287 | 291 | ||
288 | acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc); | 292 | acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc); |
289 | 293 | ||
290 | acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout); | 294 | acpi_status |
295 | acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout); | ||
296 | |||
297 | acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout); | ||
291 | 298 | ||
292 | /* | 299 | /* |
293 | * exoparg1 - ACPI AML execution, 1 operand | 300 | * exoparg1 - ACPI AML execution, 1 operand |
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 1eeca7adca95..a4d0e73d5aca 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h | |||
@@ -47,10 +47,11 @@ | |||
47 | /* acpisrc:struct_defs -- for acpisrc conversion */ | 47 | /* acpisrc:struct_defs -- for acpisrc conversion */ |
48 | 48 | ||
49 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ | 49 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ |
50 | #define ACPI_INFINITE_CONCURRENCY 0xFF | 50 | #define ACPI_DO_NOT_WAIT 0 |
51 | #define ACPI_SERIALIZED 0xFF | ||
51 | 52 | ||
52 | typedef void *acpi_mutex; | ||
53 | typedef u32 acpi_mutex_handle; | 53 | typedef u32 acpi_mutex_handle; |
54 | #define ACPI_GLOBAL_LOCK (acpi_semaphore) (-1) | ||
54 | 55 | ||
55 | /* Total number of aml opcodes defined */ | 56 | /* Total number of aml opcodes defined */ |
56 | 57 | ||
@@ -79,16 +80,15 @@ union acpi_parse_object; | |||
79 | * table below also! | 80 | * table below also! |
80 | */ | 81 | */ |
81 | #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ | 82 | #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ |
82 | #define ACPI_MTX_CONTROL_METHOD 1 /* Control method termination [TBD: may no longer be necessary] */ | 83 | #define ACPI_MTX_TABLES 1 /* Data for ACPI tables */ |
83 | #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ | 84 | #define ACPI_MTX_NAMESPACE 2 /* ACPI Namespace */ |
84 | #define ACPI_MTX_NAMESPACE 3 /* ACPI Namespace */ | 85 | #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ |
85 | #define ACPI_MTX_EVENTS 4 /* Data for ACPI events */ | 86 | #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ |
86 | #define ACPI_MTX_CACHES 5 /* Internal caches, general purposes */ | 87 | #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ |
87 | #define ACPI_MTX_MEMORY 6 /* Debug memory tracking lists */ | 88 | #define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */ |
88 | #define ACPI_MTX_DEBUG_CMD_COMPLETE 7 /* AML debugger */ | 89 | #define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */ |
89 | #define ACPI_MTX_DEBUG_CMD_READY 8 /* AML debugger */ | 90 | |
90 | 91 | #define ACPI_MAX_MUTEX 7 | |
91 | #define ACPI_MAX_MUTEX 8 | ||
92 | #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 | 92 | #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 |
93 | 93 | ||
94 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 94 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
@@ -98,14 +98,13 @@ union acpi_parse_object; | |||
98 | 98 | ||
99 | static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = { | 99 | static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = { |
100 | "ACPI_MTX_Interpreter", | 100 | "ACPI_MTX_Interpreter", |
101 | "ACPI_MTX_Method", | ||
102 | "ACPI_MTX_Tables", | 101 | "ACPI_MTX_Tables", |
103 | "ACPI_MTX_Namespace", | 102 | "ACPI_MTX_Namespace", |
104 | "ACPI_MTX_Events", | 103 | "ACPI_MTX_Events", |
105 | "ACPI_MTX_Caches", | 104 | "ACPI_MTX_Caches", |
106 | "ACPI_MTX_Memory", | 105 | "ACPI_MTX_Memory", |
107 | "ACPI_MTX_DebugCmdComplete", | 106 | "ACPI_MTX_CommandComplete", |
108 | "ACPI_MTX_DebugCmdReady" | 107 | "ACPI_MTX_CommandReady" |
109 | }; | 108 | }; |
110 | 109 | ||
111 | #endif | 110 | #endif |
@@ -128,7 +127,7 @@ typedef u8 acpi_owner_id; | |||
128 | 127 | ||
129 | /* This Thread ID means that the mutex is not in use (unlocked) */ | 128 | /* This Thread ID means that the mutex is not in use (unlocked) */ |
130 | 129 | ||
131 | #define ACPI_MUTEX_NOT_ACQUIRED (u32) -1 | 130 | #define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0 |
132 | 131 | ||
133 | /* Table for the global mutexes */ | 132 | /* Table for the global mutexes */ |
134 | 133 | ||
@@ -205,7 +204,7 @@ struct acpi_namespace_node { | |||
205 | /* Namespace Node flags */ | 204 | /* Namespace Node flags */ |
206 | 205 | ||
207 | #define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ | 206 | #define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ |
208 | #define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */ | 207 | #define ANOBJ_RESERVED 0x02 /* Available for future use */ |
209 | #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ | 208 | #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ |
210 | #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ | 209 | #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ |
211 | #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ | 210 | #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ |
@@ -705,6 +704,13 @@ struct acpi_bit_register_info { | |||
705 | }; | 704 | }; |
706 | 705 | ||
707 | /* | 706 | /* |
707 | * Some ACPI registers have bits that must be ignored -- meaning that they | ||
708 | * must be preserved. | ||
709 | */ | ||
710 | #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ | ||
711 | #define ACPI_PM1_CONTROL_PRESERVED_BITS 0x0201 /* Bit 9, Bit 0 (SCI_EN) */ | ||
712 | |||
713 | /* | ||
708 | * Register IDs | 714 | * Register IDs |
709 | * These are the full ACPI registers | 715 | * These are the full ACPI registers |
710 | */ | 716 | */ |
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 38f9aa4bef00..192fa095a515 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -394,6 +394,8 @@ | |||
394 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) | 394 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) |
395 | #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) | 395 | #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) |
396 | 396 | ||
397 | #define ACPI_INSERT_BITS(target, mask, source) target = ((target & (~(mask))) | (source & mask)) | ||
398 | |||
397 | /* Generate a UUID */ | 399 | /* Generate a UUID */ |
398 | 400 | ||
399 | #define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ | 401 | #define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ |
@@ -722,9 +724,15 @@ | |||
722 | 724 | ||
723 | /* Memory allocation */ | 725 | /* Memory allocation */ |
724 | 726 | ||
727 | #ifndef ACPI_ALLOCATE | ||
725 | #define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) | 728 | #define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) |
729 | #endif | ||
730 | #ifndef ACPI_ALLOCATE_ZEROED | ||
726 | #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) | 731 | #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) |
727 | #define ACPI_FREE(a) acpi_os_free(a) | 732 | #endif |
733 | #ifndef ACPI_FREE | ||
734 | #define ACPI_FREE(a) acpio_os_free(a) | ||
735 | #endif | ||
728 | #define ACPI_MEM_TRACKING(a) | 736 | #define ACPI_MEM_TRACKING(a) |
729 | 737 | ||
730 | #else | 738 | #else |
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 1747d94084d8..8fdee31119f3 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h | |||
@@ -140,14 +140,14 @@ struct acpi_object_package { | |||
140 | *****************************************************************************/ | 140 | *****************************************************************************/ |
141 | 141 | ||
142 | struct acpi_object_event { | 142 | struct acpi_object_event { |
143 | ACPI_OBJECT_COMMON_HEADER void *semaphore; | 143 | ACPI_OBJECT_COMMON_HEADER acpi_semaphore os_semaphore; /* Actual OS synchronization object */ |
144 | }; | 144 | }; |
145 | 145 | ||
146 | struct acpi_object_mutex { | 146 | struct acpi_object_mutex { |
147 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ | 147 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ |
148 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ | 148 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ |
149 | struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ | 149 | struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ |
150 | void *semaphore; /* Actual OS synchronization object */ | 150 | acpi_mutex os_mutex; /* Actual OS synchronization object */ |
151 | union acpi_operand_object *prev; /* Link for list of acquired mutexes */ | 151 | union acpi_operand_object *prev; /* Link for list of acquired mutexes */ |
152 | union acpi_operand_object *next; /* Link for list of acquired mutexes */ | 152 | union acpi_operand_object *next; /* Link for list of acquired mutexes */ |
153 | struct acpi_namespace_node *node; /* Containing namespace node */ | 153 | struct acpi_namespace_node *node; /* Containing namespace node */ |
@@ -166,8 +166,8 @@ struct acpi_object_region { | |||
166 | struct acpi_object_method { | 166 | struct acpi_object_method { |
167 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; | 167 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; |
168 | u8 param_count; | 168 | u8 param_count; |
169 | u8 concurrency; | 169 | u8 sync_level; |
170 | void *semaphore; | 170 | union acpi_operand_object *mutex; |
171 | u8 *aml_start; | 171 | u8 *aml_start; |
172 | ACPI_INTERNAL_METHOD implementation; | 172 | ACPI_INTERNAL_METHOD implementation; |
173 | u32 aml_length; | 173 | u32 aml_length; |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index a2b3e390a503..f338e40bd544 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -334,7 +334,7 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, | |||
334 | acpi_handle handle, int type); | 334 | acpi_handle handle, int type); |
335 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); | 335 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); |
336 | int acpi_bus_start(struct acpi_device *device); | 336 | int acpi_bus_start(struct acpi_device *device); |
337 | 337 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd); | |
338 | int acpi_match_ids(struct acpi_device *device, char *ids); | 338 | int acpi_match_ids(struct acpi_device *device, char *ids); |
339 | int acpi_create_dir(struct acpi_device *); | 339 | int acpi_create_dir(struct acpi_device *); |
340 | void acpi_remove_dir(struct acpi_device *); | 340 | void acpi_remove_dir(struct acpi_device *); |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index b425f9bb6d43..6a5bdcefec64 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -110,4 +110,21 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type); | |||
110 | 110 | ||
111 | extern int acpi_specific_hotkey_enabled; | 111 | extern int acpi_specific_hotkey_enabled; |
112 | 112 | ||
113 | /*-------------------------------------------------------------------------- | ||
114 | Dock Station | ||
115 | -------------------------------------------------------------------------- */ | ||
116 | #if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) | ||
117 | extern int is_dock_device(acpi_handle handle); | ||
118 | extern int register_dock_notifier(struct notifier_block *nb); | ||
119 | extern void unregister_dock_notifier(struct notifier_block *nb); | ||
120 | extern int register_hotplug_dock_device(acpi_handle handle, | ||
121 | acpi_notify_handler handler, void *context); | ||
122 | extern void unregister_hotplug_dock_device(acpi_handle handle); | ||
123 | #else | ||
124 | #define is_dock_device(h) (0) | ||
125 | #define register_dock_notifier(nb) (-ENODEV) | ||
126 | #define unregister_dock_notifier(nb) do { } while(0) | ||
127 | #define register_hotplug_dock_device(h1, h2, c) (-ENODEV) | ||
128 | #define unregister_hotplug_dock_device(h) do { } while(0) | ||
129 | #endif | ||
113 | #endif /*__ACPI_DRIVERS_H__*/ | 130 | #endif /*__ACPI_DRIVERS_H__*/ |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 8f473c83b7c4..0cd63bce0ae4 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -96,33 +96,53 @@ acpi_os_table_override(struct acpi_table_header *existing_table, | |||
96 | struct acpi_table_header **new_table); | 96 | struct acpi_table_header **new_table); |
97 | 97 | ||
98 | /* | 98 | /* |
99 | * Synchronization primitives | 99 | * Spinlock primitives |
100 | */ | ||
101 | acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); | ||
102 | |||
103 | void acpi_os_delete_lock(acpi_spinlock handle); | ||
104 | |||
105 | acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); | ||
106 | |||
107 | void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags); | ||
108 | |||
109 | /* | ||
110 | * Semaphore primitives | ||
100 | */ | 111 | */ |
101 | acpi_status | 112 | acpi_status |
102 | acpi_os_create_semaphore(u32 max_units, | 113 | acpi_os_create_semaphore(u32 max_units, |
103 | u32 initial_units, acpi_handle * out_handle); | 114 | u32 initial_units, acpi_semaphore * out_handle); |
104 | 115 | ||
105 | acpi_status acpi_os_delete_semaphore(acpi_handle handle); | 116 | acpi_status acpi_os_delete_semaphore(acpi_semaphore handle); |
106 | 117 | ||
107 | acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout); | 118 | acpi_status |
119 | acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout); | ||
120 | |||
121 | acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units); | ||
122 | |||
123 | /* | ||
124 | * Mutex primitives | ||
125 | */ | ||
126 | acpi_status acpi_os_create_mutex(acpi_mutex * out_handle); | ||
108 | 127 | ||
109 | acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units); | 128 | void acpi_os_delete_mutex(acpi_mutex handle); |
110 | 129 | ||
111 | acpi_status acpi_os_create_lock(acpi_handle * out_handle); | 130 | acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout); |
112 | 131 | ||
113 | void acpi_os_delete_lock(acpi_handle handle); | 132 | void acpi_os_release_mutex(acpi_mutex handle); |
114 | 133 | ||
115 | acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle); | 134 | /* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */ |
116 | 135 | ||
117 | void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags); | 136 | #define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle) |
137 | #define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore (handle) | ||
138 | #define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time) | ||
139 | #define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore (handle, 1) | ||
118 | 140 | ||
119 | /* | 141 | /* |
120 | * Memory allocation and mapping | 142 | * Memory allocation and mapping |
121 | */ | 143 | */ |
122 | void *acpi_os_allocate(acpi_size size); | 144 | void *acpi_os_allocate(acpi_size size); |
123 | 145 | ||
124 | void acpi_os_free(void *memory); | ||
125 | |||
126 | acpi_status | 146 | acpi_status |
127 | acpi_os_map_memory(acpi_physical_address physical_address, | 147 | acpi_os_map_memory(acpi_physical_address physical_address, |
128 | acpi_size size, void __iomem ** logical_address); | 148 | acpi_size size, void __iomem ** logical_address); |
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index ad11fc13fbef..80a3b33571b4 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h | |||
@@ -50,9 +50,13 @@ | |||
50 | 50 | ||
51 | /* | 51 | /* |
52 | * If possible, pack the following structures to byte alignment, since we | 52 | * If possible, pack the following structures to byte alignment, since we |
53 | * don't care about performance for debug output | 53 | * don't care about performance for debug output. Two cases where we cannot |
54 | * pack the structures: | ||
55 | * | ||
56 | * 1) Hardware does not support misaligned memory transfers | ||
57 | * 2) Compiler does not support pointers within packed structures | ||
54 | */ | 58 | */ |
55 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | 59 | #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED)) |
56 | #pragma pack(1) | 60 | #pragma pack(1) |
57 | #endif | 61 | #endif |
58 | 62 | ||
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 77cf1236b05a..64b603cfe92e 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -241,7 +241,7 @@ typedef acpi_native_uint acpi_size; | |||
241 | 241 | ||
242 | /******************************************************************************* | 242 | /******************************************************************************* |
243 | * | 243 | * |
244 | * OS- or compiler-dependent types | 244 | * OS-dependent and compiler-dependent types |
245 | * | 245 | * |
246 | * If the defaults below are not appropriate for the host system, they can | 246 | * If the defaults below are not appropriate for the host system, they can |
247 | * be defined in the compiler-specific or OS-specific header, and this will | 247 | * be defined in the compiler-specific or OS-specific header, and this will |
@@ -249,29 +249,36 @@ typedef acpi_native_uint acpi_size; | |||
249 | * | 249 | * |
250 | ******************************************************************************/ | 250 | ******************************************************************************/ |
251 | 251 | ||
252 | /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ | 252 | /* Value returned by acpi_os_get_thread_id */ |
253 | 253 | ||
254 | #ifndef acpi_uintptr_t | 254 | #ifndef acpi_thread_id |
255 | #define acpi_uintptr_t void * | 255 | #define acpi_thread_id acpi_native_uint |
256 | #endif | 256 | #endif |
257 | 257 | ||
258 | /* | 258 | /* Object returned from acpi_os_create_lock */ |
259 | * If acpi_cache_t was not defined in the OS-dependent header, | 259 | |
260 | * define it now. This is typically the case where the local cache | 260 | #ifndef acpi_spinlock |
261 | * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) | 261 | #define acpi_spinlock void * |
262 | */ | ||
263 | #ifndef acpi_cache_t | ||
264 | #define acpi_cache_t struct acpi_memory_list | ||
265 | #endif | 262 | #endif |
266 | 263 | ||
267 | /* | 264 | /* Flags for acpi_os_acquire_lock/acpi_os_release_lock */ |
268 | * Allow the CPU flags word to be defined per-OS to simplify the use of the | 265 | |
269 | * lock and unlock OSL interfaces. | ||
270 | */ | ||
271 | #ifndef acpi_cpu_flags | 266 | #ifndef acpi_cpu_flags |
272 | #define acpi_cpu_flags acpi_native_uint | 267 | #define acpi_cpu_flags acpi_native_uint |
273 | #endif | 268 | #endif |
274 | 269 | ||
270 | /* Object returned from acpi_os_create_cache */ | ||
271 | |||
272 | #ifndef acpi_cache_t | ||
273 | #define acpi_cache_t struct acpi_memory_list | ||
274 | #endif | ||
275 | |||
276 | /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ | ||
277 | |||
278 | #ifndef acpi_uintptr_t | ||
279 | #define acpi_uintptr_t void * | ||
280 | #endif | ||
281 | |||
275 | /* | 282 | /* |
276 | * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because | 283 | * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because |
277 | * some compilers can catch printf format string problems | 284 | * some compilers can catch printf format string problems |
@@ -298,13 +305,6 @@ typedef acpi_native_uint acpi_size; | |||
298 | #define ACPI_EXPORT_SYMBOL(symbol) | 305 | #define ACPI_EXPORT_SYMBOL(symbol) |
299 | #endif | 306 | #endif |
300 | 307 | ||
301 | /* | ||
302 | * thread_id is returned by acpi_os_get_thread_id. | ||
303 | */ | ||
304 | #ifndef acpi_thread_id | ||
305 | #define acpi_thread_id acpi_native_uint | ||
306 | #endif | ||
307 | |||
308 | /******************************************************************************* | 308 | /******************************************************************************* |
309 | * | 309 | * |
310 | * Independent types | 310 | * Independent types |
@@ -380,6 +380,11 @@ struct uint32_struct { | |||
380 | u32 hi; | 380 | u32 hi; |
381 | }; | 381 | }; |
382 | 382 | ||
383 | /* Synchronization objects */ | ||
384 | |||
385 | #define acpi_mutex void * | ||
386 | #define acpi_semaphore void * | ||
387 | |||
383 | /* | 388 | /* |
384 | * Acpi integer width. In ACPI version 1, integers are | 389 | * Acpi integer width. In ACPI version 1, integers are |
385 | * 32 bits. In ACPI version 2, integers are 64 bits. | 390 | * 32 bits. In ACPI version 2, integers are 64 bits. |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 277d35bced03..47faf27913a5 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -58,11 +58,14 @@ | |||
58 | #include <asm/div64.h> | 58 | #include <asm/div64.h> |
59 | #include <asm/acpi.h> | 59 | #include <asm/acpi.h> |
60 | #include <linux/slab.h> | 60 | #include <linux/slab.h> |
61 | #include <linux/spinlock_types.h> | ||
62 | #include <asm/current.h> | ||
61 | 63 | ||
62 | /* Host-dependent types and defines */ | 64 | /* Host-dependent types and defines */ |
63 | 65 | ||
64 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG | 66 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG |
65 | #define acpi_cache_t kmem_cache_t | 67 | #define acpi_cache_t kmem_cache_t |
68 | #define acpi_spinlock spinlock_t * | ||
66 | #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); | 69 | #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); |
67 | #define strtoul simple_strtoul | 70 | #define strtoul simple_strtoul |
68 | 71 | ||
@@ -98,8 +101,30 @@ | |||
98 | 101 | ||
99 | #define acpi_cpu_flags unsigned long | 102 | #define acpi_cpu_flags unsigned long |
100 | 103 | ||
101 | #define acpi_thread_id u32 | 104 | #define acpi_thread_id struct task_struct * |
102 | 105 | ||
103 | static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } | 106 | static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; } |
107 | |||
108 | /* | ||
109 | * The irqs_disabled() check is for resume from RAM. | ||
110 | * Interrupts are off during resume, just like they are for boot. | ||
111 | * However, boot has (system_state != SYSTEM_RUNNING) | ||
112 | * to quiet __might_sleep() in kmalloc() and resume does not. | ||
113 | */ | ||
114 | #include <acpi/actypes.h> | ||
115 | static inline void *acpi_os_allocate(acpi_size size) { | ||
116 | return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); | ||
117 | } | ||
118 | static inline void *acpi_os_allocate_zeroed(acpi_size size) { | ||
119 | return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); | ||
120 | } | ||
121 | |||
122 | static inline void *acpi_os_acquire_object(acpi_cache_t * cache) { | ||
123 | return kmem_cache_zalloc(cache, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); | ||
124 | } | ||
125 | |||
126 | #define ACPI_ALLOCATE(a) acpi_os_allocate(a) | ||
127 | #define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) | ||
128 | #define ACPI_FREE(a) kfree(a) | ||
104 | 129 | ||
105 | #endif /* __ACLINUX_H__ */ | 130 | #endif /* __ACLINUX_H__ */ |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 77371b3cdc44..9dd5b75961f8 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -62,6 +62,7 @@ struct acpi_processor_cx { | |||
62 | u32 latency_ticks; | 62 | u32 latency_ticks; |
63 | u32 power; | 63 | u32 power; |
64 | u32 usage; | 64 | u32 usage; |
65 | u64 time; | ||
65 | struct acpi_processor_cx_policy promotion; | 66 | struct acpi_processor_cx_policy promotion; |
66 | struct acpi_processor_cx_policy demotion; | 67 | struct acpi_processor_cx_policy demotion; |
67 | }; | 68 | }; |
diff --git a/include/asm-alpha/Kbuild b/include/asm-alpha/Kbuild new file mode 100644 index 000000000000..e57fd57538b8 --- /dev/null +++ b/include/asm-alpha/Kbuild | |||
@@ -0,0 +1,5 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | unifdef-y += console.h fpu.h sysinfo.h | ||
4 | |||
5 | header-y += gentrap.h regdef.h pal.h reg.h | ||
diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h index 21816d35ef89..6a9f02af9529 100644 --- a/include/asm-alpha/floppy.h +++ b/include/asm-alpha/floppy.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) | 26 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) |
27 | #define fd_cacheflush(addr,size) /* nothing */ | 27 | #define fd_cacheflush(addr,size) /* nothing */ |
28 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\ | 28 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\ |
29 | SA_INTERRUPT, "floppy", NULL) | 29 | IRQF_DISABLED, "floppy", NULL) |
30 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); | 30 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); |
31 | 31 | ||
32 | #ifdef CONFIG_PCI | 32 | #ifdef CONFIG_PCI |
diff --git a/include/asm-alpha/hw_irq.h b/include/asm-alpha/hw_irq.h index ca9d43b63502..a37db0f95092 100644 --- a/include/asm-alpha/hw_irq.h +++ b/include/asm-alpha/hw_irq.h | |||
@@ -2,8 +2,6 @@ | |||
2 | #define _ALPHA_HW_IRQ_H | 2 | #define _ALPHA_HW_IRQ_H |
3 | 3 | ||
4 | 4 | ||
5 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
6 | |||
7 | extern volatile unsigned long irq_err_count; | 5 | extern volatile unsigned long irq_err_count; |
8 | 6 | ||
9 | #ifdef CONFIG_ALPHA_GENERIC | 7 | #ifdef CONFIG_ALPHA_GENERIC |
diff --git a/include/asm-alpha/rwsem.h b/include/asm-alpha/rwsem.h index fafdd4f7010a..1570c0b54336 100644 --- a/include/asm-alpha/rwsem.h +++ b/include/asm-alpha/rwsem.h | |||
@@ -36,20 +36,11 @@ struct rw_semaphore { | |||
36 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 36 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
37 | spinlock_t wait_lock; | 37 | spinlock_t wait_lock; |
38 | struct list_head wait_list; | 38 | struct list_head wait_list; |
39 | #if RWSEM_DEBUG | ||
40 | int debug; | ||
41 | #endif | ||
42 | }; | 39 | }; |
43 | 40 | ||
44 | #if RWSEM_DEBUG | ||
45 | #define __RWSEM_DEBUG_INIT , 0 | ||
46 | #else | ||
47 | #define __RWSEM_DEBUG_INIT /* */ | ||
48 | #endif | ||
49 | |||
50 | #define __RWSEM_INITIALIZER(name) \ | 41 | #define __RWSEM_INITIALIZER(name) \ |
51 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | 42 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ |
52 | LIST_HEAD_INIT((name).wait_list) __RWSEM_DEBUG_INIT } | 43 | LIST_HEAD_INIT((name).wait_list) } |
53 | 44 | ||
54 | #define DECLARE_RWSEM(name) \ | 45 | #define DECLARE_RWSEM(name) \ |
55 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 46 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
@@ -59,9 +50,6 @@ static inline void init_rwsem(struct rw_semaphore *sem) | |||
59 | sem->count = RWSEM_UNLOCKED_VALUE; | 50 | sem->count = RWSEM_UNLOCKED_VALUE; |
60 | spin_lock_init(&sem->wait_lock); | 51 | spin_lock_init(&sem->wait_lock); |
61 | INIT_LIST_HEAD(&sem->wait_list); | 52 | INIT_LIST_HEAD(&sem->wait_list); |
62 | #if RWSEM_DEBUG | ||
63 | sem->debug = 0; | ||
64 | #endif | ||
65 | } | 53 | } |
66 | 54 | ||
67 | static inline void __down_read(struct rw_semaphore *sem) | 55 | static inline void __down_read(struct rw_semaphore *sem) |
diff --git a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h index 1a2c52a056fb..13c2305d35ef 100644 --- a/include/asm-alpha/signal.h +++ b/include/asm-alpha/signal.h | |||
@@ -77,7 +77,6 @@ typedef unsigned long sigset_t; | |||
77 | * SA_FLAGS values: | 77 | * SA_FLAGS values: |
78 | * | 78 | * |
79 | * SA_ONSTACK indicates that a registered stack_t will be used. | 79 | * SA_ONSTACK indicates that a registered stack_t will be used. |
80 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
81 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 80 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
82 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 81 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
83 | * SA_RESETHAND clears the handler when the signal is delivered. | 82 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -98,7 +97,6 @@ typedef unsigned long sigset_t; | |||
98 | 97 | ||
99 | #define SA_ONESHOT SA_RESETHAND | 98 | #define SA_ONESHOT SA_RESETHAND |
100 | #define SA_NOMASK SA_NODEFER | 99 | #define SA_NOMASK SA_NODEFER |
101 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
102 | 100 | ||
103 | /* | 101 | /* |
104 | * sigaltstack controls | 102 | * sigaltstack controls |
diff --git a/include/asm-alpha/socket.h b/include/asm-alpha/socket.h index b5193229132a..d22ab97ea72e 100644 --- a/include/asm-alpha/socket.h +++ b/include/asm-alpha/socket.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #define SCM_TIMESTAMP SO_TIMESTAMP | 51 | #define SCM_TIMESTAMP SO_TIMESTAMP |
52 | 52 | ||
53 | #define SO_PEERSEC 30 | 53 | #define SO_PEERSEC 30 |
54 | #define SO_PASSSEC 34 | ||
54 | 55 | ||
55 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 56 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
56 | #define SO_SECURITY_AUTHENTICATION 19 | 57 | #define SO_SECURITY_AUTHENTICATION 19 |
diff --git a/include/asm-arm/Kbuild b/include/asm-arm/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-arm/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91rm9200/board.h index 1fdd70b23809..c1ca9a4658ec 100644 --- a/include/asm-arm/arch-at91rm9200/board.h +++ b/include/asm-arm/arch-at91rm9200/board.h | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | /* | 21 | /* |
22 | * These are data structures found in platform_device.dev.platform_data, | 22 | * These are data structures found in platform_device.dev.platform_data, |
23 | * and describing board-specfic data needed by drivers. For example, | 23 | * and describing board-specific data needed by drivers. For example, |
24 | * which pin is used for a given GPIO role. | 24 | * which pin is used for a given GPIO role. |
25 | * | 25 | * |
26 | * In 2.6, drivers should strongly avoid board-specific knowledge so | 26 | * In 2.6, drivers should strongly avoid board-specific knowledge so |
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h index 2dc93b174a8f..f63842c2c093 100644 --- a/include/asm-arm/arch-at91rm9200/irqs.h +++ b/include/asm-arm/arch-at91rm9200/irqs.h | |||
@@ -39,12 +39,4 @@ | |||
39 | */ | 39 | */ |
40 | #define NR_IRQS (NR_AIC_IRQS + (4 * 32)) | 40 | #define NR_IRQS (NR_AIC_IRQS + (4 * 32)) |
41 | 41 | ||
42 | |||
43 | #ifndef __ASSEMBLY__ | ||
44 | /* | ||
45 | * Initialize the IRQ controller. | ||
46 | */ | ||
47 | extern void at91rm9200_init_irq(unsigned int priority[]); | ||
48 | #endif | ||
49 | |||
50 | #endif | 42 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/memory.h b/include/asm-arm/arch-at91rm9200/memory.h index 3c327c404373..f985069e6d01 100644 --- a/include/asm-arm/arch-at91rm9200/memory.h +++ b/include/asm-arm/arch-at91rm9200/memory.h | |||
@@ -33,9 +33,7 @@ | |||
33 | * bus_to_virt: Used to convert an address for DMA operations | 33 | * bus_to_virt: Used to convert an address for DMA operations |
34 | * to an address that the kernel can use. | 34 | * to an address that the kernel can use. |
35 | */ | 35 | */ |
36 | #define __virt_to_bus__is_a_macro | ||
37 | #define __virt_to_bus(x) __virt_to_phys(x) | 36 | #define __virt_to_bus(x) __virt_to_phys(x) |
38 | #define __bus_to_virt__is_a_macro | ||
39 | #define __bus_to_virt(x) __phys_to_virt(x) | 37 | #define __bus_to_virt(x) __phys_to_virt(x) |
40 | 38 | ||
41 | #endif | 39 | #endif |
diff --git a/include/asm-arm/arch-h720x/memory.h b/include/asm-arm/arch-h720x/memory.h index 4a1bfd78a0fe..53e923dba76e 100644 --- a/include/asm-arm/arch-h720x/memory.h +++ b/include/asm-arm/arch-h720x/memory.h | |||
@@ -23,9 +23,7 @@ | |||
23 | * There is something to do here later !, Mar 2000, Jungjun Kim | 23 | * There is something to do here later !, Mar 2000, Jungjun Kim |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define __virt_to_bus__is_a_macro | ||
27 | #define __virt_to_bus(x) __virt_to_phys(x) | 26 | #define __virt_to_bus(x) __virt_to_phys(x) |
28 | #define __bus_to_virt__is_a_macro | ||
29 | #define __bus_to_virt(x) __phys_to_virt(x) | 27 | #define __bus_to_virt(x) __phys_to_virt(x) |
30 | 28 | ||
31 | #endif | 29 | #endif |
diff --git a/include/asm-arm/arch-imx/memory.h b/include/asm-arm/arch-imx/memory.h index d09ae32cd2f4..5ad90127915f 100644 --- a/include/asm-arm/arch-imx/memory.h +++ b/include/asm-arm/arch-imx/memory.h | |||
@@ -30,9 +30,7 @@ | |||
30 | * bus_to_virt: Used to convert an address for DMA operations | 30 | * bus_to_virt: Used to convert an address for DMA operations |
31 | * to an address that the kernel can use. | 31 | * to an address that the kernel can use. |
32 | */ | 32 | */ |
33 | #define __virt_to_bus__is_a_macro | 33 | #define __virt_to_bus(x) (x - PAGE_OFFSET + PHYS_OFFSET) |
34 | #define __virt_to_bus(x) (x - PAGE_OFFSET + PHYS_OFFSET) | 34 | #define __bus_to_virt(x) (x - PHYS_OFFSET + PAGE_OFFSET) |
35 | #define __bus_to_virt__is_a_macro | ||
36 | #define __bus_to_virt(x) (x - PHYS_OFFSET + PAGE_OFFSET) | ||
37 | 35 | ||
38 | #endif | 36 | #endif |
diff --git a/include/asm-arm/arch-ixp23xx/ixp23xx.h b/include/asm-arm/arch-ixp23xx/ixp23xx.h index d0a72201ee96..3927b1d61b17 100644 --- a/include/asm-arm/arch-ixp23xx/ixp23xx.h +++ b/include/asm-arm/arch-ixp23xx/ixp23xx.h | |||
@@ -295,15 +295,4 @@ | |||
295 | #define IXP23XX_PCI_CPP_ADDR_BITS IXP23XX_PCI_CSR(0x0160) | 295 | #define IXP23XX_PCI_CPP_ADDR_BITS IXP23XX_PCI_CSR(0x0160) |
296 | 296 | ||
297 | 297 | ||
298 | #ifndef __ASSEMBLY__ | ||
299 | /* | ||
300 | * Is system memory on the XSI or CPP bus? | ||
301 | */ | ||
302 | static inline unsigned ixp23xx_cpp_boot(void) | ||
303 | { | ||
304 | return (*IXP23XX_EXP_CFG0 & IXP23XX_EXP_CFG0_XSI_NOT_PRES); | ||
305 | } | ||
306 | #endif | ||
307 | |||
308 | |||
309 | #endif | 298 | #endif |
diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h index 19a73b39c864..56e16d66645a 100644 --- a/include/asm-arm/arch-ixp23xx/platform.h +++ b/include/asm-arm/arch-ixp23xx/platform.h | |||
@@ -43,5 +43,15 @@ extern struct sys_timer ixp23xx_timer; | |||
43 | 43 | ||
44 | #define IXP23XX_UART_XTAL 14745600 | 44 | #define IXP23XX_UART_XTAL 14745600 |
45 | 45 | ||
46 | #ifndef __ASSEMBLY__ | ||
47 | /* | ||
48 | * Is system memory on the XSI or CPP bus? | ||
49 | */ | ||
50 | static inline unsigned ixp23xx_cpp_boot(void) | ||
51 | { | ||
52 | return (*IXP23XX_EXP_CFG0 & IXP23XX_EXP_CFG0_XSI_NOT_PRES); | ||
53 | } | ||
54 | #endif | ||
55 | |||
46 | 56 | ||
47 | #endif | 57 | #endif |
diff --git a/include/asm-arm/arch-ixp23xx/uncompress.h b/include/asm-arm/arch-ixp23xx/uncompress.h index 013575e6a9a1..16c1110f2304 100644 --- a/include/asm-arm/arch-ixp23xx/uncompress.h +++ b/include/asm-arm/arch-ixp23xx/uncompress.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #ifndef __ASM_ARCH_UNCOMPRESS_H | 11 | #ifndef __ASM_ARCH_UNCOMPRESS_H |
12 | #define __ASM_ARCH_UNCOMPRESS_H | 12 | #define __ASM_ARCH_UNCOMPRESS_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | 14 | #include <asm/arch/ixp23xx.h> |
15 | #include <linux/serial_reg.h> | 15 | #include <linux/serial_reg.h> |
16 | 16 | ||
17 | #define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS) | 17 | #define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS) |
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index b59520e56fc7..0d517267fb63 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h | |||
@@ -38,7 +38,7 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data); | |||
38 | * 2) If > 64MB of memory space is required, the IXP4xx can be configured | 38 | * 2) If > 64MB of memory space is required, the IXP4xx can be configured |
39 | * to use indirect registers to access PCI (as we do below for I/O | 39 | * to use indirect registers to access PCI (as we do below for I/O |
40 | * transactions). This allows for up to 128MB (0x48000000 to 0x4fffffff) | 40 | * transactions). This allows for up to 128MB (0x48000000 to 0x4fffffff) |
41 | * of memory on the bus. The disadvantadge of this is that every | 41 | * of memory on the bus. The disadvantage of this is that every |
42 | * PCI access requires three local register accesses plus a spinlock, | 42 | * PCI access requires three local register accesses plus a spinlock, |
43 | * but in some cases the performance hit is acceptable. In addition, | 43 | * but in some cases the performance hit is acceptable. In addition, |
44 | * you cannot mmap() PCI devices in this case. | 44 | * you cannot mmap() PCI devices in this case. |
diff --git a/include/asm-arm/arch-omap/board-fsample.h b/include/asm-arm/arch-omap/board-fsample.h new file mode 100644 index 000000000000..89a1e529fb6f --- /dev/null +++ b/include/asm-arm/arch-omap/board-fsample.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/board-fsample.h | ||
3 | * | ||
4 | * Board-specific goodies for TI F-Sample. | ||
5 | * | ||
6 | * Copyright (C) 2006 Google, Inc. | ||
7 | * Author: Brian Swetland <swetland@google.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_OMAP_FSAMPLE_H | ||
15 | #define __ASM_ARCH_OMAP_FSAMPLE_H | ||
16 | |||
17 | /* fsample is pretty close to p2-sample */ | ||
18 | #include <asm/arch/board-perseus2.h> | ||
19 | |||
20 | #define fsample_cpld_read(reg) __raw_readb(reg) | ||
21 | #define fsample_cpld_write(val, reg) __raw_writeb(val, reg) | ||
22 | |||
23 | #define FSAMPLE_CPLD_BASE 0xE8100000 | ||
24 | #define FSAMPLE_CPLD_SIZE SZ_4K | ||
25 | #define FSAMPLE_CPLD_START 0x05080000 | ||
26 | |||
27 | #define FSAMPLE_CPLD_REG_A (FSAMPLE_CPLD_BASE + 0x00) | ||
28 | #define FSAMPLE_CPLD_SWITCH (FSAMPLE_CPLD_BASE + 0x02) | ||
29 | #define FSAMPLE_CPLD_UART (FSAMPLE_CPLD_BASE + 0x02) | ||
30 | #define FSAMPLE_CPLD_REG_B (FSAMPLE_CPLD_BASE + 0x04) | ||
31 | #define FSAMPLE_CPLD_VERSION (FSAMPLE_CPLD_BASE + 0x06) | ||
32 | #define FSAMPLE_CPLD_SET_CLR (FSAMPLE_CPLD_BASE + 0x06) | ||
33 | |||
34 | #define FSAMPLE_CPLD_BIT_BT_RESET 0 | ||
35 | #define FSAMPLE_CPLD_BIT_LCD_RESET 1 | ||
36 | #define FSAMPLE_CPLD_BIT_CAM_PWDN 2 | ||
37 | #define FSAMPLE_CPLD_BIT_CHARGER_ENABLE 3 | ||
38 | #define FSAMPLE_CPLD_BIT_SD_MMC_EN 4 | ||
39 | #define FSAMPLE_CPLD_BIT_aGPS_PWREN 5 | ||
40 | #define FSAMPLE_CPLD_BIT_BACKLIGHT 6 | ||
41 | #define FSAMPLE_CPLD_BIT_aGPS_EN_RESET 7 | ||
42 | #define FSAMPLE_CPLD_BIT_aGPS_SLEEPx_N 8 | ||
43 | #define FSAMPLE_CPLD_BIT_OTG_RESET 9 | ||
44 | |||
45 | #define fsample_cpld_set(bit) \ | ||
46 | fsample_cpld_write((((bit) & 15) << 4) | 0x0f, FSAMPLE_CPLD_SET_CLR) | ||
47 | |||
48 | #define fsample_cpld_clear(bit) \ | ||
49 | fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) | ||
50 | |||
51 | #endif | ||
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h index dfdbf06fd646..edf1dc6ad919 100644 --- a/include/asm-arm/arch-omap/board.h +++ b/include/asm-arm/arch-omap/board.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define OMAP_TAG_UART 0x4f07 | 22 | #define OMAP_TAG_UART 0x4f07 |
23 | #define OMAP_TAG_FBMEM 0x4f08 | 23 | #define OMAP_TAG_FBMEM 0x4f08 |
24 | #define OMAP_TAG_STI_CONSOLE 0x4f09 | 24 | #define OMAP_TAG_STI_CONSOLE 0x4f09 |
25 | #define OMAP_TAG_CAMERA_SENSOR 0x4f0a | ||
25 | 26 | ||
26 | #define OMAP_TAG_BOOT_REASON 0x4f80 | 27 | #define OMAP_TAG_BOOT_REASON 0x4f80 |
27 | #define OMAP_TAG_FLASH_PART 0x4f81 | 28 | #define OMAP_TAG_FLASH_PART 0x4f81 |
@@ -61,6 +62,12 @@ struct omap_sti_console_config { | |||
61 | u8 channel; | 62 | u8 channel; |
62 | }; | 63 | }; |
63 | 64 | ||
65 | struct omap_camera_sensor_config { | ||
66 | u16 reset_gpio; | ||
67 | int (*power_on)(void * data); | ||
68 | int (*power_off)(void * data); | ||
69 | }; | ||
70 | |||
64 | struct omap_usb_config { | 71 | struct omap_usb_config { |
65 | /* Configure drivers according to the connectors on your board: | 72 | /* Configure drivers according to the connectors on your board: |
66 | * - "A" connector (rectagular) | 73 | * - "A" connector (rectagular) |
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index ca1202312a45..1b1b02307e77 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h | |||
@@ -185,8 +185,8 @@ | |||
185 | /* DMA channels for 24xx */ | 185 | /* DMA channels for 24xx */ |
186 | #define OMAP24XX_DMA_NO_DEVICE 0 | 186 | #define OMAP24XX_DMA_NO_DEVICE 0 |
187 | #define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */ | 187 | #define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */ |
188 | #define OMAP24XX_DMA_EXT_NDMA_REQ0 2 /* S_DMA_1 */ | 188 | #define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */ |
189 | #define OMAP24XX_DMA_EXT_NDMA_REQ1 3 /* S_DMA_2 */ | 189 | #define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */ |
190 | #define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */ | 190 | #define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */ |
191 | #define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */ | 191 | #define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */ |
192 | #define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */ | 192 | #define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */ |
@@ -197,7 +197,9 @@ | |||
197 | #define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */ | 197 | #define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */ |
198 | #define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */ | 198 | #define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */ |
199 | #define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */ | 199 | #define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */ |
200 | 200 | #define OMAP24XX_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */ | |
201 | #define OMAP24XX_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */ | ||
202 | #define OMAP24XX_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */ | ||
201 | #define OMAP24XX_DMA_EAC_AC_RD 17 /* S_DMA_16 */ | 203 | #define OMAP24XX_DMA_EAC_AC_RD 17 /* S_DMA_16 */ |
202 | #define OMAP24XX_DMA_EAC_AC_WR 18 /* S_DMA_17 */ | 204 | #define OMAP24XX_DMA_EAC_AC_WR 18 /* S_DMA_17 */ |
203 | #define OMAP24XX_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */ | 205 | #define OMAP24XX_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */ |
@@ -244,6 +246,7 @@ | |||
244 | #define OMAP24XX_DMA_MMC1_TX 61 /* SDMA_60 */ | 246 | #define OMAP24XX_DMA_MMC1_TX 61 /* SDMA_60 */ |
245 | #define OMAP24XX_DMA_MMC1_RX 62 /* SDMA_61 */ | 247 | #define OMAP24XX_DMA_MMC1_RX 62 /* SDMA_61 */ |
246 | #define OMAP24XX_DMA_MS 63 /* SDMA_62 */ | 248 | #define OMAP24XX_DMA_MS 63 /* SDMA_62 */ |
249 | #define OMAP24XX_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */ | ||
247 | 250 | ||
248 | /*----------------------------------------------------------------------------*/ | 251 | /*----------------------------------------------------------------------------*/ |
249 | 252 | ||
@@ -274,7 +277,7 @@ | |||
274 | #define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea) | 277 | #define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea) |
275 | #define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4) | 278 | #define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4) |
276 | 279 | ||
277 | #define OMAP_DMA_TOUT_IRQ (1 << 0) /* Only on omap1 */ | 280 | #define OMAP1_DMA_TOUT_IRQ (1 << 0) |
278 | #define OMAP_DMA_DROP_IRQ (1 << 1) | 281 | #define OMAP_DMA_DROP_IRQ (1 << 1) |
279 | #define OMAP_DMA_HALF_IRQ (1 << 2) | 282 | #define OMAP_DMA_HALF_IRQ (1 << 2) |
280 | #define OMAP_DMA_FRAME_IRQ (1 << 3) | 283 | #define OMAP_DMA_FRAME_IRQ (1 << 3) |
@@ -315,11 +318,11 @@ enum { | |||
315 | OMAP_LCD_DMA_B2_BOTTOM | 318 | OMAP_LCD_DMA_B2_BOTTOM |
316 | }; | 319 | }; |
317 | 320 | ||
318 | /* REVISIT: Check if BURST_4 is really 1 (or 2) */ | ||
319 | enum omap_dma_burst_mode { | 321 | enum omap_dma_burst_mode { |
320 | OMAP_DMA_DATA_BURST_DIS = 0, | 322 | OMAP_DMA_DATA_BURST_DIS = 0, |
321 | OMAP_DMA_DATA_BURST_4, | 323 | OMAP_DMA_DATA_BURST_4, |
322 | OMAP_DMA_DATA_BURST_8 | 324 | OMAP_DMA_DATA_BURST_8, |
325 | OMAP_DMA_DATA_BURST_16, | ||
323 | }; | 326 | }; |
324 | 327 | ||
325 | enum omap_dma_color_mode { | 328 | enum omap_dma_color_mode { |
diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h index e6522e6a3834..7a289ff07404 100644 --- a/include/asm-arm/arch-omap/dmtimer.h +++ b/include/asm-arm/arch-omap/dmtimer.h | |||
@@ -5,6 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2005 Nokia Corporation | 6 | * Copyright (C) 2005 Nokia Corporation |
7 | * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com> | 7 | * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com> |
8 | * PWM and clock framwork support by Timo Teras. | ||
8 | * | 9 | * |
9 | * This program is free software; you can redistribute it and/or modify it | 10 | * This program is free software; you can redistribute it and/or modify it |
10 | * under the terms of the GNU General Public License as published by the | 11 | * under the terms of the GNU General Public License as published by the |
@@ -25,69 +26,56 @@ | |||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | */ | 27 | */ |
27 | 28 | ||
28 | #ifndef __ASM_ARCH_TIMER_H | 29 | #ifndef __ASM_ARCH_DMTIMER_H |
29 | #define __ASM_ARCH_TIMER_H | 30 | #define __ASM_ARCH_DMTIMER_H |
30 | |||
31 | #include <linux/list.h> | ||
32 | |||
33 | #define OMAP_TIMER_SRC_ARMXOR 0x00 | ||
34 | #define OMAP_TIMER_SRC_32_KHZ 0x01 | ||
35 | #define OMAP_TIMER_SRC_EXT_CLK 0x02 | ||
36 | |||
37 | /* timer control reg bits */ | ||
38 | #define OMAP_TIMER_CTRL_CAPTMODE (1 << 13) | ||
39 | #define OMAP_TIMER_CTRL_PT (1 << 12) | ||
40 | #define OMAP_TIMER_CTRL_TRG_OVERFLOW (0x1 << 10) | ||
41 | #define OMAP_TIMER_CTRL_TRG_OFANDMATCH (0x2 << 10) | ||
42 | #define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8) | ||
43 | #define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8) | ||
44 | #define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8) | ||
45 | #define OMAP_TIMER_CTRL_SCPWM (1 << 7) | ||
46 | #define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */ | ||
47 | #define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */ | ||
48 | #define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* how much to shift the prescaler value */ | ||
49 | #define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */ | ||
50 | #define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */ | ||
51 | 31 | ||
52 | /* timer interrupt enable bits */ | 32 | /* clock sources */ |
53 | #define OMAP_TIMER_INT_CAPTURE (1 << 2) | 33 | #define OMAP_TIMER_SRC_SYS_CLK 0x00 |
54 | #define OMAP_TIMER_INT_OVERFLOW (1 << 1) | 34 | #define OMAP_TIMER_SRC_32_KHZ 0x01 |
55 | #define OMAP_TIMER_INT_MATCH (1 << 0) | 35 | #define OMAP_TIMER_SRC_EXT_CLK 0x02 |
56 | 36 | ||
37 | /* timer interrupt enable bits */ | ||
38 | #define OMAP_TIMER_INT_CAPTURE (1 << 2) | ||
39 | #define OMAP_TIMER_INT_OVERFLOW (1 << 1) | ||
40 | #define OMAP_TIMER_INT_MATCH (1 << 0) | ||
57 | 41 | ||
58 | struct omap_dm_timer { | 42 | /* trigger types */ |
59 | struct list_head timer_list; | 43 | #define OMAP_TIMER_TRIGGER_NONE 0x00 |
44 | #define OMAP_TIMER_TRIGGER_OVERFLOW 0x01 | ||
45 | #define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02 | ||
60 | 46 | ||
61 | u32 base; | 47 | struct omap_dm_timer; |
62 | unsigned int irq; | 48 | struct clk; |
63 | }; | ||
64 | 49 | ||
65 | u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg); | 50 | int omap_dm_timer_init(void); |
66 | void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value); | ||
67 | 51 | ||
68 | struct omap_dm_timer * omap_dm_timer_request(void); | 52 | struct omap_dm_timer *omap_dm_timer_request(void); |
53 | struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); | ||
69 | void omap_dm_timer_free(struct omap_dm_timer *timer); | 54 | void omap_dm_timer_free(struct omap_dm_timer *timer); |
70 | void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); | ||
71 | 55 | ||
72 | void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value); | 56 | int omap_dm_timer_get_irq(struct omap_dm_timer *timer); |
73 | void omap_dm_timer_set_trigger(struct omap_dm_timer *timer, unsigned int value); | 57 | |
74 | void omap_dm_timer_enable_compare(struct omap_dm_timer *timer); | 58 | u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); |
75 | void omap_dm_timer_enable_autoreload(struct omap_dm_timer *timer); | 59 | struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer); |
76 | 60 | ||
77 | void omap_dm_timer_trigger(struct omap_dm_timer *timer); | 61 | void omap_dm_timer_trigger(struct omap_dm_timer *timer); |
78 | void omap_dm_timer_start(struct omap_dm_timer *timer); | 62 | void omap_dm_timer_start(struct omap_dm_timer *timer); |
79 | void omap_dm_timer_stop(struct omap_dm_timer *timer); | 63 | void omap_dm_timer_stop(struct omap_dm_timer *timer); |
80 | 64 | ||
81 | void omap_dm_timer_set_load(struct omap_dm_timer *timer, unsigned int load); | 65 | void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); |
82 | void omap_dm_timer_set_match(struct omap_dm_timer *timer, unsigned int match); | 66 | void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value); |
67 | void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match); | ||
68 | void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, int toggle, int trigger); | ||
69 | void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler); | ||
70 | |||
71 | void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value); | ||
83 | 72 | ||
84 | unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer); | 73 | unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer); |
85 | void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value); | 74 | void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value); |
86 | |||
87 | unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); | 75 | unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); |
88 | void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); | 76 | void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value); |
89 | 77 | ||
90 | int omap_dm_timers_active(void); | 78 | int omap_dm_timers_active(void); |
91 | u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); | ||
92 | 79 | ||
93 | #endif /* __ASM_ARCH_TIMER_H */ | 80 | |
81 | #endif /* __ASM_ARCH_DMTIMER_H */ | ||
diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h new file mode 100644 index 000000000000..1a0a5207822d --- /dev/null +++ b/include/asm-arm/arch-omap/gpmc.h | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * General-Purpose Memory Controller for OMAP2 | ||
3 | * | ||
4 | * Copyright (C) 2005-2006 Nokia Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __OMAP2_GPMC_H | ||
12 | #define __OMAP2_GPMC_H | ||
13 | |||
14 | #define GPMC_CS_CONFIG1 0x00 | ||
15 | #define GPMC_CS_CONFIG2 0x04 | ||
16 | #define GPMC_CS_CONFIG3 0x08 | ||
17 | #define GPMC_CS_CONFIG4 0x0c | ||
18 | #define GPMC_CS_CONFIG5 0x10 | ||
19 | #define GPMC_CS_CONFIG6 0x14 | ||
20 | #define GPMC_CS_CONFIG7 0x18 | ||
21 | #define GPMC_CS_NAND_COMMAND 0x1c | ||
22 | #define GPMC_CS_NAND_ADDRESS 0x20 | ||
23 | #define GPMC_CS_NAND_DATA 0x24 | ||
24 | |||
25 | #define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31) | ||
26 | #define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 20) | ||
27 | #define GPMC_CONFIG1_READTYPE_ASYNC (0 << 29) | ||
28 | #define GPMC_CONFIG1_READTYPE_SYNC (1 << 29) | ||
29 | #define GPMC_CONFIG1_WRITETYPE_ASYNC (0 << 27) | ||
30 | #define GPMC_CONFIG1_WRITETYPE_SYNC (1 << 27) | ||
31 | #define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25) | ||
32 | #define GPMC_CONFIG1_PAGE_LEN(val) ((val & 3) << 23) | ||
33 | #define GPMC_CONFIG1_WAIT_READ_MON (1 << 22) | ||
34 | #define GPMC_CONFIG1_WAIT_WRITE_MON (1 << 21) | ||
35 | #define GPMC_CONFIG1_WAIT_MON_IIME(val) ((val & 3) << 18) | ||
36 | #define GPMC_CONFIG1_WAIT_PIN_SEL(val) ((val & 3) << 16) | ||
37 | #define GPMC_CONFIG1_DEVICESIZE(val) ((val & 3) << 12) | ||
38 | #define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1) | ||
39 | #define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10) | ||
40 | #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0) | ||
41 | #define GPMC_CONFIG1_DEVICETYPE_NAND GPMC_CONFIG1_DEVICETYPE(1) | ||
42 | #define GPMC_CONFIG1_MUXADDDATA (1 << 9) | ||
43 | #define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4) | ||
44 | #define GPMC_CONFIG1_FCLK_DIV(val) (val & 3) | ||
45 | #define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1)) | ||
46 | #define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2)) | ||
47 | #define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) | ||
48 | |||
49 | /* | ||
50 | * Note that all values in this struct are in nanoseconds, while | ||
51 | * the register values are in gpmc_fck cycles. | ||
52 | */ | ||
53 | struct gpmc_timings { | ||
54 | /* Minimum clock period for synchronous mode */ | ||
55 | u16 sync_clk; | ||
56 | |||
57 | /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */ | ||
58 | u16 cs_on; /* Assertion time */ | ||
59 | u16 cs_rd_off; /* Read deassertion time */ | ||
60 | u16 cs_wr_off; /* Write deassertion time */ | ||
61 | |||
62 | /* ADV signal timings corresponding to GPMC_CONFIG3 */ | ||
63 | u16 adv_on; /* Assertion time */ | ||
64 | u16 adv_rd_off; /* Read deassertion time */ | ||
65 | u16 adv_wr_off; /* Write deassertion time */ | ||
66 | |||
67 | /* WE signals timings corresponding to GPMC_CONFIG4 */ | ||
68 | u16 we_on; /* WE assertion time */ | ||
69 | u16 we_off; /* WE deassertion time */ | ||
70 | |||
71 | /* OE signals timings corresponding to GPMC_CONFIG4 */ | ||
72 | u16 oe_on; /* OE assertion time */ | ||
73 | u16 oe_off; /* OE deassertion time */ | ||
74 | |||
75 | /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */ | ||
76 | u16 page_burst_access; /* Multiple access word delay */ | ||
77 | u16 access; /* Start-cycle to first data valid delay */ | ||
78 | u16 rd_cycle; /* Total read cycle time */ | ||
79 | u16 wr_cycle; /* Total write cycle time */ | ||
80 | }; | ||
81 | |||
82 | extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); | ||
83 | |||
84 | extern void gpmc_cs_write_reg(int cs, int idx, u32 val); | ||
85 | extern u32 gpmc_cs_read_reg(int cs, int idx); | ||
86 | extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk); | ||
87 | extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); | ||
88 | extern unsigned long gpmc_cs_get_base_addr(int cs); | ||
89 | |||
90 | |||
91 | #endif | ||
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h index c7d9e857795d..481048d65214 100644 --- a/include/asm-arm/arch-omap/hardware.h +++ b/include/asm-arm/arch-omap/hardware.h | |||
@@ -297,6 +297,10 @@ | |||
297 | #include "board-perseus2.h" | 297 | #include "board-perseus2.h" |
298 | #endif | 298 | #endif |
299 | 299 | ||
300 | #ifdef CONFIG_MACH_OMAP_FSAMPLE | ||
301 | #include "board-fsample.h" | ||
302 | #endif | ||
303 | |||
300 | #ifdef CONFIG_MACH_OMAP_H3 | 304 | #ifdef CONFIG_MACH_OMAP_H3 |
301 | #include "board-h3.h" | 305 | #include "board-h3.h" |
302 | #endif | 306 | #endif |
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h index 42098d99f302..2542495d8a43 100644 --- a/include/asm-arm/arch-omap/irqs.h +++ b/include/asm-arm/arch-omap/irqs.h | |||
@@ -242,10 +242,24 @@ | |||
242 | #define INT_24XX_GPIO_BANK2 30 | 242 | #define INT_24XX_GPIO_BANK2 30 |
243 | #define INT_24XX_GPIO_BANK3 31 | 243 | #define INT_24XX_GPIO_BANK3 31 |
244 | #define INT_24XX_GPIO_BANK4 32 | 244 | #define INT_24XX_GPIO_BANK4 32 |
245 | #define INT_24XX_GPTIMER1 37 | ||
246 | #define INT_24XX_GPTIMER2 38 | ||
247 | #define INT_24XX_GPTIMER3 39 | ||
248 | #define INT_24XX_GPTIMER4 40 | ||
249 | #define INT_24XX_GPTIMER5 41 | ||
250 | #define INT_24XX_GPTIMER6 42 | ||
251 | #define INT_24XX_GPTIMER7 43 | ||
252 | #define INT_24XX_GPTIMER8 44 | ||
253 | #define INT_24XX_GPTIMER9 45 | ||
254 | #define INT_24XX_GPTIMER10 46 | ||
255 | #define INT_24XX_GPTIMER11 47 | ||
256 | #define INT_24XX_GPTIMER12 48 | ||
245 | #define INT_24XX_MCBSP1_IRQ_TX 59 | 257 | #define INT_24XX_MCBSP1_IRQ_TX 59 |
246 | #define INT_24XX_MCBSP1_IRQ_RX 60 | 258 | #define INT_24XX_MCBSP1_IRQ_RX 60 |
247 | #define INT_24XX_MCBSP2_IRQ_TX 62 | 259 | #define INT_24XX_MCBSP2_IRQ_TX 62 |
248 | #define INT_24XX_MCBSP2_IRQ_RX 63 | 260 | #define INT_24XX_MCBSP2_IRQ_RX 63 |
261 | #define INT_24XX_UART1_IRQ 72 | ||
262 | #define INT_24XX_UART2_IRQ 73 | ||
249 | #define INT_24XX_UART3_IRQ 74 | 263 | #define INT_24XX_UART3_IRQ 74 |
250 | 264 | ||
251 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and | 265 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and |
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h index 0dc24d4ba59c..679869c5e68f 100644 --- a/include/asm-arm/arch-omap/mux.h +++ b/include/asm-arm/arch-omap/mux.h | |||
@@ -410,6 +410,12 @@ enum omap24xx_index { | |||
410 | /* 24xx clock */ | 410 | /* 24xx clock */ |
411 | W14_24XX_SYS_CLKOUT, | 411 | W14_24XX_SYS_CLKOUT, |
412 | 412 | ||
413 | /* 24xx GPMC wait pin monitoring */ | ||
414 | L3_GPMC_WAIT0, | ||
415 | N7_GPMC_WAIT1, | ||
416 | M1_GPMC_WAIT2, | ||
417 | P1_GPMC_WAIT3, | ||
418 | |||
413 | /* 242X McBSP */ | 419 | /* 242X McBSP */ |
414 | Y15_24XX_MCBSP2_CLKX, | 420 | Y15_24XX_MCBSP2_CLKX, |
415 | R14_24XX_MCBSP2_FSX, | 421 | R14_24XX_MCBSP2_FSX, |
@@ -429,6 +435,26 @@ enum omap24xx_index { | |||
429 | M15_24XX_GPIO92, | 435 | M15_24XX_GPIO92, |
430 | V14_24XX_GPIO117, | 436 | V14_24XX_GPIO117, |
431 | 437 | ||
438 | /* 242x DBG GPIO */ | ||
439 | V4_242X_GPIO49, | ||
440 | W2_242X_GPIO50, | ||
441 | U4_242X_GPIO51, | ||
442 | V3_242X_GPIO52, | ||
443 | V2_242X_GPIO53, | ||
444 | V6_242X_GPIO53, | ||
445 | T4_242X_GPIO54, | ||
446 | Y4_242X_GPIO54, | ||
447 | T3_242X_GPIO55, | ||
448 | U2_242X_GPIO56, | ||
449 | |||
450 | /* 24xx external DMA requests */ | ||
451 | AA10_242X_DMAREQ0, | ||
452 | AA6_242X_DMAREQ1, | ||
453 | E4_242X_DMAREQ2, | ||
454 | G4_242X_DMAREQ3, | ||
455 | D3_242X_DMAREQ4, | ||
456 | E3_242X_DMAREQ5, | ||
457 | |||
432 | P20_24XX_TSC_IRQ, | 458 | P20_24XX_TSC_IRQ, |
433 | 459 | ||
434 | /* UART3 */ | 460 | /* UART3 */ |
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h index 05b003f3a94c..e46623c61a72 100644 --- a/include/asm-arm/arch-omap/pm.h +++ b/include/asm-arm/arch-omap/pm.h | |||
@@ -299,10 +299,43 @@ enum omap24xx_save_state { | |||
299 | OMAP24XX_SLEEP_SAVE_INTC_MIR0, | 299 | OMAP24XX_SLEEP_SAVE_INTC_MIR0, |
300 | OMAP24XX_SLEEP_SAVE_INTC_MIR1, | 300 | OMAP24XX_SLEEP_SAVE_INTC_MIR1, |
301 | OMAP24XX_SLEEP_SAVE_INTC_MIR2, | 301 | OMAP24XX_SLEEP_SAVE_INTC_MIR2, |
302 | |||
303 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MPU, | ||
304 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_CORE, | ||
305 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_GFX, | ||
306 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_DSP, | ||
307 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MDM, | ||
308 | |||
309 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MPU, | ||
310 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_CORE, | ||
311 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_GFX, | ||
312 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_DSP, | ||
313 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MDM, | ||
314 | |||
315 | OMAP24XX_SLEEP_SAVE_CM_IDLEST1_CORE, | ||
316 | OMAP24XX_SLEEP_SAVE_CM_IDLEST2_CORE, | ||
317 | OMAP24XX_SLEEP_SAVE_CM_IDLEST3_CORE, | ||
318 | OMAP24XX_SLEEP_SAVE_CM_IDLEST4_CORE, | ||
319 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_GFX, | ||
320 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_WKUP, | ||
321 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_CKGEN, | ||
322 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_DSP, | ||
323 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_MDM, | ||
324 | |||
325 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE1_CORE, | ||
326 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE2_CORE, | ||
327 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE3_CORE, | ||
328 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE4_CORE, | ||
329 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_WKUP, | ||
330 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_PLL, | ||
331 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_DSP, | ||
332 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_MDM, | ||
333 | |||
302 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE, | 334 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE, |
303 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE, | 335 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE, |
304 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE, | 336 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE, |
305 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE, | 337 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE, |
338 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN3_CORE, | ||
306 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE, | 339 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE, |
307 | OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1, | 340 | OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1, |
308 | OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1, | 341 | OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1, |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 9f83f4adfbf3..f5cc65dd7d0d 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1329,6 +1329,7 @@ | |||
1329 | #define GPIO84_NSRXD 84 /* NSSP receive */ | 1329 | #define GPIO84_NSRXD 84 /* NSSP receive */ |
1330 | #define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */ | 1330 | #define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */ |
1331 | #define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */ | 1331 | #define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */ |
1332 | #define GPIO102_nPCE_1 102 /* PCMCIA (PXA27x) */ | ||
1332 | #define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */ | 1333 | #define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */ |
1333 | #define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */ | 1334 | #define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */ |
1334 | #define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */ | 1335 | #define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */ |
@@ -1471,6 +1472,7 @@ | |||
1471 | #define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN) | 1472 | #define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN) |
1472 | #define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT) | 1473 | #define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT) |
1473 | #define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT) | 1474 | #define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT) |
1475 | #define GPIO102_nPCE_1_MD (102 | GPIO_ALT_FN_1_OUT) | ||
1474 | #define GPIO104_pSKTSEL_MD (104 | GPIO_ALT_FN_1_OUT) | 1476 | #define GPIO104_pSKTSEL_MD (104 | GPIO_ALT_FN_1_OUT) |
1475 | #define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT) | 1477 | #define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT) |
1476 | #define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT) | 1478 | #define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT) |
diff --git a/include/asm-arm/arch-pxa/trizeps4.h b/include/asm-arm/arch-pxa/trizeps4.h new file mode 100644 index 000000000000..641d0ec110bb --- /dev/null +++ b/include/asm-arm/arch-pxa/trizeps4.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /************************************************************************ | ||
2 | * Include file for TRIZEPS4 SoM and ConXS eval-board | ||
3 | * Copyright (c) Jürgen Schindele | ||
4 | * 2006 | ||
5 | ************************************************************************/ | ||
6 | |||
7 | /* | ||
8 | * Includes/Defines | ||
9 | */ | ||
10 | #ifndef _TRIPEPS4_H_ | ||
11 | #define _TRIPEPS4_H_ | ||
12 | |||
13 | /* physical memory regions */ | ||
14 | #define TRIZEPS4_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */ | ||
15 | #define TRIZEPS4_DISK_PHYS (PXA_CS1_PHYS) /* Disk On Chip region */ | ||
16 | #define TRIZEPS4_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet DM9000 region */ | ||
17 | #define TRIZEPS4_PIC_PHYS (PXA_CS3_PHYS) /* Logic chip on ConXS-Board */ | ||
18 | #define TRIZEPS4_SDRAM_BASE 0xa0000000 /* SDRAM region */ | ||
19 | |||
20 | #define TRIZEPS4_CFSR_PHYS (PXA_CS3_PHYS) /* Logic chip on ConXS-Board CSFR register */ | ||
21 | #define TRIZEPS4_BOCR_PHYS (PXA_CS3_PHYS+0x02000000) /* Logic chip on ConXS-Board BOCR register */ | ||
22 | #define TRIZEPS4_IRCR_PHYS (PXA_CS3_PHYS+0x02400000) /* Logic chip on ConXS-Board IRCR register*/ | ||
23 | #define TRIZEPS4_UPSR_PHYS (PXA_CS3_PHYS+0x02800000) /* Logic chip on ConXS-Board UPSR register*/ | ||
24 | #define TRIZEPS4_DICR_PHYS (PXA_CS3_PHYS+0x03800000) /* Logic chip on ConXS-Board DICR register*/ | ||
25 | |||
26 | /* virtual memory regions */ | ||
27 | #define TRIZEPS4_DISK_VIRT 0xF0000000 /* Disk On Chip region */ | ||
28 | |||
29 | #define TRIZEPS4_PIC_VIRT 0xF0100000 /* not used */ | ||
30 | #define TRIZEPS4_CFSR_VIRT 0xF0100000 | ||
31 | #define TRIZEPS4_BOCR_VIRT 0xF0200000 | ||
32 | #define TRIZEPS4_DICR_VIRT 0xF0300000 | ||
33 | #define TRIZEPS4_IRCR_VIRT 0xF0400000 | ||
34 | #define TRIZEPS4_UPSR_VIRT 0xF0500000 | ||
35 | |||
36 | /* size of flash */ | ||
37 | #define TRIZEPS4_FLASH_SIZE 0x02000000 /* Flash size 32 MB */ | ||
38 | |||
39 | /* Ethernet Controller Davicom DM9000 */ | ||
40 | #define GPIO_DM9000 101 | ||
41 | #define TRIZEPS4_ETH_IRQ IRQ_GPIO(GPIO_DM9000) | ||
42 | |||
43 | /* UCB1400 audio / TS-controller */ | ||
44 | #define GPIO_UCB1400 1 | ||
45 | #define TRIZEPS4_UCB1400_IRQ IRQ_GPIO(GPIO_UCB1400) | ||
46 | |||
47 | /* PCMCIA socket Compact Flash */ | ||
48 | #define GPIO_PCD 11 /* PCMCIA Card Detect */ | ||
49 | #define TRIZEPS4_CD_IRQ IRQ_GPIO(GPIO_PCD) | ||
50 | #define GPIO_PRDY 13 /* READY / nINT */ | ||
51 | #define TRIZEPS4_READY_NINT IRQ_GPIO(GPIO_PRDY) | ||
52 | |||
53 | /* MMC socket */ | ||
54 | #define GPIO_MMC_DET 12 | ||
55 | #define TRIZEPS4_MMC_IRQ IRQ_GPIO(GPIO_MMC_DET) | ||
56 | |||
57 | /* LEDS using tx2 / rx2 */ | ||
58 | #define GPIO_SYS_BUSY_LED 46 | ||
59 | #define GPIO_HEARTBEAT_LED 47 | ||
60 | |||
61 | /* Off-module PIC on ConXS board */ | ||
62 | #define GPIO_PIC 0 | ||
63 | #define TRIZEPS4_PIC_IRQ IRQ_GPIO(GPIO_PIC) | ||
64 | |||
65 | #define CFSR_P2V(x) ((x) - TRIZEPS4_CFSR_PHYS + TRIZEPS4_CFSR_VIRT) | ||
66 | #define CFSR_V2P(x) ((x) - TRIZEPS4_CFSR_VIRT + TRIZEPS4_CFSR_PHYS) | ||
67 | |||
68 | #define BCR_P2V(x) ((x) - TRIZEPS4_BOCR_PHYS + TRIZEPS4_BOCR_VIRT) | ||
69 | #define BCR_V2P(x) ((x) - TRIZEPS4_BOCR_VIRT + TRIZEPS4_BOCR_PHYS) | ||
70 | |||
71 | #define DCR_P2V(x) ((x) - TRIZEPS4_DICR_PHYS + TRIZEPS4_DICR_VIRT) | ||
72 | #define DCR_V2P(x) ((x) - TRIZEPS4_DICR_VIRT + TRIZEPS4_DICR_PHYS) | ||
73 | |||
74 | #ifndef __ASSEMBLY__ | ||
75 | #define ConXS_CFSR (*((volatile unsigned short *)CFSR_P2V(0x0C000000))) | ||
76 | #define ConXS_BCR (*((volatile unsigned short *)BCR_P2V(0x0E000000))) | ||
77 | #define ConXS_DCR (*((volatile unsigned short *)DCR_P2V(0x0F800000))) | ||
78 | #else | ||
79 | #define ConXS_CFSR CFSR_P2V(0x0C000000) | ||
80 | #define ConXS_BCR BCR_P2V(0x0E000000) | ||
81 | #define ConXS_DCR DCR_P2V(0x0F800000) | ||
82 | #endif | ||
83 | |||
84 | #define ConXS_CFSR_BVD_MASK 0x0003 | ||
85 | #define ConXS_CFSR_BVD1 (1 << 0) | ||
86 | #define ConXS_CFSR_BVD2 (1 << 1) | ||
87 | #define ConXS_CFSR_VS_MASK 0x000C | ||
88 | #define ConXS_CFSR_VS1 (1 << 2) | ||
89 | #define ConXS_CFSR_VS2 (1 << 3) | ||
90 | #define ConXS_CFSR_VS_5V (0x3 << 2) | ||
91 | #define ConXS_CFSR_VS_3V3 0x0 | ||
92 | |||
93 | #define ConXS_BCR_S0_POW_EN0 (1 << 0) | ||
94 | #define ConXS_BCR_S0_POW_EN1 (1 << 1) | ||
95 | #define ConXS_BCR_L_DISP (1 << 4) | ||
96 | #define ConXS_BCR_CF_BUF_EN (1 << 5) | ||
97 | #define ConXS_BCR_CF_RESET (1 << 7) | ||
98 | #define ConXS_BCR_S0_VCC_3V3 0x1 | ||
99 | #define ConXS_BCR_S0_VCC_5V0 0x2 | ||
100 | #define ConXS_BCR_S0_VPP_12V 0x4 | ||
101 | #define ConXS_BCR_S0_VPP_3V3 0x8 | ||
102 | |||
103 | #define ConXS_IRCR_MODE (1 << 0) | ||
104 | #define ConXS_IRCR_SD (1 << 1) | ||
105 | |||
106 | #endif /* _TRIPEPS4_H_ */ | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h index 84aca61cbaa3..a0a124875164 100644 --- a/include/asm-arm/arch-s3c2410/regs-dsc.h +++ b/include/asm-arm/arch-s3c2410/regs-dsc.h | |||
@@ -7,25 +7,23 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | * | 9 | * |
10 | * S3C2440 Signal Drive Strength Control | 10 | * S3C2440/S3C2412 Signal Drive Strength Control |
11 | * | ||
12 | * Changelog: | ||
13 | * 11-Aug-2004 BJD Created file | ||
14 | * 25-Aug-2004 BJD Added the _SELECT_* defs for using with functions | ||
15 | */ | 11 | */ |
16 | 12 | ||
17 | 13 | ||
18 | #ifndef __ASM_ARCH_REGS_DSC_H | 14 | #ifndef __ASM_ARCH_REGS_DSC_H |
19 | #define __ASM_ARCH_REGS_DSC_H "2440-dsc" | 15 | #define __ASM_ARCH_REGS_DSC_H "2440-dsc" |
20 | 16 | ||
21 | #ifdef CONFIG_CPU_S3C2440 | 17 | #if defined(CONFIG_CPU_S3C2412) |
18 | #define S3C2412_DSC0 S3C2410_GPIOREG(0xdc) | ||
19 | #define S3C2412_DSC1 S3C2410_GPIOREG(0xe0) | ||
20 | #endif | ||
21 | |||
22 | #if defined(CONFIG_CPU_S3C2440) | ||
22 | 23 | ||
23 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) | 24 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) |
24 | #define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) | 25 | #define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) |
25 | 26 | ||
26 | #define S3C2412_DSC0 S3C2410_GPIOREG(0xdc) | ||
27 | #define S3C2412_DSC1 S3C2410_GPIOREG(0xe0) | ||
28 | |||
29 | #define S3C2440_SELECT_DSC0 (0) | 27 | #define S3C2440_SELECT_DSC0 (0) |
30 | #define S3C2440_SELECT_DSC1 (1<<31) | 28 | #define S3C2440_SELECT_DSC1 (1<<31) |
31 | 29 | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/arch-s3c2410/regs-nand.h index 7cff235e667a..c1470c695c33 100644 --- a/include/asm-arm/arch-s3c2410/regs-nand.h +++ b/include/asm-arm/arch-s3c2410/regs-nand.h | |||
@@ -39,10 +39,19 @@ | |||
39 | #define S3C2440_NFESTAT1 S3C2410_NFREG(0x28) | 39 | #define S3C2440_NFESTAT1 S3C2410_NFREG(0x28) |
40 | #define S3C2440_NFMECC0 S3C2410_NFREG(0x2C) | 40 | #define S3C2440_NFMECC0 S3C2410_NFREG(0x2C) |
41 | #define S3C2440_NFMECC1 S3C2410_NFREG(0x30) | 41 | #define S3C2440_NFMECC1 S3C2410_NFREG(0x30) |
42 | #define S3C2440_NFSECC S3C2410_NFREG(0x34) | 42 | #define S3C2440_NFSECC S3C24E10_NFREG(0x34) |
43 | #define S3C2440_NFSBLK S3C2410_NFREG(0x38) | 43 | #define S3C2440_NFSBLK S3C2410_NFREG(0x38) |
44 | #define S3C2440_NFEBLK S3C2410_NFREG(0x3C) | 44 | #define S3C2440_NFEBLK S3C2410_NFREG(0x3C) |
45 | 45 | ||
46 | #define S3C2412_NFSBLK S3C2410_NFREG(0x20) | ||
47 | #define S3C2412_NFEBLK S3C2410_NFREG(0x24) | ||
48 | #define S3C2412_NFSTAT S3C2410_NFREG(0x28) | ||
49 | #define S3C2412_NFMECC_ERR0 S3C2410_NFREG(0x2C) | ||
50 | #define S3C2412_NFMECC_ERR1 S3C2410_NFREG(0x30) | ||
51 | #define S3C2412_NFMECC0 S3C2410_NFREG(0x34) | ||
52 | #define S3C2412_NFMECC1 S3C2410_NFREG(0x38) | ||
53 | #define S3C2412_NFSECC S3C2410_NFREG(0x3C) | ||
54 | |||
46 | #define S3C2410_NFCONF_EN (1<<15) | 55 | #define S3C2410_NFCONF_EN (1<<15) |
47 | #define S3C2410_NFCONF_512BYTE (1<<14) | 56 | #define S3C2410_NFCONF_512BYTE (1<<14) |
48 | #define S3C2410_NFCONF_4STEP (1<<13) | 57 | #define S3C2410_NFCONF_4STEP (1<<13) |
@@ -77,5 +86,42 @@ | |||
77 | #define S3C2440_NFSTAT_RnB_CHANGE (1<<2) | 86 | #define S3C2440_NFSTAT_RnB_CHANGE (1<<2) |
78 | #define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3) | 87 | #define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3) |
79 | 88 | ||
89 | #define S3C2412_NFCONF_NANDBOOT (1<<31) | ||
90 | #define S3C2412_NFCONF_ECCCLKCON (1<<30) | ||
91 | #define S3C2412_NFCONF_ECC_MLC (1<<24) | ||
92 | #define S3C2412_NFCONF_TACLS_MASK (7<<12) /* 1 extra bit of Tacls */ | ||
93 | |||
94 | #define S3C2412_NFCONT_ECC4_DIRWR (1<<18) | ||
95 | #define S3C2412_NFCONT_LOCKTIGHT (1<<17) | ||
96 | #define S3C2412_NFCONT_SOFTLOCK (1<<16) | ||
97 | #define S3C2412_NFCONT_ECC4_ENCINT (1<<13) | ||
98 | #define S3C2412_NFCONT_ECC4_DECINT (1<<12) | ||
99 | #define S3C2412_NFCONT_MAIN_ECC_LOCK (1<<7) | ||
100 | #define S3C2412_NFCONT_INIT_MAIN_ECC (1<<5) | ||
101 | #define S3C2412_NFCONT_nFCE1 (1<<2) | ||
102 | #define S3C2412_NFCONT_nFCE0 (1<<1) | ||
103 | |||
104 | #define S3C2412_NFSTAT_ECC_ENCDONE (1<<7) | ||
105 | #define S3C2412_NFSTAT_ECC_DECDONE (1<<6) | ||
106 | #define S3C2412_NFSTAT_ILLEGAL_ACCESS (1<<5) | ||
107 | #define S3C2412_NFSTAT_RnB_CHANGE (1<<4) | ||
108 | #define S3C2412_NFSTAT_nFCE1 (1<<3) | ||
109 | #define S3C2412_NFSTAT_nFCE0 (1<<2) | ||
110 | #define S3C2412_NFSTAT_Res1 (1<<1) | ||
111 | #define S3C2412_NFSTAT_READY (1<<0) | ||
112 | |||
113 | #define S3C2412_NFECCERR_SERRDATA(x) (((x) >> 21) & 0xf) | ||
114 | #define S3C2412_NFECCERR_SERRBIT(x) (((x) >> 18) & 0x7) | ||
115 | #define S3C2412_NFECCERR_MERRDATA(x) (((x) >> 7) & 0x3ff) | ||
116 | #define S3C2412_NFECCERR_MERRBIT(x) (((x) >> 4) & 0x7) | ||
117 | #define S3C2412_NFECCERR_SPARE_ERR(x) (((x) >> 2) & 0x3) | ||
118 | #define S3C2412_NFECCERR_MAIN_ERR(x) (((x) >> 2) & 0x3) | ||
119 | #define S3C2412_NFECCERR_NONE (0) | ||
120 | #define S3C2412_NFECCERR_1BIT (1) | ||
121 | #define S3C2412_NFECCERR_MULTIBIT (2) | ||
122 | #define S3C2412_NFECCERR_ECCAREA (3) | ||
123 | |||
124 | |||
125 | |||
80 | #endif /* __ASM_ARM_REGS_NAND */ | 126 | #endif /* __ASM_ARM_REGS_NAND */ |
81 | 127 | ||
diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h index 72ef874567d5..2af9d7c9c63c 100644 --- a/include/asm-arm/arch-versatile/platform.h +++ b/include/asm-arm/arch-versatile/platform.h | |||
@@ -65,6 +65,8 @@ | |||
65 | #define VERSATILE_SYS_OSC1_OFFSET 0x1C | 65 | #define VERSATILE_SYS_OSC1_OFFSET 0x1C |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #define VERSATILE_SYS_OSCCLCD_OFFSET 0x1c | ||
69 | |||
68 | #define VERSATILE_SYS_LOCK_OFFSET 0x20 | 70 | #define VERSATILE_SYS_LOCK_OFFSET 0x20 |
69 | #define VERSATILE_SYS_100HZ_OFFSET 0x24 | 71 | #define VERSATILE_SYS_100HZ_OFFSET 0x24 |
70 | #define VERSATILE_SYS_CFGDATA1_OFFSET 0x28 | 72 | #define VERSATILE_SYS_CFGDATA1_OFFSET 0x28 |
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h index 7fb02138f585..0e36fd5d87df 100644 --- a/include/asm-arm/bug.h +++ b/include/asm-arm/bug.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASMARM_BUG_H | 1 | #ifndef _ASMARM_BUG_H |
2 | #define _ASMARM_BUG_H | 2 | #define _ASMARM_BUG_H |
3 | 3 | ||
4 | #include <linux/config.h> | ||
5 | 4 | ||
6 | #ifdef CONFIG_BUG | 5 | #ifdef CONFIG_BUG |
7 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 6 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
diff --git a/include/asm-arm/bugs.h b/include/asm-arm/bugs.h index 4c80ec519d45..ca54eb0f12d7 100644 --- a/include/asm-arm/bugs.h +++ b/include/asm-arm/bugs.h | |||
@@ -10,8 +10,12 @@ | |||
10 | #ifndef __ASM_BUGS_H | 10 | #ifndef __ASM_BUGS_H |
11 | #define __ASM_BUGS_H | 11 | #define __ASM_BUGS_H |
12 | 12 | ||
13 | #ifdef CONFIG_MMU | ||
13 | extern void check_writebuffer_bugs(void); | 14 | extern void check_writebuffer_bugs(void); |
14 | 15 | ||
15 | #define check_bugs() check_writebuffer_bugs() | 16 | #define check_bugs() check_writebuffer_bugs() |
17 | #else | ||
18 | #define check_bugs() do { } while (0) | ||
19 | #endif | ||
16 | 20 | ||
17 | #endif | 21 | #endif |
diff --git a/include/asm-arm/domain.h b/include/asm-arm/domain.h index f8ea2de4848e..4c2885abbe6c 100644 --- a/include/asm-arm/domain.h +++ b/include/asm-arm/domain.h | |||
@@ -50,6 +50,8 @@ | |||
50 | #define domain_val(dom,type) ((type) << (2*(dom))) | 50 | #define domain_val(dom,type) ((type) << (2*(dom))) |
51 | 51 | ||
52 | #ifndef __ASSEMBLY__ | 52 | #ifndef __ASSEMBLY__ |
53 | |||
54 | #ifdef CONFIG_MMU | ||
53 | #define set_domain(x) \ | 55 | #define set_domain(x) \ |
54 | do { \ | 56 | do { \ |
55 | __asm__ __volatile__( \ | 57 | __asm__ __volatile__( \ |
@@ -66,5 +68,10 @@ | |||
66 | set_domain(thread->cpu_domain); \ | 68 | set_domain(thread->cpu_domain); \ |
67 | } while (0) | 69 | } while (0) |
68 | 70 | ||
71 | #else | ||
72 | #define set_domain(x) do { } while (0) | ||
73 | #define modify_domain(dom,type) do { } while (0) | ||
74 | #endif | ||
75 | |||
69 | #endif | 76 | #endif |
70 | #endif /* !__ASSEMBLY__ */ | 77 | #endif /* !__ASSEMBLY__ */ |
diff --git a/include/asm-arm/dyntick.h b/include/asm-arm/dyntick.h new file mode 100644 index 000000000000..19fab2d2b760 --- /dev/null +++ b/include/asm-arm/dyntick.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASMARM_DYNTICK_H | ||
2 | #define _ASMARM_DYNTICK_H | ||
3 | |||
4 | #include <asm/mach/time.h> | ||
5 | |||
6 | #endif /* _ASMARM_DYNTICK_H */ | ||
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h index aa0c8d28d8d9..54b5ae44ed94 100644 --- a/include/asm-arm/floppy.h +++ b/include/asm-arm/floppy.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #define fd_inb(port) inb((port)) | 26 | #define fd_inb(port) inb((port)) |
27 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ | 27 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ |
28 | SA_INTERRUPT,"floppy",NULL) | 28 | IRQF_DISABLED,"floppy",NULL) |
29 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) | 29 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) |
30 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) | 30 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) |
31 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) | 31 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) |
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h index 132c3c5628b2..6af4e6bd1290 100644 --- a/include/asm-arm/fpstate.h +++ b/include/asm-arm/fpstate.h | |||
@@ -72,6 +72,14 @@ union fp_state { | |||
72 | 72 | ||
73 | #define FP_SIZE (sizeof(union fp_state) / sizeof(int)) | 73 | #define FP_SIZE (sizeof(union fp_state) / sizeof(int)) |
74 | 74 | ||
75 | struct crunch_state { | ||
76 | unsigned int mvdx[16][2]; | ||
77 | unsigned int mvax[4][3]; | ||
78 | unsigned int dspsc[2]; | ||
79 | }; | ||
80 | |||
81 | #define CRUNCH_SIZE sizeof(struct crunch_state) | ||
82 | |||
75 | #endif | 83 | #endif |
76 | 84 | ||
77 | #endif | 85 | #endif |
diff --git a/include/asm-arm/hw_irq.h b/include/asm-arm/hw_irq.h new file mode 100644 index 000000000000..ea856971989a --- /dev/null +++ b/include/asm-arm/hw_irq.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Nothing to see here yet | ||
3 | */ | ||
4 | #ifndef _ARCH_ARM_HW_IRQ_H | ||
5 | #define _ARCH_ARM_HW_IRQ_H | ||
6 | |||
7 | #include <asm/mach/irq.h> | ||
8 | |||
9 | #if defined(CONFIG_NO_IDLE_HZ) | ||
10 | # include <asm/dyntick.h> | ||
11 | # define handle_dynamic_tick(action) \ | ||
12 | if (!(action->flags & IRQF_TIMER) && system_timer->dyn_tick) { \ | ||
13 | write_seqlock(&xtime_lock); \ | ||
14 | if (system_timer->dyn_tick->state & DYN_TICK_ENABLED) \ | ||
15 | system_timer->dyn_tick->handler(irq, 0, regs); \ | ||
16 | write_sequnlock(&xtime_lock); \ | ||
17 | } | ||
18 | #endif | ||
19 | |||
20 | #endif | ||
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h index 66e67e60bc56..283af50a16cb 100644 --- a/include/asm-arm/irq.h +++ b/include/asm-arm/irq.h | |||
@@ -21,18 +21,13 @@ | |||
21 | 21 | ||
22 | struct irqaction; | 22 | struct irqaction; |
23 | 23 | ||
24 | extern void disable_irq_nosync(unsigned int); | ||
25 | extern void disable_irq(unsigned int); | ||
26 | extern void enable_irq(unsigned int); | ||
27 | |||
28 | /* | 24 | /* |
29 | * These correspond with the SA_TRIGGER_* defines, and therefore the | 25 | * Migration helpers |
30 | * IORESOURCE_IRQ_* defines. | ||
31 | */ | 26 | */ |
32 | #define __IRQT_RISEDGE (1 << 0) | 27 | #define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING |
33 | #define __IRQT_FALEDGE (1 << 1) | 28 | #define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING |
34 | #define __IRQT_HIGHLVL (1 << 2) | 29 | #define __IRQT_LOWLVL IRQ_TYPE_LEVEL_LOW |
35 | #define __IRQT_LOWLVL (1 << 3) | 30 | #define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH |
36 | 31 | ||
37 | #define IRQT_NOEDGE (0) | 32 | #define IRQT_NOEDGE (0) |
38 | #define IRQT_RISING (__IRQT_RISEDGE) | 33 | #define IRQT_RISING (__IRQT_RISEDGE) |
@@ -40,12 +35,7 @@ extern void enable_irq(unsigned int); | |||
40 | #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) | 35 | #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) |
41 | #define IRQT_LOW (__IRQT_LOWLVL) | 36 | #define IRQT_LOW (__IRQT_LOWLVL) |
42 | #define IRQT_HIGH (__IRQT_HIGHLVL) | 37 | #define IRQT_HIGH (__IRQT_HIGHLVL) |
43 | #define IRQT_PROBE (1 << 4) | 38 | #define IRQT_PROBE IRQ_TYPE_PROBE |
44 | |||
45 | int set_irq_type(unsigned int irq, unsigned int type); | ||
46 | void disable_irq_wake(unsigned int irq); | ||
47 | void enable_irq_wake(unsigned int irq); | ||
48 | int setup_irq(unsigned int, struct irqaction *); | ||
49 | 39 | ||
50 | extern void migrate_irqs(void); | 40 | extern void migrate_irqs(void); |
51 | #endif | 41 | #endif |
diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index d4d420ecf3a8..131f33733d25 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h | |||
@@ -10,95 +10,9 @@ | |||
10 | #ifndef __ASM_ARM_MACH_IRQ_H | 10 | #ifndef __ASM_ARM_MACH_IRQ_H |
11 | #define __ASM_ARM_MACH_IRQ_H | 11 | #define __ASM_ARM_MACH_IRQ_H |
12 | 12 | ||
13 | struct irqdesc; | 13 | #include <linux/irq.h> |
14 | struct pt_regs; | ||
15 | struct seq_file; | ||
16 | |||
17 | typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *); | ||
18 | typedef void (*irq_control_t)(unsigned int); | ||
19 | |||
20 | struct irqchip { | ||
21 | /* | ||
22 | * Acknowledge the IRQ. | ||
23 | * If this is a level-based IRQ, then it is expected to mask the IRQ | ||
24 | * as well. | ||
25 | */ | ||
26 | void (*ack)(unsigned int); | ||
27 | /* | ||
28 | * Mask the IRQ in hardware. | ||
29 | */ | ||
30 | void (*mask)(unsigned int); | ||
31 | /* | ||
32 | * Unmask the IRQ in hardware. | ||
33 | */ | ||
34 | void (*unmask)(unsigned int); | ||
35 | /* | ||
36 | * Ask the hardware to re-trigger the IRQ. | ||
37 | * Note: This method _must_ _not_ call the interrupt handler. | ||
38 | * If you are unable to retrigger the interrupt, do not | ||
39 | * provide a function, or if you do, return non-zero. | ||
40 | */ | ||
41 | int (*retrigger)(unsigned int); | ||
42 | /* | ||
43 | * Set the type of the IRQ. | ||
44 | */ | ||
45 | int (*set_type)(unsigned int, unsigned int); | ||
46 | /* | ||
47 | * Set wakeup-enable on the selected IRQ | ||
48 | */ | ||
49 | int (*set_wake)(unsigned int, unsigned int); | ||
50 | |||
51 | #ifdef CONFIG_SMP | ||
52 | /* | ||
53 | * Route an interrupt to a CPU | ||
54 | */ | ||
55 | void (*set_cpu)(struct irqdesc *desc, unsigned int irq, unsigned int cpu); | ||
56 | #endif | ||
57 | }; | ||
58 | |||
59 | struct irqdesc { | ||
60 | irq_handler_t handle; | ||
61 | struct irqchip *chip; | ||
62 | struct irqaction *action; | ||
63 | struct list_head pend; | ||
64 | void __iomem *base; | ||
65 | void *data; | ||
66 | unsigned int disable_depth; | ||
67 | |||
68 | unsigned int triggered: 1; /* IRQ has occurred */ | ||
69 | unsigned int running : 1; /* IRQ is running */ | ||
70 | unsigned int pending : 1; /* IRQ is pending */ | ||
71 | unsigned int probing : 1; /* IRQ in use for a probe */ | ||
72 | unsigned int probe_ok : 1; /* IRQ can be used for probe */ | ||
73 | unsigned int valid : 1; /* IRQ claimable */ | ||
74 | unsigned int noautoenable : 1; /* don't automatically enable IRQ */ | ||
75 | unsigned int unused :25; | ||
76 | |||
77 | unsigned int irqs_unhandled; | ||
78 | struct proc_dir_entry *procdir; | ||
79 | |||
80 | #ifdef CONFIG_SMP | ||
81 | cpumask_t affinity; | ||
82 | unsigned int cpu; | ||
83 | #endif | ||
84 | |||
85 | /* | ||
86 | * IRQ lock detection | ||
87 | */ | ||
88 | unsigned int lck_cnt; | ||
89 | unsigned int lck_pc; | ||
90 | unsigned int lck_jif; | ||
91 | }; | ||
92 | |||
93 | extern struct irqdesc irq_desc[]; | ||
94 | 14 | ||
95 | /* | 15 | struct seq_file; |
96 | * Helpful inline function for calling irq descriptor handlers. | ||
97 | */ | ||
98 | static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) | ||
99 | { | ||
100 | desc->handle(irq, desc, regs); | ||
101 | } | ||
102 | 16 | ||
103 | /* | 17 | /* |
104 | * This is internal. Do not use it. | 18 | * This is internal. Do not use it. |
@@ -106,18 +20,22 @@ static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struc | |||
106 | extern void (*init_arch_irq)(void); | 20 | extern void (*init_arch_irq)(void); |
107 | extern void init_FIQ(void); | 21 | extern void init_FIQ(void); |
108 | extern int show_fiq_list(struct seq_file *, void *); | 22 | extern int show_fiq_list(struct seq_file *, void *); |
109 | void __set_irq_handler(unsigned int irq, irq_handler_t, int); | ||
110 | 23 | ||
111 | /* | 24 | /* |
112 | * External stuff. | 25 | * Function wrappers |
26 | */ | ||
27 | #define set_irq_chipdata(irq, d) set_irq_chip_data(irq, d) | ||
28 | #define get_irq_chipdata(irq) get_irq_chip_data(irq) | ||
29 | |||
30 | /* | ||
31 | * Obsolete inline function for calling irq descriptor handlers. | ||
113 | */ | 32 | */ |
114 | #define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0) | 33 | static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc, |
115 | #define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1) | 34 | struct pt_regs *regs) |
116 | #define set_irq_data(irq,d) do { irq_desc[irq].data = d; } while (0) | 35 | { |
117 | #define set_irq_chipdata(irq,d) do { irq_desc[irq].base = d; } while (0) | 36 | desc->handle_irq(irq, desc, regs); |
118 | #define get_irq_chipdata(irq) (irq_desc[irq].base) | 37 | } |
119 | 38 | ||
120 | void set_irq_chip(unsigned int irq, struct irqchip *); | ||
121 | void set_irq_flags(unsigned int irq, unsigned int flags); | 39 | void set_irq_flags(unsigned int irq, unsigned int flags); |
122 | 40 | ||
123 | #define IRQF_VALID (1 << 0) | 41 | #define IRQF_VALID (1 << 0) |
@@ -125,12 +43,25 @@ void set_irq_flags(unsigned int irq, unsigned int flags); | |||
125 | #define IRQF_NOAUTOEN (1 << 2) | 43 | #define IRQF_NOAUTOEN (1 << 2) |
126 | 44 | ||
127 | /* | 45 | /* |
128 | * Built-in IRQ handlers. | 46 | * This is for easy migration, but should be changed in the source |
129 | */ | 47 | */ |
130 | void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); | 48 | #define do_level_IRQ handle_level_irq |
131 | void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); | 49 | #define do_edge_IRQ handle_edge_irq |
132 | void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); | 50 | #define do_simple_IRQ handle_simple_irq |
133 | void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); | 51 | #define irqdesc irq_desc |
134 | void dummy_mask_unmask_irq(unsigned int irq); | 52 | #define irqchip irq_chip |
53 | |||
54 | #define do_bad_IRQ(irq,desc,regs) \ | ||
55 | do { \ | ||
56 | spin_lock(&desc->lock); \ | ||
57 | handle_bad_irq(irq, desc, regs); \ | ||
58 | spin_unlock(&desc->lock); \ | ||
59 | } while(0) | ||
60 | |||
61 | extern unsigned long irq_err_count; | ||
62 | static inline void ack_bad_irq(int irq) | ||
63 | { | ||
64 | irq_err_count++; | ||
65 | } | ||
135 | 66 | ||
136 | #endif | 67 | #endif |
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h index e8ea67c97c73..cef5364ed5fe 100644 --- a/include/asm-arm/mach/map.h +++ b/include/asm-arm/mach/map.h | |||
@@ -16,8 +16,6 @@ struct map_desc { | |||
16 | unsigned int type; | 16 | unsigned int type; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | struct meminfo; | ||
20 | |||
21 | #define MT_DEVICE 0 | 19 | #define MT_DEVICE 0 |
22 | #define MT_CACHECLEAN 1 | 20 | #define MT_CACHECLEAN 1 |
23 | #define MT_MINICLEAN 2 | 21 | #define MT_MINICLEAN 2 |
@@ -28,7 +26,8 @@ struct meminfo; | |||
28 | #define MT_IXP2000_DEVICE 7 | 26 | #define MT_IXP2000_DEVICE 7 |
29 | #define MT_NONSHARED_DEVICE 8 | 27 | #define MT_NONSHARED_DEVICE 8 |
30 | 28 | ||
31 | extern void create_memmap_holes(struct meminfo *); | 29 | #ifdef CONFIG_MMU |
32 | extern void memtable_init(struct meminfo *); | ||
33 | extern void iotable_init(struct map_desc *, int); | 30 | extern void iotable_init(struct map_desc *, int); |
34 | extern void setup_io_desc(void); | 31 | #else |
32 | #define iotable_init(map,num) do { } while (0) | ||
33 | #endif | ||
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h index 25d540ed0079..923e0ca66200 100644 --- a/include/asm-arm/mach/pci.h +++ b/include/asm-arm/mach/pci.h | |||
@@ -28,7 +28,7 @@ struct hw_pci { | |||
28 | struct pci_sys_data { | 28 | struct pci_sys_data { |
29 | struct list_head node; | 29 | struct list_head node; |
30 | int busnr; /* primary bus number */ | 30 | int busnr; /* primary bus number */ |
31 | unsigned long mem_offset; /* bus->cpu memory mapping offset */ | 31 | u64 mem_offset; /* bus->cpu memory mapping offset */ |
32 | unsigned long io_offset; /* bus->cpu IO mapping offset */ | 32 | unsigned long io_offset; /* bus->cpu IO mapping offset */ |
33 | struct pci_bus *bus; /* PCI bus */ | 33 | struct pci_bus *bus; /* PCI bus */ |
34 | struct resource *resource[3]; /* Primary PCI bus resources */ | 34 | struct resource *resource[3]; /* Primary PCI bus resources */ |
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h index 9f28073559e8..dee0bc336fe8 100644 --- a/include/asm-arm/mach/time.h +++ b/include/asm-arm/mach/time.h | |||
@@ -69,6 +69,7 @@ extern void timer_tick(struct pt_regs *); | |||
69 | /* | 69 | /* |
70 | * Kernel time keeping support. | 70 | * Kernel time keeping support. |
71 | */ | 71 | */ |
72 | struct timespec; | ||
72 | extern int (*set_rtc)(void); | 73 | extern int (*set_rtc)(void); |
73 | extern void save_time_delta(struct timespec *delta, struct timespec *rtc); | 74 | extern void save_time_delta(struct timespec *delta, struct timespec *rtc); |
74 | extern void restore_time_delta(struct timespec *delta, struct timespec *rtc); | 75 | extern void restore_time_delta(struct timespec *delta, struct timespec *rtc); |
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index 731e321a57d1..91d536c215d7 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/include/asm-arm/memory.h | 2 | * linux/include/asm-arm/memory.h |
3 | * | 3 | * |
4 | * Copyright (C) 2000-2002 Russell King | 4 | * Copyright (C) 2000-2002 Russell King |
5 | * modification for nommu, Hyok S. Choi, 2004 | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -26,6 +27,8 @@ | |||
26 | #include <asm/arch/memory.h> | 27 | #include <asm/arch/memory.h> |
27 | #include <asm/sizes.h> | 28 | #include <asm/sizes.h> |
28 | 29 | ||
30 | #ifdef CONFIG_MMU | ||
31 | |||
29 | #ifndef TASK_SIZE | 32 | #ifndef TASK_SIZE |
30 | /* | 33 | /* |
31 | * TASK_SIZE - the maximum size of a user space task. | 34 | * TASK_SIZE - the maximum size of a user space task. |
@@ -48,6 +51,65 @@ | |||
48 | #endif | 51 | #endif |
49 | 52 | ||
50 | /* | 53 | /* |
54 | * The module space lives between the addresses given by TASK_SIZE | ||
55 | * and PAGE_OFFSET - it must be within 32MB of the kernel text. | ||
56 | */ | ||
57 | #define MODULE_END (PAGE_OFFSET) | ||
58 | #define MODULE_START (MODULE_END - 16*1048576) | ||
59 | |||
60 | #if TASK_SIZE > MODULE_START | ||
61 | #error Top of user space clashes with start of module space | ||
62 | #endif | ||
63 | |||
64 | /* | ||
65 | * The XIP kernel gets mapped at the bottom of the module vm area. | ||
66 | * Since we use sections to map it, this macro replaces the physical address | ||
67 | * with its virtual address while keeping offset from the base section. | ||
68 | */ | ||
69 | #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) | ||
70 | |||
71 | /* | ||
72 | * Allow 16MB-aligned ioremap pages | ||
73 | */ | ||
74 | #define IOREMAP_MAX_ORDER 24 | ||
75 | |||
76 | #else /* CONFIG_MMU */ | ||
77 | |||
78 | /* | ||
79 | * The limitation of user task size can grow up to the end of free ram region. | ||
80 | * It is difficult to define and perhaps will never meet the original meaning | ||
81 | * of this define that was meant to. | ||
82 | * Fortunately, there is no reference for this in noMMU mode, for now. | ||
83 | */ | ||
84 | #ifndef TASK_SIZE | ||
85 | #define TASK_SIZE (CONFIG_DRAM_SIZE) | ||
86 | #endif | ||
87 | |||
88 | #ifndef TASK_UNMAPPED_BASE | ||
89 | #define TASK_UNMAPPED_BASE UL(0x00000000) | ||
90 | #endif | ||
91 | |||
92 | #ifndef PHYS_OFFSET | ||
93 | #define PHYS_OFFSET (CONFIG_DRAM_BASE) | ||
94 | #endif | ||
95 | |||
96 | #ifndef END_MEM | ||
97 | #define END_MEM (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE) | ||
98 | #endif | ||
99 | |||
100 | #ifndef PAGE_OFFSET | ||
101 | #define PAGE_OFFSET (PHYS_OFFSET) | ||
102 | #endif | ||
103 | |||
104 | /* | ||
105 | * The module can be at any place in ram in nommu mode. | ||
106 | */ | ||
107 | #define MODULE_END (END_MEM) | ||
108 | #define MODULE_START (PHYS_OFFSET) | ||
109 | |||
110 | #endif /* !CONFIG_MMU */ | ||
111 | |||
112 | /* | ||
51 | * Size of DMA-consistent memory region. Must be multiple of 2M, | 113 | * Size of DMA-consistent memory region. Must be multiple of 2M, |
52 | * between 2MB and 14MB inclusive. | 114 | * between 2MB and 14MB inclusive. |
53 | */ | 115 | */ |
@@ -71,24 +133,6 @@ | |||
71 | #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) | 133 | #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) |
72 | #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) | 134 | #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) |
73 | 135 | ||
74 | /* | ||
75 | * The module space lives between the addresses given by TASK_SIZE | ||
76 | * and PAGE_OFFSET - it must be within 32MB of the kernel text. | ||
77 | */ | ||
78 | #define MODULE_END (PAGE_OFFSET) | ||
79 | #define MODULE_START (MODULE_END - 16*1048576) | ||
80 | |||
81 | #if TASK_SIZE > MODULE_START | ||
82 | #error Top of user space clashes with start of module space | ||
83 | #endif | ||
84 | |||
85 | /* | ||
86 | * The XIP kernel gets mapped at the bottom of the module vm area. | ||
87 | * Since we use sections to map it, this macro replaces the physical address | ||
88 | * with its virtual address while keeping offset from the base section. | ||
89 | */ | ||
90 | #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) | ||
91 | |||
92 | #ifndef __ASSEMBLY__ | 136 | #ifndef __ASSEMBLY__ |
93 | 137 | ||
94 | /* | 138 | /* |
diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h index a457cb71984f..fe2a23b5627b 100644 --- a/include/asm-arm/mmu.h +++ b/include/asm-arm/mmu.h | |||
@@ -1,10 +1,13 @@ | |||
1 | #ifndef __ARM_MMU_H | 1 | #ifndef __ARM_MMU_H |
2 | #define __ARM_MMU_H | 2 | #define __ARM_MMU_H |
3 | 3 | ||
4 | #ifdef CONFIG_MMU | ||
5 | |||
4 | typedef struct { | 6 | typedef struct { |
5 | #if __LINUX_ARM_ARCH__ >= 6 | 7 | #if __LINUX_ARM_ARCH__ >= 6 |
6 | unsigned int id; | 8 | unsigned int id; |
7 | #endif | 9 | #endif |
10 | unsigned int kvm_seq; | ||
8 | } mm_context_t; | 11 | } mm_context_t; |
9 | 12 | ||
10 | #if __LINUX_ARM_ARCH__ >= 6 | 13 | #if __LINUX_ARM_ARCH__ >= 6 |
@@ -13,4 +16,18 @@ typedef struct { | |||
13 | #define ASID(mm) (0) | 16 | #define ASID(mm) (0) |
14 | #endif | 17 | #endif |
15 | 18 | ||
19 | #else | ||
20 | |||
21 | /* | ||
22 | * From nommu.h: | ||
23 | * Copyright (C) 2002, David McCullough <davidm@snapgear.com> | ||
24 | * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> | ||
25 | */ | ||
26 | typedef struct { | ||
27 | struct vm_list_struct *vmlist; | ||
28 | unsigned long end_brk; | ||
29 | } mm_context_t; | ||
30 | |||
31 | #endif | ||
32 | |||
16 | #endif | 33 | #endif |
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h index 81c59facea3b..d1a65b1edcaa 100644 --- a/include/asm-arm/mmu_context.h +++ b/include/asm-arm/mmu_context.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
18 | #include <asm/proc-fns.h> | 18 | #include <asm/proc-fns.h> |
19 | 19 | ||
20 | void __check_kvm_seq(struct mm_struct *mm); | ||
21 | |||
20 | #if __LINUX_ARM_ARCH__ >= 6 | 22 | #if __LINUX_ARM_ARCH__ >= 6 |
21 | 23 | ||
22 | /* | 24 | /* |
@@ -45,13 +47,21 @@ static inline void check_context(struct mm_struct *mm) | |||
45 | { | 47 | { |
46 | if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) | 48 | if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) |
47 | __new_context(mm); | 49 | __new_context(mm); |
50 | |||
51 | if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq)) | ||
52 | __check_kvm_seq(mm); | ||
48 | } | 53 | } |
49 | 54 | ||
50 | #define init_new_context(tsk,mm) (__init_new_context(tsk,mm),0) | 55 | #define init_new_context(tsk,mm) (__init_new_context(tsk,mm),0) |
51 | 56 | ||
52 | #else | 57 | #else |
53 | 58 | ||
54 | #define check_context(mm) do { } while (0) | 59 | static inline void check_context(struct mm_struct *mm) |
60 | { | ||
61 | if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq)) | ||
62 | __check_kvm_seq(mm); | ||
63 | } | ||
64 | |||
55 | #define init_new_context(tsk,mm) 0 | 65 | #define init_new_context(tsk,mm) 0 |
56 | 66 | ||
57 | #endif | 67 | #endif |
@@ -82,6 +92,7 @@ static inline void | |||
82 | switch_mm(struct mm_struct *prev, struct mm_struct *next, | 92 | switch_mm(struct mm_struct *prev, struct mm_struct *next, |
83 | struct task_struct *tsk) | 93 | struct task_struct *tsk) |
84 | { | 94 | { |
95 | #ifdef CONFIG_MMU | ||
85 | unsigned int cpu = smp_processor_id(); | 96 | unsigned int cpu = smp_processor_id(); |
86 | 97 | ||
87 | if (prev != next) { | 98 | if (prev != next) { |
@@ -91,6 +102,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
91 | if (cache_is_vivt()) | 102 | if (cache_is_vivt()) |
92 | cpu_clear(cpu, prev->cpu_vm_mask); | 103 | cpu_clear(cpu, prev->cpu_vm_mask); |
93 | } | 104 | } |
105 | #endif | ||
94 | } | 106 | } |
95 | 107 | ||
96 | #define deactivate_mm(tsk,mm) do { } while (0) | 108 | #define deactivate_mm(tsk,mm) do { } while (0) |
diff --git a/include/asm-arm/page-nommu.h b/include/asm-arm/page-nommu.h new file mode 100644 index 000000000000..a1bcad060480 --- /dev/null +++ b/include/asm-arm/page-nommu.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/page-nommu.h | ||
3 | * | ||
4 | * Copyright (C) 2004 Hyok S. Choi | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef _ASMARM_PAGE_NOMMU_H | ||
11 | #define _ASMARM_PAGE_NOMMU_H | ||
12 | |||
13 | #if !defined(CONFIG_SMALL_TASKS) && PAGE_SHIFT < 13 | ||
14 | #define KTHREAD_SIZE (8192) | ||
15 | #else | ||
16 | #define KTHREAD_SIZE PAGE_SIZE | ||
17 | #endif | ||
18 | |||
19 | #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) | ||
20 | #define free_user_page(page, addr) free_page(addr) | ||
21 | |||
22 | #define clear_page(page) memset((page), 0, PAGE_SIZE) | ||
23 | #define copy_page(to,from) memcpy((to), (from), PAGE_SIZE) | ||
24 | |||
25 | #define clear_user_page(page, vaddr, pg) clear_page(page) | ||
26 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | ||
27 | |||
28 | /* | ||
29 | * These are used to make use of C type-checking.. | ||
30 | */ | ||
31 | typedef unsigned long pte_t; | ||
32 | typedef unsigned long pmd_t; | ||
33 | typedef unsigned long pgd_t[2]; | ||
34 | typedef unsigned long pgprot_t; | ||
35 | |||
36 | #define pte_val(x) (x) | ||
37 | #define pmd_val(x) (x) | ||
38 | #define pgd_val(x) ((x)[0]) | ||
39 | #define pgprot_val(x) (x) | ||
40 | |||
41 | #define __pte(x) (x) | ||
42 | #define __pmd(x) (x) | ||
43 | #define __pgprot(x) (x) | ||
44 | |||
45 | /* to align the pointer to the (next) page boundary */ | ||
46 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
47 | |||
48 | extern unsigned long memory_start; | ||
49 | extern unsigned long memory_end; | ||
50 | |||
51 | #endif | ||
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index 66cfeb5290ea..63d12f0244c5 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h | |||
@@ -23,6 +23,12 @@ | |||
23 | 23 | ||
24 | #ifndef __ASSEMBLY__ | 24 | #ifndef __ASSEMBLY__ |
25 | 25 | ||
26 | #ifndef CONFIG_MMU | ||
27 | |||
28 | #include "page-nommu.h" | ||
29 | |||
30 | #else | ||
31 | |||
26 | #include <asm/glue.h> | 32 | #include <asm/glue.h> |
27 | 33 | ||
28 | /* | 34 | /* |
@@ -171,6 +177,8 @@ typedef unsigned long pgprot_t; | |||
171 | /* the upper-most page table pointer */ | 177 | /* the upper-most page table pointer */ |
172 | extern pmd_t *top_pmd; | 178 | extern pmd_t *top_pmd; |
173 | 179 | ||
180 | #endif /* CONFIG_MMU */ | ||
181 | |||
174 | #include <asm/memory.h> | 182 | #include <asm/memory.h> |
175 | 183 | ||
176 | #endif /* !__ASSEMBLY__ */ | 184 | #endif /* !__ASSEMBLY__ */ |
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h index c4ac2e67768d..4d4394552911 100644 --- a/include/asm-arm/pgalloc.h +++ b/include/asm-arm/pgalloc.h | |||
@@ -16,6 +16,10 @@ | |||
16 | #include <asm/cacheflush.h> | 16 | #include <asm/cacheflush.h> |
17 | #include <asm/tlbflush.h> | 17 | #include <asm/tlbflush.h> |
18 | 18 | ||
19 | #define check_pgt_cache() do { } while (0) | ||
20 | |||
21 | #ifdef CONFIG_MMU | ||
22 | |||
19 | #define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER)) | 23 | #define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER)) |
20 | #define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL)) | 24 | #define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL)) |
21 | 25 | ||
@@ -32,8 +36,6 @@ extern void free_pgd_slow(pgd_t *pgd); | |||
32 | #define pgd_alloc(mm) get_pgd_slow(mm) | 36 | #define pgd_alloc(mm) get_pgd_slow(mm) |
33 | #define pgd_free(pgd) free_pgd_slow(pgd) | 37 | #define pgd_free(pgd) free_pgd_slow(pgd) |
34 | 38 | ||
35 | #define check_pgt_cache() do { } while (0) | ||
36 | |||
37 | /* | 39 | /* |
38 | * Allocate one PTE table. | 40 | * Allocate one PTE table. |
39 | * | 41 | * |
@@ -126,4 +128,6 @@ pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep) | |||
126 | __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE); | 128 | __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE); |
127 | } | 129 | } |
128 | 130 | ||
131 | #endif /* CONFIG_MMU */ | ||
132 | |||
129 | #endif | 133 | #endif |
diff --git a/include/asm-arm/pgtable-hwdef.h b/include/asm-arm/pgtable-hwdef.h index 1bc1f997bda2..f3b5120c99fe 100644 --- a/include/asm-arm/pgtable-hwdef.h +++ b/include/asm-arm/pgtable-hwdef.h | |||
@@ -28,6 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | #define PMD_SECT_BUFFERABLE (1 << 2) | 29 | #define PMD_SECT_BUFFERABLE (1 << 2) |
30 | #define PMD_SECT_CACHEABLE (1 << 3) | 30 | #define PMD_SECT_CACHEABLE (1 << 3) |
31 | #define PMD_SECT_XN (1 << 4) /* v6 */ | ||
31 | #define PMD_SECT_AP_WRITE (1 << 10) | 32 | #define PMD_SECT_AP_WRITE (1 << 10) |
32 | #define PMD_SECT_AP_READ (1 << 11) | 33 | #define PMD_SECT_AP_READ (1 << 11) |
33 | #define PMD_SECT_TEX(x) ((x) << 12) /* v5 */ | 34 | #define PMD_SECT_TEX(x) ((x) << 12) /* v5 */ |
diff --git a/include/asm-arm/pgtable-nommu.h b/include/asm-arm/pgtable-nommu.h new file mode 100644 index 000000000000..b13322dccf41 --- /dev/null +++ b/include/asm-arm/pgtable-nommu.h | |||
@@ -0,0 +1,123 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/pgtable-nommu.h | ||
3 | * | ||
4 | * Copyright (C) 1995-2002 Russell King | ||
5 | * Copyright (C) 2004 Hyok S. Choi | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef _ASMARM_PGTABLE_NOMMU_H | ||
12 | #define _ASMARM_PGTABLE_NOMMU_H | ||
13 | |||
14 | #ifndef __ASSEMBLY__ | ||
15 | |||
16 | #include <linux/config.h> | ||
17 | #include <linux/slab.h> | ||
18 | #include <asm/processor.h> | ||
19 | #include <asm/page.h> | ||
20 | #include <asm/io.h> | ||
21 | |||
22 | /* | ||
23 | * Trivial page table functions. | ||
24 | */ | ||
25 | #define pgd_present(pgd) (1) | ||
26 | #define pgd_none(pgd) (0) | ||
27 | #define pgd_bad(pgd) (0) | ||
28 | #define pgd_clear(pgdp) | ||
29 | #define kern_addr_valid(addr) (1) | ||
30 | #define pmd_offset(a, b) ((void *)0) | ||
31 | /* FIXME */ | ||
32 | /* | ||
33 | * PMD_SHIFT determines the size of the area a second-level page table can map | ||
34 | * PGDIR_SHIFT determines what a third-level page table entry can map | ||
35 | */ | ||
36 | #define PGDIR_SHIFT 21 | ||
37 | |||
38 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | ||
39 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | ||
40 | /* FIXME */ | ||
41 | |||
42 | #define PAGE_NONE __pgprot(0) | ||
43 | #define PAGE_SHARED __pgprot(0) | ||
44 | #define PAGE_COPY __pgprot(0) | ||
45 | #define PAGE_READONLY __pgprot(0) | ||
46 | #define PAGE_KERNEL __pgprot(0) | ||
47 | |||
48 | //extern void paging_init(struct meminfo *, struct machine_desc *); | ||
49 | #define swapper_pg_dir ((pgd_t *) 0) | ||
50 | |||
51 | #define __swp_type(x) (0) | ||
52 | #define __swp_offset(x) (0) | ||
53 | #define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) | ||
54 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | ||
55 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | ||
56 | |||
57 | |||
58 | typedef pte_t *pte_addr_t; | ||
59 | |||
60 | static inline int pte_file(pte_t pte) { return 0; } | ||
61 | |||
62 | /* | ||
63 | * ZERO_PAGE is a global shared page that is always zero: used | ||
64 | * for zero-mapped memory areas etc.. | ||
65 | */ | ||
66 | #define ZERO_PAGE(vaddr) (virt_to_page(0)) | ||
67 | |||
68 | /* | ||
69 | * Mark the prot value as uncacheable and unbufferable. | ||
70 | */ | ||
71 | #define pgprot_noncached(prot) __pgprot(0) | ||
72 | #define pgprot_writecombine(prot) __pgprot(0) | ||
73 | |||
74 | |||
75 | /* | ||
76 | * These would be in other places but having them here reduces the diffs. | ||
77 | */ | ||
78 | extern unsigned int kobjsize(const void *objp); | ||
79 | extern int is_in_rom(unsigned long); | ||
80 | |||
81 | /* | ||
82 | * No page table caches to initialise. | ||
83 | */ | ||
84 | #define pgtable_cache_init() do { } while (0) | ||
85 | #define io_remap_page_range remap_page_range | ||
86 | #define io_remap_pfn_range remap_pfn_range | ||
87 | |||
88 | #define MK_IOSPACE_PFN(space, pfn) (pfn) | ||
89 | #define GET_IOSPACE(pfn) 0 | ||
90 | #define GET_PFN(pfn) (pfn) | ||
91 | |||
92 | |||
93 | /* | ||
94 | * All 32bit addresses are effectively valid for vmalloc... | ||
95 | * Sort of meaningless for non-VM targets. | ||
96 | */ | ||
97 | #define VMALLOC_START 0 | ||
98 | #define VMALLOC_END 0xffffffff | ||
99 | |||
100 | #define FIRST_USER_ADDRESS (0) | ||
101 | |||
102 | #else | ||
103 | |||
104 | /* | ||
105 | * dummy tlb and user structures. | ||
106 | */ | ||
107 | #define v3_tlb_fns (0) | ||
108 | #define v4_tlb_fns (0) | ||
109 | #define v4wb_tlb_fns (0) | ||
110 | #define v4wbi_tlb_fns (0) | ||
111 | #define v6_tlb_fns (0) | ||
112 | |||
113 | #define v3_user_fns (0) | ||
114 | #define v4_user_fns (0) | ||
115 | #define v4_mc_user_fns (0) | ||
116 | #define v4wb_user_fns (0) | ||
117 | #define v4wt_user_fns (0) | ||
118 | #define v6_user_fns (0) | ||
119 | #define xscale_mc_user_fns (0) | ||
120 | |||
121 | #endif /*__ASSEMBLY__*/ | ||
122 | |||
123 | #endif /* _ASMARM_PGTABLE_H */ | ||
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index e85c08d78dda..8d3919c6458c 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -11,9 +11,15 @@ | |||
11 | #define _ASMARM_PGTABLE_H | 11 | #define _ASMARM_PGTABLE_H |
12 | 12 | ||
13 | #include <asm-generic/4level-fixup.h> | 13 | #include <asm-generic/4level-fixup.h> |
14 | #include <asm/proc-fns.h> | ||
15 | |||
16 | #ifndef CONFIG_MMU | ||
17 | |||
18 | #include "pgtable-nommu.h" | ||
19 | |||
20 | #else | ||
14 | 21 | ||
15 | #include <asm/memory.h> | 22 | #include <asm/memory.h> |
16 | #include <asm/proc-fns.h> | ||
17 | #include <asm/arch/vmalloc.h> | 23 | #include <asm/arch/vmalloc.h> |
18 | 24 | ||
19 | /* | 25 | /* |
@@ -378,4 +384,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
378 | 384 | ||
379 | #endif /* !__ASSEMBLY__ */ | 385 | #endif /* !__ASSEMBLY__ */ |
380 | 386 | ||
387 | #endif /* CONFIG_MMU */ | ||
388 | |||
381 | #endif /* _ASMARM_PGTABLE_H */ | 389 | #endif /* _ASMARM_PGTABLE_H */ |
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h index e9310895e79d..1bde92cdaebd 100644 --- a/include/asm-arm/proc-fns.h +++ b/include/asm-arm/proc-fns.h | |||
@@ -165,6 +165,8 @@ | |||
165 | 165 | ||
166 | #include <asm/memory.h> | 166 | #include <asm/memory.h> |
167 | 167 | ||
168 | #ifdef CONFIG_MMU | ||
169 | |||
168 | #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) | 170 | #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) |
169 | 171 | ||
170 | #define cpu_get_pgd() \ | 172 | #define cpu_get_pgd() \ |
@@ -176,6 +178,8 @@ | |||
176 | (pgd_t *)phys_to_virt(pg); \ | 178 | (pgd_t *)phys_to_virt(pg); \ |
177 | }) | 179 | }) |
178 | 180 | ||
181 | #endif | ||
182 | |||
179 | #endif /* __ASSEMBLY__ */ | 183 | #endif /* __ASSEMBLY__ */ |
180 | #endif /* __KERNEL__ */ | 184 | #endif /* __KERNEL__ */ |
181 | #endif /* __ASM_PROCFNS_H */ | 185 | #endif /* __ASM_PROCFNS_H */ |
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h index 842526055225..edb7b6502fcf 100644 --- a/include/asm-arm/procinfo.h +++ b/include/asm-arm/procinfo.h | |||
@@ -29,7 +29,8 @@ struct processor; | |||
29 | struct proc_info_list { | 29 | struct proc_info_list { |
30 | unsigned int cpu_val; | 30 | unsigned int cpu_val; |
31 | unsigned int cpu_mask; | 31 | unsigned int cpu_mask; |
32 | unsigned long __cpu_mmu_flags; /* used by head.S */ | 32 | unsigned long __cpu_mm_mmu_flags; /* used by head.S */ |
33 | unsigned long __cpu_io_mmu_flags; /* used by head.S */ | ||
33 | unsigned long __cpu_flush; /* used by head.S */ | 34 | unsigned long __cpu_flush; /* used by head.S */ |
34 | const char *arch_name; | 35 | const char *arch_name; |
35 | const char *elf_name; | 36 | const char *elf_name; |
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h index 2bebe3dc0a30..5a8ef787dbf8 100644 --- a/include/asm-arm/ptrace.h +++ b/include/asm-arm/ptrace.h | |||
@@ -25,6 +25,11 @@ | |||
25 | 25 | ||
26 | #define PTRACE_SET_SYSCALL 23 | 26 | #define PTRACE_SET_SYSCALL 23 |
27 | 27 | ||
28 | /* PTRACE_SYSCALL is 24 */ | ||
29 | |||
30 | #define PTRACE_GETCRUNCHREGS 25 | ||
31 | #define PTRACE_SETCRUNCHREGS 26 | ||
32 | |||
28 | /* | 33 | /* |
29 | * PSR bits | 34 | * PSR bits |
30 | */ | 35 | */ |
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h index ced69161917b..d0fb487aba4f 100644 --- a/include/asm-arm/signal.h +++ b/include/asm-arm/signal.h | |||
@@ -82,7 +82,6 @@ typedef unsigned long sigset_t; | |||
82 | * is running in 26-bit. | 82 | * is running in 26-bit. |
83 | * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)). | 83 | * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)). |
84 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 84 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
85 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
86 | * SA_NODEFER prevents the current signal from being masked in the handler. | 85 | * SA_NODEFER prevents the current signal from being masked in the handler. |
87 | * SA_RESETHAND clears the handler when the signal is delivered. | 86 | * SA_RESETHAND clears the handler when the signal is delivered. |
88 | * | 87 | * |
@@ -101,7 +100,6 @@ typedef unsigned long sigset_t; | |||
101 | 100 | ||
102 | #define SA_NOMASK SA_NODEFER | 101 | #define SA_NOMASK SA_NODEFER |
103 | #define SA_ONESHOT SA_RESETHAND | 102 | #define SA_ONESHOT SA_RESETHAND |
104 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
105 | 103 | ||
106 | 104 | ||
107 | /* | 105 | /* |
@@ -113,10 +111,6 @@ typedef unsigned long sigset_t; | |||
113 | #define MINSIGSTKSZ 2048 | 111 | #define MINSIGSTKSZ 2048 |
114 | #define SIGSTKSZ 8192 | 112 | #define SIGSTKSZ 8192 |
115 | 113 | ||
116 | #ifdef __KERNEL__ | ||
117 | #define SA_TIMER 0x40000000 | ||
118 | #endif | ||
119 | |||
120 | #include <asm-generic/signal.h> | 114 | #include <asm-generic/signal.h> |
121 | 115 | ||
122 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
diff --git a/include/asm-arm/socket.h b/include/asm-arm/socket.h index 3c51da6438c9..19f7df702b06 100644 --- a/include/asm-arm/socket.h +++ b/include/asm-arm/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index cfbccb63c67b..f28b236139ed 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h | |||
@@ -59,6 +59,7 @@ struct thread_info { | |||
59 | struct cpu_context_save cpu_context; /* cpu context */ | 59 | struct cpu_context_save cpu_context; /* cpu context */ |
60 | __u8 used_cp[16]; /* thread used copro */ | 60 | __u8 used_cp[16]; /* thread used copro */ |
61 | unsigned long tp_value; | 61 | unsigned long tp_value; |
62 | struct crunch_state crunchstate; | ||
62 | union fp_state fpstate __attribute__((aligned(8))); | 63 | union fp_state fpstate __attribute__((aligned(8))); |
63 | union vfp_state vfpstate; | 64 | union vfp_state vfpstate; |
64 | struct restart_block restart_block; | 65 | struct restart_block restart_block; |
@@ -101,16 +102,22 @@ extern void free_thread_info(struct thread_info *); | |||
101 | #define thread_saved_fp(tsk) \ | 102 | #define thread_saved_fp(tsk) \ |
102 | ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) | 103 | ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) |
103 | 104 | ||
105 | extern void crunch_task_disable(struct thread_info *); | ||
106 | extern void crunch_task_copy(struct thread_info *, void *); | ||
107 | extern void crunch_task_restore(struct thread_info *, void *); | ||
108 | extern void crunch_task_release(struct thread_info *); | ||
109 | |||
104 | extern void iwmmxt_task_disable(struct thread_info *); | 110 | extern void iwmmxt_task_disable(struct thread_info *); |
105 | extern void iwmmxt_task_copy(struct thread_info *, void *); | 111 | extern void iwmmxt_task_copy(struct thread_info *, void *); |
106 | extern void iwmmxt_task_restore(struct thread_info *, void *); | 112 | extern void iwmmxt_task_restore(struct thread_info *, void *); |
107 | extern void iwmmxt_task_release(struct thread_info *); | 113 | extern void iwmmxt_task_release(struct thread_info *); |
114 | extern void iwmmxt_task_switch(struct thread_info *); | ||
108 | 115 | ||
109 | #endif | 116 | #endif |
110 | 117 | ||
111 | /* | 118 | /* |
112 | * We use bit 30 of the preempt_count to indicate that kernel | 119 | * We use bit 30 of the preempt_count to indicate that kernel |
113 | * preemption is occuring. See include/asm-arm/hardirq.h. | 120 | * preemption is occurring. See include/asm-arm/hardirq.h. |
114 | */ | 121 | */ |
115 | #define PREEMPT_ACTIVE 0x40000000 | 122 | #define PREEMPT_ACTIVE 0x40000000 |
116 | 123 | ||
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index 064f0f5e8e2b..87aba57a66c4 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h | |||
@@ -41,15 +41,24 @@ struct exception_table_entry | |||
41 | extern int fixup_exception(struct pt_regs *regs); | 41 | extern int fixup_exception(struct pt_regs *regs); |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * These two are intentionally not defined anywhere - if the kernel | ||
45 | * code generates any references to them, that's a bug. | ||
46 | */ | ||
47 | extern int __get_user_bad(void); | ||
48 | extern int __put_user_bad(void); | ||
49 | |||
50 | /* | ||
44 | * Note that this is actually 0x1,0000,0000 | 51 | * Note that this is actually 0x1,0000,0000 |
45 | */ | 52 | */ |
46 | #define KERNEL_DS 0x00000000 | 53 | #define KERNEL_DS 0x00000000 |
47 | #define USER_DS TASK_SIZE | ||
48 | |||
49 | #define get_ds() (KERNEL_DS) | 54 | #define get_ds() (KERNEL_DS) |
55 | |||
56 | #ifdef CONFIG_MMU | ||
57 | |||
58 | #define USER_DS TASK_SIZE | ||
50 | #define get_fs() (current_thread_info()->addr_limit) | 59 | #define get_fs() (current_thread_info()->addr_limit) |
51 | 60 | ||
52 | static inline void set_fs (mm_segment_t fs) | 61 | static inline void set_fs(mm_segment_t fs) |
53 | { | 62 | { |
54 | current_thread_info()->addr_limit = fs; | 63 | current_thread_info()->addr_limit = fs; |
55 | modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER); | 64 | modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER); |
@@ -75,8 +84,6 @@ static inline void set_fs (mm_segment_t fs) | |||
75 | : "cc"); \ | 84 | : "cc"); \ |
76 | flag; }) | 85 | flag; }) |
77 | 86 | ||
78 | #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) | ||
79 | |||
80 | /* | 87 | /* |
81 | * Single-value transfer routines. They automatically use the right | 88 | * Single-value transfer routines. They automatically use the right |
82 | * size if we just have the right pointer type. Note that the functions | 89 | * size if we just have the right pointer type. Note that the functions |
@@ -87,20 +94,10 @@ static inline void set_fs (mm_segment_t fs) | |||
87 | * fixup code, but there are a few places where it intrudes on the | 94 | * fixup code, but there are a few places where it intrudes on the |
88 | * main code path. When we only write to user space, there is no | 95 | * main code path. When we only write to user space, there is no |
89 | * problem. | 96 | * problem. |
90 | * | ||
91 | * The "__xxx" versions of the user access functions do not verify the | ||
92 | * address space - it must have been done previously with a separate | ||
93 | * "access_ok()" call. | ||
94 | * | ||
95 | * The "xxx_error" versions set the third argument to EFAULT if an | ||
96 | * error occurs, and leave it unchanged on success. Note that these | ||
97 | * versions are void (ie, don't return a value as such). | ||
98 | */ | 97 | */ |
99 | |||
100 | extern int __get_user_1(void *); | 98 | extern int __get_user_1(void *); |
101 | extern int __get_user_2(void *); | 99 | extern int __get_user_2(void *); |
102 | extern int __get_user_4(void *); | 100 | extern int __get_user_4(void *); |
103 | extern int __get_user_bad(void); | ||
104 | 101 | ||
105 | #define __get_user_x(__r2,__p,__e,__s,__i...) \ | 102 | #define __get_user_x(__r2,__p,__e,__s,__i...) \ |
106 | __asm__ __volatile__ ( \ | 103 | __asm__ __volatile__ ( \ |
@@ -131,6 +128,74 @@ extern int __get_user_bad(void); | |||
131 | __e; \ | 128 | __e; \ |
132 | }) | 129 | }) |
133 | 130 | ||
131 | extern int __put_user_1(void *, unsigned int); | ||
132 | extern int __put_user_2(void *, unsigned int); | ||
133 | extern int __put_user_4(void *, unsigned int); | ||
134 | extern int __put_user_8(void *, unsigned long long); | ||
135 | |||
136 | #define __put_user_x(__r2,__p,__e,__s) \ | ||
137 | __asm__ __volatile__ ( \ | ||
138 | __asmeq("%0", "r0") __asmeq("%2", "r2") \ | ||
139 | "bl __put_user_" #__s \ | ||
140 | : "=&r" (__e) \ | ||
141 | : "0" (__p), "r" (__r2) \ | ||
142 | : "ip", "lr", "cc") | ||
143 | |||
144 | #define put_user(x,p) \ | ||
145 | ({ \ | ||
146 | const register typeof(*(p)) __r2 asm("r2") = (x); \ | ||
147 | const register typeof(*(p)) __user *__p asm("r0") = (p);\ | ||
148 | register int __e asm("r0"); \ | ||
149 | switch (sizeof(*(__p))) { \ | ||
150 | case 1: \ | ||
151 | __put_user_x(__r2, __p, __e, 1); \ | ||
152 | break; \ | ||
153 | case 2: \ | ||
154 | __put_user_x(__r2, __p, __e, 2); \ | ||
155 | break; \ | ||
156 | case 4: \ | ||
157 | __put_user_x(__r2, __p, __e, 4); \ | ||
158 | break; \ | ||
159 | case 8: \ | ||
160 | __put_user_x(__r2, __p, __e, 8); \ | ||
161 | break; \ | ||
162 | default: __e = __put_user_bad(); break; \ | ||
163 | } \ | ||
164 | __e; \ | ||
165 | }) | ||
166 | |||
167 | #else /* CONFIG_MMU */ | ||
168 | |||
169 | /* | ||
170 | * uClinux has only one addr space, so has simplified address limits. | ||
171 | */ | ||
172 | #define USER_DS KERNEL_DS | ||
173 | |||
174 | #define segment_eq(a,b) (1) | ||
175 | #define __addr_ok(addr) (1) | ||
176 | #define __range_ok(addr,size) (0) | ||
177 | #define get_fs() (KERNEL_DS) | ||
178 | |||
179 | static inline void set_fs(mm_segment_t fs) | ||
180 | { | ||
181 | } | ||
182 | |||
183 | #define get_user(x,p) __get_user(x,p) | ||
184 | #define put_user(x,p) __put_user(x,p) | ||
185 | |||
186 | #endif /* CONFIG_MMU */ | ||
187 | |||
188 | #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) | ||
189 | |||
190 | /* | ||
191 | * The "__xxx" versions of the user access functions do not verify the | ||
192 | * address space - it must have been done previously with a separate | ||
193 | * "access_ok()" call. | ||
194 | * | ||
195 | * The "xxx_error" versions set the third argument to EFAULT if an | ||
196 | * error occurs, and leave it unchanged on success. Note that these | ||
197 | * versions are void (ie, don't return a value as such). | ||
198 | */ | ||
134 | #define __get_user(x,ptr) \ | 199 | #define __get_user(x,ptr) \ |
135 | ({ \ | 200 | ({ \ |
136 | long __gu_err = 0; \ | 201 | long __gu_err = 0; \ |
@@ -212,43 +277,6 @@ do { \ | |||
212 | : "r" (addr), "i" (-EFAULT) \ | 277 | : "r" (addr), "i" (-EFAULT) \ |
213 | : "cc") | 278 | : "cc") |
214 | 279 | ||
215 | extern int __put_user_1(void *, unsigned int); | ||
216 | extern int __put_user_2(void *, unsigned int); | ||
217 | extern int __put_user_4(void *, unsigned int); | ||
218 | extern int __put_user_8(void *, unsigned long long); | ||
219 | extern int __put_user_bad(void); | ||
220 | |||
221 | #define __put_user_x(__r2,__p,__e,__s) \ | ||
222 | __asm__ __volatile__ ( \ | ||
223 | __asmeq("%0", "r0") __asmeq("%2", "r2") \ | ||
224 | "bl __put_user_" #__s \ | ||
225 | : "=&r" (__e) \ | ||
226 | : "0" (__p), "r" (__r2) \ | ||
227 | : "ip", "lr", "cc") | ||
228 | |||
229 | #define put_user(x,p) \ | ||
230 | ({ \ | ||
231 | const register typeof(*(p)) __r2 asm("r2") = (x); \ | ||
232 | const register typeof(*(p)) __user *__p asm("r0") = (p);\ | ||
233 | register int __e asm("r0"); \ | ||
234 | switch (sizeof(*(__p))) { \ | ||
235 | case 1: \ | ||
236 | __put_user_x(__r2, __p, __e, 1); \ | ||
237 | break; \ | ||
238 | case 2: \ | ||
239 | __put_user_x(__r2, __p, __e, 2); \ | ||
240 | break; \ | ||
241 | case 4: \ | ||
242 | __put_user_x(__r2, __p, __e, 4); \ | ||
243 | break; \ | ||
244 | case 8: \ | ||
245 | __put_user_x(__r2, __p, __e, 8); \ | ||
246 | break; \ | ||
247 | default: __e = __put_user_bad(); break; \ | ||
248 | } \ | ||
249 | __e; \ | ||
250 | }) | ||
251 | |||
252 | #define __put_user(x,ptr) \ | 280 | #define __put_user(x,ptr) \ |
253 | ({ \ | 281 | ({ \ |
254 | long __pu_err = 0; \ | 282 | long __pu_err = 0; \ |
@@ -353,66 +381,54 @@ do { \ | |||
353 | : "r" (x), "i" (-EFAULT) \ | 381 | : "r" (x), "i" (-EFAULT) \ |
354 | : "cc") | 382 | : "cc") |
355 | 383 | ||
356 | extern unsigned long __arch_copy_from_user(void *to, const void __user *from, unsigned long n); | 384 | |
357 | extern unsigned long __arch_copy_to_user(void __user *to, const void *from, unsigned long n); | 385 | #ifdef CONFIG_MMU |
358 | extern unsigned long __arch_clear_user(void __user *addr, unsigned long n); | 386 | extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n); |
359 | extern unsigned long __arch_strncpy_from_user(char *to, const char __user *from, unsigned long count); | 387 | extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n); |
360 | extern unsigned long __arch_strnlen_user(const char __user *s, long n); | 388 | extern unsigned long __clear_user(void __user *addr, unsigned long n); |
389 | #else | ||
390 | #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) | ||
391 | #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) | ||
392 | #define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0) | ||
393 | #endif | ||
394 | |||
395 | extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count); | ||
396 | extern unsigned long __strnlen_user(const char __user *s, long n); | ||
361 | 397 | ||
362 | static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) | 398 | static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) |
363 | { | 399 | { |
364 | if (access_ok(VERIFY_READ, from, n)) | 400 | if (access_ok(VERIFY_READ, from, n)) |
365 | n = __arch_copy_from_user(to, from, n); | 401 | n = __copy_from_user(to, from, n); |
366 | else /* security hole - plug it */ | 402 | else /* security hole - plug it */ |
367 | memzero(to, n); | 403 | memzero(to, n); |
368 | return n; | 404 | return n; |
369 | } | 405 | } |
370 | 406 | ||
371 | static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) | ||
372 | { | ||
373 | return __arch_copy_from_user(to, from, n); | ||
374 | } | ||
375 | |||
376 | static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) | 407 | static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) |
377 | { | 408 | { |
378 | if (access_ok(VERIFY_WRITE, to, n)) | 409 | if (access_ok(VERIFY_WRITE, to, n)) |
379 | n = __arch_copy_to_user(to, from, n); | 410 | n = __copy_to_user(to, from, n); |
380 | return n; | 411 | return n; |
381 | } | 412 | } |
382 | 413 | ||
383 | static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n) | ||
384 | { | ||
385 | return __arch_copy_to_user(to, from, n); | ||
386 | } | ||
387 | |||
388 | #define __copy_to_user_inatomic __copy_to_user | 414 | #define __copy_to_user_inatomic __copy_to_user |
389 | #define __copy_from_user_inatomic __copy_from_user | 415 | #define __copy_from_user_inatomic __copy_from_user |
390 | 416 | ||
391 | static inline unsigned long clear_user (void __user *to, unsigned long n) | 417 | static inline unsigned long clear_user(void __user *to, unsigned long n) |
392 | { | 418 | { |
393 | if (access_ok(VERIFY_WRITE, to, n)) | 419 | if (access_ok(VERIFY_WRITE, to, n)) |
394 | n = __arch_clear_user(to, n); | 420 | n = __clear_user(to, n); |
395 | return n; | 421 | return n; |
396 | } | 422 | } |
397 | 423 | ||
398 | static inline unsigned long __clear_user (void __user *to, unsigned long n) | 424 | static inline long strncpy_from_user(char *dst, const char __user *src, long count) |
399 | { | ||
400 | return __arch_clear_user(to, n); | ||
401 | } | ||
402 | |||
403 | static inline long strncpy_from_user (char *dst, const char __user *src, long count) | ||
404 | { | 425 | { |
405 | long res = -EFAULT; | 426 | long res = -EFAULT; |
406 | if (access_ok(VERIFY_READ, src, 1)) | 427 | if (access_ok(VERIFY_READ, src, 1)) |
407 | res = __arch_strncpy_from_user(dst, src, count); | 428 | res = __strncpy_from_user(dst, src, count); |
408 | return res; | 429 | return res; |
409 | } | 430 | } |
410 | 431 | ||
411 | static inline long __strncpy_from_user (char *dst, const char __user *src, long count) | ||
412 | { | ||
413 | return __arch_strncpy_from_user(dst, src, count); | ||
414 | } | ||
415 | |||
416 | #define strlen_user(s) strnlen_user(s, ~0UL >> 1) | 432 | #define strlen_user(s) strnlen_user(s, ~0UL >> 1) |
417 | 433 | ||
418 | static inline long strnlen_user(const char __user *s, long n) | 434 | static inline long strnlen_user(const char __user *s, long n) |
@@ -420,7 +436,7 @@ static inline long strnlen_user(const char __user *s, long n) | |||
420 | unsigned long res = 0; | 436 | unsigned long res = 0; |
421 | 437 | ||
422 | if (__addr_ok(s)) | 438 | if (__addr_ok(s)) |
423 | res = __arch_strnlen_user(s, n); | 439 | res = __strnlen_user(s, n); |
424 | 440 | ||
425 | return res; | 441 | return res; |
426 | } | 442 | } |
diff --git a/include/asm-arm/ucontext.h b/include/asm-arm/ucontext.h index 9e6f7ca9f5ae..bf65e9f4525d 100644 --- a/include/asm-arm/ucontext.h +++ b/include/asm-arm/ucontext.h | |||
@@ -35,6 +35,17 @@ struct ucontext { | |||
35 | * bytes, to prevent unpredictable padding in the signal frame. | 35 | * bytes, to prevent unpredictable padding in the signal frame. |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #ifdef CONFIG_CRUNCH | ||
39 | #define CRUNCH_MAGIC 0x5065cf03 | ||
40 | #define CRUNCH_STORAGE_SIZE (CRUNCH_SIZE + 8) | ||
41 | |||
42 | struct crunch_sigframe { | ||
43 | unsigned long magic; | ||
44 | unsigned long size; | ||
45 | struct crunch_state storage; | ||
46 | } __attribute__((__aligned__(8))); | ||
47 | #endif | ||
48 | |||
38 | #ifdef CONFIG_IWMMXT | 49 | #ifdef CONFIG_IWMMXT |
39 | /* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */ | 50 | /* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */ |
40 | #define IWMMXT_MAGIC 0x12ef842a | 51 | #define IWMMXT_MAGIC 0x12ef842a |
@@ -74,6 +85,9 @@ struct vfp_sigframe | |||
74 | * one of these. | 85 | * one of these. |
75 | */ | 86 | */ |
76 | struct aux_sigframe { | 87 | struct aux_sigframe { |
88 | #ifdef CONFIG_CRUNCH | ||
89 | struct crunch_sigframe crunch; | ||
90 | #endif | ||
77 | #ifdef CONFIG_IWMMXT | 91 | #ifdef CONFIG_IWMMXT |
78 | struct iwmmxt_sigframe iwmmxt; | 92 | struct iwmmxt_sigframe iwmmxt; |
79 | #endif | 93 | #endif |
diff --git a/include/asm-arm26/Kbuild b/include/asm-arm26/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-arm26/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-arm26/floppy.h b/include/asm-arm26/floppy.h index a18af069ca28..efb732165a4f 100644 --- a/include/asm-arm26/floppy.h +++ b/include/asm-arm26/floppy.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #define fd_inb(port) inb((port)) | 23 | #define fd_inb(port) inb((port)) |
24 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ | 24 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ |
25 | SA_INTERRUPT,"floppy",NULL) | 25 | IRQF_DISABLED,"floppy",NULL) |
26 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) | 26 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) |
27 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) | 27 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) |
28 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) | 28 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) |
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h index 37ad25355591..967ba4947e40 100644 --- a/include/asm-arm26/signal.h +++ b/include/asm-arm26/signal.h | |||
@@ -82,7 +82,6 @@ typedef unsigned long sigset_t; | |||
82 | * is running in 26-bit. | 82 | * is running in 26-bit. |
83 | * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)). | 83 | * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)). |
84 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 84 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
85 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
86 | * SA_NODEFER prevents the current signal from being masked in the handler. | 85 | * SA_NODEFER prevents the current signal from being masked in the handler. |
87 | * SA_RESETHAND clears the handler when the signal is delivered. | 86 | * SA_RESETHAND clears the handler when the signal is delivered. |
88 | * | 87 | * |
@@ -101,7 +100,6 @@ typedef unsigned long sigset_t; | |||
101 | 100 | ||
102 | #define SA_NOMASK SA_NODEFER | 101 | #define SA_NOMASK SA_NODEFER |
103 | #define SA_ONESHOT SA_RESETHAND | 102 | #define SA_ONESHOT SA_RESETHAND |
104 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
105 | 103 | ||
106 | 104 | ||
107 | /* | 105 | /* |
diff --git a/include/asm-arm26/socket.h b/include/asm-arm26/socket.h index 3c51da6438c9..19f7df702b06 100644 --- a/include/asm-arm26/socket.h +++ b/include/asm-arm26/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-cris/Kbuild b/include/asm-cris/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-cris/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-cris/arch-v10/irq.h b/include/asm-cris/arch-v10/irq.h index 4fa8945b0263..b1128a9984ae 100644 --- a/include/asm-cris/arch-v10/irq.h +++ b/include/asm-cris/arch-v10/irq.h | |||
@@ -141,7 +141,7 @@ __asm__ ( \ | |||
141 | * it here, we would not get the multiple_irq at all. | 141 | * it here, we would not get the multiple_irq at all. |
142 | * | 142 | * |
143 | * The non-blocking here is based on the knowledge that the timer interrupt is | 143 | * The non-blocking here is based on the knowledge that the timer interrupt is |
144 | * registred as a fast interrupt (SA_INTERRUPT) so that we _know_ there will not | 144 | * registred as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not |
145 | * be an sti() before the timer irq handler is run to acknowledge the interrupt. | 145 | * be an sti() before the timer irq handler is run to acknowledge the interrupt. |
146 | */ | 146 | */ |
147 | 147 | ||
diff --git a/include/asm-cris/arch-v32/arbiter.h b/include/asm-cris/arch-v32/arbiter.h index dba3c285cacd..081a911d7af1 100644 --- a/include/asm-cris/arch-v32/arbiter.h +++ b/include/asm-cris/arch-v32/arbiter.h | |||
@@ -20,8 +20,8 @@ enum | |||
20 | arbiter_all_accesses = 0xff | 20 | arbiter_all_accesses = 0xff |
21 | }; | 21 | }; |
22 | 22 | ||
23 | int crisv32_arbiter_allocate_bandwith(int client, int region, | 23 | int crisv32_arbiter_allocate_bandwidth(int client, int region, |
24 | unsigned long bandwidth); | 24 | unsigned long bandwidth); |
25 | int crisv32_arbiter_watch(unsigned long start, unsigned long size, | 25 | int crisv32_arbiter_watch(unsigned long start, unsigned long size, |
26 | unsigned long clients, unsigned long accesses, | 26 | unsigned long clients, unsigned long accesses, |
27 | watch_callback* cb); | 27 | watch_callback* cb); |
diff --git a/include/asm-cris/arch-v32/irq.h b/include/asm-cris/arch-v32/irq.h index eeb0a80262c8..bac94ee6bc90 100644 --- a/include/asm-cris/arch-v32/irq.h +++ b/include/asm-cris/arch-v32/irq.h | |||
@@ -98,7 +98,7 @@ __asm__ ( \ | |||
98 | * if we had BLOCK'edit here, we would not get the multiple_irq at all. | 98 | * if we had BLOCK'edit here, we would not get the multiple_irq at all. |
99 | * | 99 | * |
100 | * The non-blocking here is based on the knowledge that the timer interrupt is | 100 | * The non-blocking here is based on the knowledge that the timer interrupt is |
101 | * registred as a fast interrupt (SA_INTERRUPT) so that we _know_ there will not | 101 | * registred as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not |
102 | * be an sti() before the timer irq handler is run to acknowledge the interrupt. | 102 | * be an sti() before the timer irq handler is run to acknowledge the interrupt. |
103 | */ | 103 | */ |
104 | #define BUILD_TIMER_IRQ(nr, mask) \ | 104 | #define BUILD_TIMER_IRQ(nr, mask) \ |
diff --git a/include/asm-cris/hw_irq.h b/include/asm-cris/hw_irq.h index 341536a234e9..298066020af2 100644 --- a/include/asm-cris/hw_irq.h +++ b/include/asm-cris/hw_irq.h | |||
@@ -1,7 +1,5 @@ | |||
1 | #ifndef _ASM_HW_IRQ_H | 1 | #ifndef _ASM_HW_IRQ_H |
2 | #define _ASM_HW_IRQ_H | 2 | #define _ASM_HW_IRQ_H |
3 | 3 | ||
4 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
5 | |||
6 | #endif | 4 | #endif |
7 | 5 | ||
diff --git a/include/asm-cris/irq.h b/include/asm-cris/irq.h index 4b338792218b..998cce9f3200 100644 --- a/include/asm-cris/irq.h +++ b/include/asm-cris/irq.h | |||
@@ -1,11 +1,6 @@ | |||
1 | #ifndef _ASM_IRQ_H | 1 | #ifndef _ASM_IRQ_H |
2 | #define _ASM_IRQ_H | 2 | #define _ASM_IRQ_H |
3 | 3 | ||
4 | /* | ||
5 | * IRQ line status macro IRQ_PER_CPU is used | ||
6 | */ | ||
7 | #define ARCH_HAS_IRQ_PER_CPU | ||
8 | |||
9 | #include <asm/arch/irq.h> | 4 | #include <asm/arch/irq.h> |
10 | 5 | ||
11 | static inline int irq_canonicalize(int irq) | 6 | static inline int irq_canonicalize(int irq) |
diff --git a/include/asm-cris/signal.h b/include/asm-cris/signal.h index dfe039593a78..349ae682b568 100644 --- a/include/asm-cris/signal.h +++ b/include/asm-cris/signal.h | |||
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t; | |||
74 | * SA_FLAGS values: | 74 | * SA_FLAGS values: |
75 | * | 75 | * |
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | 76 | * SA_ONSTACK indicates that a registered stack_t will be used. |
77 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 77 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
80 | * SA_RESETHAND clears the handler when the signal is delivered. | 79 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -95,7 +94,6 @@ typedef unsigned long sigset_t; | |||
95 | 94 | ||
96 | #define SA_NOMASK SA_NODEFER | 95 | #define SA_NOMASK SA_NODEFER |
97 | #define SA_ONESHOT SA_RESETHAND | 96 | #define SA_ONESHOT SA_RESETHAND |
98 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
99 | 97 | ||
100 | #define SA_RESTORER 0x04000000 | 98 | #define SA_RESTORER 0x04000000 |
101 | 99 | ||
diff --git a/include/asm-cris/socket.h b/include/asm-cris/socket.h index 8b1da3e58c55..01cfdf1d6d33 100644 --- a/include/asm-cris/socket.h +++ b/include/asm-cris/socket.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #define SO_ACCEPTCONN 30 | 50 | #define SO_ACCEPTCONN 30 |
51 | 51 | ||
52 | #define SO_PEERSEC 31 | 52 | #define SO_PEERSEC 31 |
53 | #define SO_PASSSEC 34 | ||
53 | 54 | ||
54 | #endif /* _ASM_SOCKET_H */ | 55 | #endif /* _ASM_SOCKET_H */ |
55 | 56 | ||
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-frv/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h index 38656da00e40..7df58a3e6e4a 100644 --- a/include/asm-frv/elf.h +++ b/include/asm-frv/elf.h | |||
@@ -64,7 +64,7 @@ typedef unsigned long elf_greg_t; | |||
64 | #define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) | 64 | #define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) |
65 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | 65 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
66 | 66 | ||
67 | typedef struct fpmedia_struct elf_fpregset_t; | 67 | typedef struct user_fpmedia_regs elf_fpregset_t; |
68 | 68 | ||
69 | /* | 69 | /* |
70 | * This is used to ensure we don't load something for the wrong architecture. | 70 | * This is used to ensure we don't load something for the wrong architecture. |
@@ -116,6 +116,7 @@ do { \ | |||
116 | } while(0) | 116 | } while(0) |
117 | 117 | ||
118 | #define USE_ELF_CORE_DUMP | 118 | #define USE_ELF_CORE_DUMP |
119 | #define ELF_FDPIC_CORE_EFLAGS EF_FRV_FDPIC | ||
119 | #define ELF_EXEC_PAGESIZE 16384 | 120 | #define ELF_EXEC_PAGESIZE 16384 |
120 | 121 | ||
121 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | 122 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical |
@@ -125,9 +126,6 @@ do { \ | |||
125 | 126 | ||
126 | #define ELF_ET_DYN_BASE 0x08000000UL | 127 | #define ELF_ET_DYN_BASE 0x08000000UL |
127 | 128 | ||
128 | #define ELF_CORE_COPY_REGS(pr_reg, regs) \ | ||
129 | memcpy(&pr_reg[0], ®s->sp, 31 * sizeof(uint32_t)); | ||
130 | |||
131 | /* This yields a mask that user programs can use to figure out what | 129 | /* This yields a mask that user programs can use to figure out what |
132 | instruction set this cpu supports. */ | 130 | instruction set this cpu supports. */ |
133 | 131 | ||
diff --git a/include/asm-frv/gdb-stub.h b/include/asm-frv/gdb-stub.h index c58479a4be99..24f9738670bd 100644 --- a/include/asm-frv/gdb-stub.h +++ b/include/asm-frv/gdb-stub.h | |||
@@ -89,6 +89,7 @@ extern void gdbstub_do_rx(void); | |||
89 | 89 | ||
90 | extern asmlinkage void __debug_stub_init_break(void); | 90 | extern asmlinkage void __debug_stub_init_break(void); |
91 | extern asmlinkage void __break_hijack_kernel_event(void); | 91 | extern asmlinkage void __break_hijack_kernel_event(void); |
92 | extern asmlinkage void __break_hijack_kernel_event_breaks_here(void); | ||
92 | extern asmlinkage void start_kernel(void); | 93 | extern asmlinkage void start_kernel(void); |
93 | 94 | ||
94 | extern asmlinkage void gdbstub_rx_handler(void); | 95 | extern asmlinkage void gdbstub_rx_handler(void); |
@@ -114,5 +115,26 @@ extern void console_set_baud(unsigned baud); | |||
114 | #define gdbstub_proto(FMT,...) ({ 0; }) | 115 | #define gdbstub_proto(FMT,...) ({ 0; }) |
115 | #endif | 116 | #endif |
116 | 117 | ||
118 | /* | ||
119 | * we dedicate GR31 to keeping a pointer to the gdbstub exception frame | ||
120 | * - gr31 is destroyed on entry to the gdbstub if !MMU | ||
121 | * - gr31 is saved in scr3 on entry to the gdbstub if in !MMU | ||
122 | */ | ||
123 | register struct frv_frame0 *__debug_frame0 asm("gr31"); | ||
124 | |||
125 | #define __debug_frame (&__debug_frame0->regs) | ||
126 | #define __debug_user_context (&__debug_frame0->uc) | ||
127 | #define __debug_regs (&__debug_frame0->debug) | ||
128 | #define __debug_reg(X) ((unsigned long *) ((unsigned long) &__debug_frame0 + (X))) | ||
129 | |||
130 | struct frv_debug_status { | ||
131 | unsigned long bpsr; | ||
132 | unsigned long dcr; | ||
133 | unsigned long brr; | ||
134 | unsigned long nmar; | ||
135 | }; | ||
136 | |||
137 | extern struct frv_debug_status __debug_status; | ||
138 | |||
117 | #endif /* _LANGUAGE_ASSEMBLY */ | 139 | #endif /* _LANGUAGE_ASSEMBLY */ |
118 | #endif /* __ASM_GDB_STUB_H */ | 140 | #endif /* __ASM_GDB_STUB_H */ |
diff --git a/include/asm-frv/irq-routing.h b/include/asm-frv/irq-routing.h index 686fb2b39d6a..ac3ab900a1dc 100644 --- a/include/asm-frv/irq-routing.h +++ b/include/asm-frv/irq-routing.h | |||
@@ -51,7 +51,7 @@ struct irq_source { | |||
51 | struct irq_level { | 51 | struct irq_level { |
52 | int usage; | 52 | int usage; |
53 | int disable_count; | 53 | int disable_count; |
54 | unsigned long flags; /* current SA_INTERRUPT and SA_SHIRQ settings */ | 54 | unsigned long flags; /* current IRQF_DISABLED and IRQF_SHARED settings */ |
55 | spinlock_t lock; | 55 | spinlock_t lock; |
56 | struct irq_source *sources; | 56 | struct irq_source *sources; |
57 | }; | 57 | }; |
diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h index 1c4dba1c5f57..3744f2e47f48 100644 --- a/include/asm-frv/processor.h +++ b/include/asm-frv/processor.h | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | 22 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) |
23 | 23 | ||
24 | #include <linux/compiler.h> | ||
24 | #include <linux/linkage.h> | 25 | #include <linux/linkage.h> |
25 | #include <asm/sections.h> | 26 | #include <asm/sections.h> |
26 | #include <asm/segment.h> | 27 | #include <asm/segment.h> |
@@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p); | |||
139 | extern struct task_struct *alloc_task_struct(void); | 140 | extern struct task_struct *alloc_task_struct(void); |
140 | extern void free_task_struct(struct task_struct *p); | 141 | extern void free_task_struct(struct task_struct *p); |
141 | 142 | ||
142 | #define cpu_relax() do { } while (0) | 143 | #define cpu_relax() barrier() |
143 | 144 | ||
144 | /* data cache prefetch */ | 145 | /* data cache prefetch */ |
145 | #define ARCH_HAS_PREFETCH | 146 | #define ARCH_HAS_PREFETCH |
diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h index b2cce0718e57..7ff525162a72 100644 --- a/include/asm-frv/ptrace.h +++ b/include/asm-frv/ptrace.h | |||
@@ -62,18 +62,10 @@ | |||
62 | #ifndef __ASSEMBLY__ | 62 | #ifndef __ASSEMBLY__ |
63 | 63 | ||
64 | /* | 64 | /* |
65 | * dedicate GR28; to keeping the a pointer to the current exception frame | 65 | * we dedicate GR28 to keeping a pointer to the current exception frame |
66 | * - gr28 is destroyed on entry to the kernel from userspace | ||
66 | */ | 67 | */ |
67 | register struct pt_regs *__frame asm("gr28"); | 68 | register struct pt_regs *__frame asm("gr28"); |
68 | register struct pt_regs *__debug_frame asm("gr31"); | ||
69 | |||
70 | #ifndef container_of | ||
71 | #define container_of(ptr, type, member) ({ \ | ||
72 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | ||
73 | (type *)( (char *)__mptr - offsetof(type,member) );}) | ||
74 | #endif | ||
75 | |||
76 | #define __debug_regs container_of(__debug_frame, struct pt_debug_regs, normal_regs) | ||
77 | 69 | ||
78 | #define user_mode(regs) (!((regs)->psr & PSR_S)) | 70 | #define user_mode(regs) (!((regs)->psr & PSR_S)) |
79 | #define instruction_pointer(regs) ((regs)->pc) | 71 | #define instruction_pointer(regs) ((regs)->pc) |
diff --git a/include/asm-frv/registers.h b/include/asm-frv/registers.h index fccfd95cff68..9666119fcf6e 100644 --- a/include/asm-frv/registers.h +++ b/include/asm-frv/registers.h | |||
@@ -23,7 +23,13 @@ | |||
23 | * | 23 | * |
24 | * +0x2000 +---------------------- | 24 | * +0x2000 +---------------------- |
25 | * | union { | 25 | * | union { |
26 | * | struct user_context | 26 | * | struct frv_frame0 { |
27 | * | struct user_context { | ||
28 | * | struct user_int_regs | ||
29 | * | struct user_fpmedia_regs | ||
30 | * | } | ||
31 | * | struct frv_debug_regs | ||
32 | * | } | ||
27 | * | struct pt_regs [user exception] | 33 | * | struct pt_regs [user exception] |
28 | * | } | 34 | * | } |
29 | * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) | 35 | * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) |
@@ -51,11 +57,11 @@ | |||
51 | #define _ASM_REGISTERS_H | 57 | #define _ASM_REGISTERS_H |
52 | 58 | ||
53 | #ifndef __ASSEMBLY__ | 59 | #ifndef __ASSEMBLY__ |
54 | #define __OFFSET(X) (X) | 60 | #define __OFFSET(X,N) ((X)+(N)*4) |
55 | #define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx | 61 | #define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx |
56 | #else | 62 | #else |
57 | #define __OFFSET(X) ((X)*4) | 63 | #define __OFFSET(X,N) ((X)+(N)*4) |
58 | #define __OFFSETC(X,N) ((X)*4+(N)) | 64 | #define __OFFSETC(X,N) ((X)+(N)) |
59 | #endif | 65 | #endif |
60 | 66 | ||
61 | /*****************************************************************************/ | 67 | /*****************************************************************************/ |
@@ -117,30 +123,13 @@ struct pt_regs { | |||
117 | 123 | ||
118 | #endif | 124 | #endif |
119 | 125 | ||
120 | #define REG_PSR __OFFSET( 0) /* Processor Status Register */ | ||
121 | #define REG_ISR __OFFSET( 1) /* Integer Status Register */ | ||
122 | #define REG_CCR __OFFSET( 2) /* Condition Code Register */ | ||
123 | #define REG_CCCR __OFFSET( 3) /* Condition Code for Conditional Insns Register */ | ||
124 | #define REG_LR __OFFSET( 4) /* Link Register */ | ||
125 | #define REG_LCR __OFFSET( 5) /* Loop Count Register */ | ||
126 | #define REG_PC __OFFSET( 6) /* Program Counter */ | ||
127 | |||
128 | #define REG__STATUS __OFFSET( 7) /* exception status */ | ||
129 | #define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ | 126 | #define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ |
130 | #define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ | 127 | #define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ |
131 | #define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ | 128 | #define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ |
132 | #define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ | 129 | #define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ |
133 | #define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ | 130 | #define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ |
134 | 131 | ||
135 | #define REG_SYSCALLNO __OFFSET( 8) /* syscall number or -1 */ | 132 | #define REG_GR(R) __OFFSET(REG_GR0, (R)) |
136 | #define REG_ORIG_GR8 __OFFSET( 9) /* saved GR8 for signal handling */ | ||
137 | #define REG_GNER0 __OFFSET(10) | ||
138 | #define REG_GNER1 __OFFSET(11) | ||
139 | #define REG_IACC0 __OFFSET(12) | ||
140 | |||
141 | #define REG_TBR __OFFSET(14) /* Trap Vector Register */ | ||
142 | #define REG_GR(R) __OFFSET((14+(R))) | ||
143 | #define REG__END REG_GR(32) | ||
144 | 133 | ||
145 | #define REG_SP REG_GR(1) | 134 | #define REG_SP REG_GR(1) |
146 | #define REG_FP REG_GR(2) | 135 | #define REG_FP REG_GR(2) |
@@ -149,27 +138,21 @@ struct pt_regs { | |||
149 | 138 | ||
150 | /*****************************************************************************/ | 139 | /*****************************************************************************/ |
151 | /* | 140 | /* |
152 | * extension tacked in front of the exception frame in debug mode | 141 | * debugging registers |
153 | */ | 142 | */ |
154 | #ifndef __ASSEMBLY__ | 143 | #ifndef __ASSEMBLY__ |
155 | 144 | ||
156 | struct pt_debug_regs | 145 | struct frv_debug_regs |
157 | { | 146 | { |
158 | unsigned long bpsr; | ||
159 | unsigned long dcr; | 147 | unsigned long dcr; |
160 | unsigned long brr; | 148 | unsigned long ibar[4] __attribute__((aligned(8))); |
161 | unsigned long nmar; | 149 | unsigned long dbar[4] __attribute__((aligned(8))); |
162 | struct pt_regs normal_regs; | 150 | unsigned long dbdr[4][4] __attribute__((aligned(8))); |
151 | unsigned long dbmr[4][4] __attribute__((aligned(8))); | ||
163 | } __attribute__((aligned(8))); | 152 | } __attribute__((aligned(8))); |
164 | 153 | ||
165 | #endif | 154 | #endif |
166 | 155 | ||
167 | #define REG_NMAR __OFFSET(-1) | ||
168 | #define REG_BRR __OFFSET(-2) | ||
169 | #define REG_DCR __OFFSET(-3) | ||
170 | #define REG_BPSR __OFFSET(-4) | ||
171 | #define REG__DEBUG_XTRA __OFFSET(4) | ||
172 | |||
173 | /*****************************************************************************/ | 156 | /*****************************************************************************/ |
174 | /* | 157 | /* |
175 | * userspace registers | 158 | * userspace registers |
@@ -223,33 +206,27 @@ struct user_context | |||
223 | void *extension; | 206 | void *extension; |
224 | } __attribute__((aligned(8))); | 207 | } __attribute__((aligned(8))); |
225 | 208 | ||
209 | struct frv_frame0 { | ||
210 | union { | ||
211 | struct pt_regs regs; | ||
212 | struct user_context uc; | ||
213 | }; | ||
214 | |||
215 | struct frv_debug_regs debug; | ||
216 | |||
217 | } __attribute__((aligned(32))); | ||
218 | |||
226 | #endif | 219 | #endif |
227 | 220 | ||
228 | #define NR_USER_INT_REGS (14 + 64) | 221 | #define __INT_GR(R) __OFFSET(__INT_GR0, (R)) |
229 | #define NR_USER_FPMEDIA_REGS (64 + 2 + 2 + 8 + 8/4 + 1) | 222 | |
230 | #define NR_USER_CONTEXT (NR_USER_INT_REGS + NR_USER_FPMEDIA_REGS + 1) | 223 | #define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R)) |
231 | 224 | #define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R)) | |
232 | #define USER_CONTEXT_SIZE (((NR_USER_CONTEXT + 1) & ~1) * 4) | 225 | #define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R)) |
233 | 226 | #define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R)) | |
234 | #define __THREAD_FRAME __OFFSET(0) | 227 | #define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R)) |
235 | #define __THREAD_CURR __OFFSET(1) | 228 | #define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R)) |
236 | #define __THREAD_SP __OFFSET(2) | 229 | |
237 | #define __THREAD_FP __OFFSET(3) | 230 | #define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16) |
238 | #define __THREAD_LR __OFFSET(4) | ||
239 | #define __THREAD_PC __OFFSET(5) | ||
240 | #define __THREAD_GR(R) __OFFSET(6 + (R) - 16) | ||
241 | #define __THREAD_FRAME0 __OFFSET(19) | ||
242 | #define __THREAD_USER __OFFSET(19) | ||
243 | |||
244 | #define __USER_INT __OFFSET(0) | ||
245 | #define __INT_GR(R) __OFFSET(14 + (R)) | ||
246 | |||
247 | #define __USER_FPMEDIA __OFFSET(NR_USER_INT_REGS) | ||
248 | #define __FPMEDIA_FR(R) __OFFSET(NR_USER_INT_REGS + (R)) | ||
249 | #define __FPMEDIA_FNER(R) __OFFSET(NR_USER_INT_REGS + 64 + (R)) | ||
250 | #define __FPMEDIA_MSR(R) __OFFSET(NR_USER_INT_REGS + 66 + (R)) | ||
251 | #define __FPMEDIA_ACC(R) __OFFSET(NR_USER_INT_REGS + 68 + (R)) | ||
252 | #define __FPMEDIA_ACCG(R) __OFFSETC(NR_USER_INT_REGS + 76, (R)) | ||
253 | #define __FPMEDIA_FSR(R) __OFFSET(NR_USER_INT_REGS + 78 + (R)) | ||
254 | 231 | ||
255 | #endif /* _ASM_REGISTERS_H */ | 232 | #endif /* _ASM_REGISTERS_H */ |
diff --git a/include/asm-frv/signal.h b/include/asm-frv/signal.h index dcc1b3592918..2079197d483d 100644 --- a/include/asm-frv/signal.h +++ b/include/asm-frv/signal.h | |||
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t; | |||
74 | * SA_FLAGS values: | 74 | * SA_FLAGS values: |
75 | * | 75 | * |
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | 76 | * SA_ONSTACK indicates that a registered stack_t will be used. |
77 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 77 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
80 | * SA_RESETHAND clears the handler when the signal is delivered. | 79 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t; | |||
94 | 93 | ||
95 | #define SA_NOMASK SA_NODEFER | 94 | #define SA_NOMASK SA_NODEFER |
96 | #define SA_ONESHOT SA_RESETHAND | 95 | #define SA_ONESHOT SA_RESETHAND |
97 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
98 | 96 | ||
99 | #define SA_RESTORER 0x04000000 | 97 | #define SA_RESTORER 0x04000000 |
100 | 98 | ||
diff --git a/include/asm-frv/socket.h b/include/asm-frv/socket.h index 7177f8b9817c..31db18fc871f 100644 --- a/include/asm-frv/socket.h +++ b/include/asm-frv/socket.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
53 | 54 | ||
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h index ea426abf01d3..d66c48e6ef14 100644 --- a/include/asm-frv/thread_info.h +++ b/include/asm-frv/thread_info.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <asm/processor.h> | 19 | #include <asm/processor.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #define THREAD_SIZE 8192 | ||
23 | |||
22 | /* | 24 | /* |
23 | * low level task data that entry.S needs immediate access to | 25 | * low level task data that entry.S needs immediate access to |
24 | * - this struct should fit entirely inside of one cache line | 26 | * - this struct should fit entirely inside of one cache line |
@@ -46,15 +48,7 @@ struct thread_info { | |||
46 | 48 | ||
47 | #else /* !__ASSEMBLY__ */ | 49 | #else /* !__ASSEMBLY__ */ |
48 | 50 | ||
49 | /* offsets into the thread_info struct for assembly code access */ | 51 | #include <asm/asm-offsets.h> |
50 | #define TI_TASK 0x00000000 | ||
51 | #define TI_EXEC_DOMAIN 0x00000004 | ||
52 | #define TI_FLAGS 0x00000008 | ||
53 | #define TI_STATUS 0x0000000C | ||
54 | #define TI_CPU 0x00000010 | ||
55 | #define TI_PRE_COUNT 0x00000014 | ||
56 | #define TI_ADDR_LIMIT 0x00000018 | ||
57 | #define TI_RESTART_BLOCK 0x0000001C | ||
58 | 52 | ||
59 | #endif | 53 | #endif |
60 | 54 | ||
@@ -83,12 +77,6 @@ struct thread_info { | |||
83 | #define init_thread_info (init_thread_union.thread_info) | 77 | #define init_thread_info (init_thread_union.thread_info) |
84 | #define init_stack (init_thread_union.stack) | 78 | #define init_stack (init_thread_union.stack) |
85 | 79 | ||
86 | #ifdef CONFIG_SMALL_TASKS | ||
87 | #define THREAD_SIZE 4096 | ||
88 | #else | ||
89 | #define THREAD_SIZE 8192 | ||
90 | #endif | ||
91 | |||
92 | /* how to get the thread information struct from C */ | 80 | /* how to get the thread information struct from C */ |
93 | register struct thread_info *__current_thread_info asm("gr15"); | 81 | register struct thread_info *__current_thread_info asm("gr15"); |
94 | 82 | ||
@@ -111,11 +99,7 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
111 | 99 | ||
112 | #define free_thread_info(info) kfree(info) | 100 | #define free_thread_info(info) kfree(info) |
113 | 101 | ||
114 | #else /* !__ASSEMBLY__ */ | 102 | #endif /* __ASSEMBLY__ */ |
115 | |||
116 | #define THREAD_SIZE 8192 | ||
117 | |||
118 | #endif | ||
119 | 103 | ||
120 | /* | 104 | /* |
121 | * thread information flags | 105 | * thread information flags |
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild new file mode 100644 index 000000000000..70594b275a6e --- /dev/null +++ b/include/asm-generic/Kbuild | |||
@@ -0,0 +1,3 @@ | |||
1 | header-y += atomic.h errno-base.h errno.h fcntl.h ioctl.h ipc.h mman.h \ | ||
2 | signal.h statfs.h | ||
3 | unifdef-y := resource.h siginfo.h | ||
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm new file mode 100644 index 000000000000..d8d0bcecd23f --- /dev/null +++ b/include/asm-generic/Kbuild.asm | |||
@@ -0,0 +1,11 @@ | |||
1 | unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ | ||
2 | ioctls.h ipcbuf.h irq.h mman.h msgbuf.h param.h poll.h \ | ||
3 | posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \ | ||
4 | sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ | ||
5 | statfs.h termbits.h termios.h timex.h types.h unistd.h user.h | ||
6 | |||
7 | # These really shouldn't be exported | ||
8 | unifdef-y += atomic.h io.h | ||
9 | |||
10 | # These probably shouldn't be exported | ||
11 | unifdef-y += elf.h page.h | ||
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h new file mode 100644 index 000000000000..cb05bf69745a --- /dev/null +++ b/include/asm-generic/audit_change_attr.h | |||
@@ -0,0 +1,18 @@ | |||
1 | __NR_chmod, | ||
2 | __NR_fchmod, | ||
3 | __NR_chown, | ||
4 | __NR_fchown, | ||
5 | __NR_lchown, | ||
6 | __NR_setxattr, | ||
7 | __NR_lsetxattr, | ||
8 | __NR_fsetxattr, | ||
9 | __NR_removexattr, | ||
10 | __NR_lremovexattr, | ||
11 | __NR_fremovexattr, | ||
12 | __NR_fchownat, | ||
13 | __NR_fchmodat, | ||
14 | #ifdef __NR_chown32 | ||
15 | __NR_chown32, | ||
16 | __NR_fchown32, | ||
17 | __NR_lchown32, | ||
18 | #endif | ||
diff --git a/include/asm-generic/audit_dir_write.h b/include/asm-generic/audit_dir_write.h new file mode 100644 index 000000000000..161a7a58fbab --- /dev/null +++ b/include/asm-generic/audit_dir_write.h | |||
@@ -0,0 +1,14 @@ | |||
1 | __NR_rename, | ||
2 | __NR_mkdir, | ||
3 | __NR_rmdir, | ||
4 | __NR_creat, | ||
5 | __NR_link, | ||
6 | __NR_unlink, | ||
7 | __NR_symlink, | ||
8 | __NR_mknod, | ||
9 | __NR_mkdirat, | ||
10 | __NR_mknodat, | ||
11 | __NR_unlinkat, | ||
12 | __NR_renameat, | ||
13 | __NR_linkat, | ||
14 | __NR_symlinkat, | ||
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h index 6f178563e336..09204e40d663 100644 --- a/include/asm-generic/cputime.h +++ b/include/asm-generic/cputime.h | |||
@@ -24,7 +24,9 @@ typedef u64 cputime64_t; | |||
24 | 24 | ||
25 | #define cputime64_zero (0ULL) | 25 | #define cputime64_zero (0ULL) |
26 | #define cputime64_add(__a, __b) ((__a) + (__b)) | 26 | #define cputime64_add(__a, __b) ((__a) + (__b)) |
27 | #define cputime64_sub(__a, __b) ((__a) - (__b)) | ||
27 | #define cputime64_to_jiffies64(__ct) (__ct) | 28 | #define cputime64_to_jiffies64(__ct) (__ct) |
29 | #define jiffies64_to_cputime64(__jif) (__jif) | ||
28 | #define cputime_to_cputime64(__ct) ((u64) __ct) | 30 | #define cputime_to_cputime64(__ct) ((u64) __ct) |
29 | 31 | ||
30 | 32 | ||
diff --git a/include/asm-generic/mutex-null.h b/include/asm-generic/mutex-null.h index 5cf8b7ce0c45..254a126ede5c 100644 --- a/include/asm-generic/mutex-null.h +++ b/include/asm-generic/mutex-null.h | |||
@@ -10,15 +10,10 @@ | |||
10 | #ifndef _ASM_GENERIC_MUTEX_NULL_H | 10 | #ifndef _ASM_GENERIC_MUTEX_NULL_H |
11 | #define _ASM_GENERIC_MUTEX_NULL_H | 11 | #define _ASM_GENERIC_MUTEX_NULL_H |
12 | 12 | ||
13 | /* extra parameter only needed for mutex debugging: */ | 13 | #define __mutex_fastpath_lock(count, fail_fn) fail_fn(count) |
14 | #ifndef __IP__ | 14 | #define __mutex_fastpath_lock_retval(count, fail_fn) fail_fn(count) |
15 | # define __IP__ | 15 | #define __mutex_fastpath_unlock(count, fail_fn) fail_fn(count) |
16 | #endif | 16 | #define __mutex_fastpath_trylock(count, fail_fn) fail_fn(count) |
17 | 17 | #define __mutex_slowpath_needs_to_unlock() 1 | |
18 | #define __mutex_fastpath_lock(count, fail_fn) fail_fn(count __RET_IP__) | ||
19 | #define __mutex_fastpath_lock_retval(count, fail_fn) fail_fn(count __RET_IP__) | ||
20 | #define __mutex_fastpath_unlock(count, fail_fn) fail_fn(count __RET_IP__) | ||
21 | #define __mutex_fastpath_trylock(count, fail_fn) fail_fn(count) | ||
22 | #define __mutex_slowpath_needs_to_unlock() 1 | ||
23 | 18 | ||
24 | #endif | 19 | #endif |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index c74521157461..e160e04290fb 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | extern unsigned long __per_cpu_offset[NR_CPUS]; | 8 | extern unsigned long __per_cpu_offset[NR_CPUS]; |
9 | 9 | ||
10 | #define per_cpu_offset(x) (__per_cpu_offset[x]) | ||
11 | |||
10 | /* Separate out the type, so (int[3], foo) works. */ | 12 | /* Separate out the type, so (int[3], foo) works. */ |
11 | #define DEFINE_PER_CPU(type, name) \ | 13 | #define DEFINE_PER_CPU(type, name) \ |
12 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name | 14 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name |
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 0b49f9e070f1..962cad7cfbbd 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -14,5 +14,6 @@ extern char _end[]; | |||
14 | extern char __per_cpu_start[], __per_cpu_end[]; | 14 | extern char __per_cpu_start[], __per_cpu_end[]; |
15 | extern char __kprobes_text_start[], __kprobes_text_end[]; | 15 | extern char __kprobes_text_start[], __kprobes_text_end[]; |
16 | extern char __initdata_begin[], __initdata_end[]; | 16 | extern char __initdata_begin[], __initdata_end[]; |
17 | extern char __start_rodata[], __end_rodata[]; | ||
17 | 18 | ||
18 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ | 19 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 9d11550b4818..db5a3732f106 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -58,6 +58,20 @@ | |||
58 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ | 58 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ |
59 | } \ | 59 | } \ |
60 | \ | 60 | \ |
61 | /* Kernel symbol table: Normal unused symbols */ \ | ||
62 | __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \ | ||
63 | VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \ | ||
64 | *(__ksymtab_unused) \ | ||
65 | VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \ | ||
66 | } \ | ||
67 | \ | ||
68 | /* Kernel symbol table: GPL-only unused symbols */ \ | ||
69 | __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \ | ||
70 | VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \ | ||
71 | *(__ksymtab_unused_gpl) \ | ||
72 | VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \ | ||
73 | } \ | ||
74 | \ | ||
61 | /* Kernel symbol table: GPL-future-only symbols */ \ | 75 | /* Kernel symbol table: GPL-future-only symbols */ \ |
62 | __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ | 76 | __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ |
63 | VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ | 77 | VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ |
@@ -79,6 +93,20 @@ | |||
79 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ | 93 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ |
80 | } \ | 94 | } \ |
81 | \ | 95 | \ |
96 | /* Kernel symbol table: Normal unused symbols */ \ | ||
97 | __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \ | ||
98 | VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \ | ||
99 | *(__kcrctab_unused) \ | ||
100 | VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \ | ||
101 | } \ | ||
102 | \ | ||
103 | /* Kernel symbol table: GPL-only unused symbols */ \ | ||
104 | __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \ | ||
105 | VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \ | ||
106 | *(__kcrctab_unused_gpl) \ | ||
107 | VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \ | ||
108 | } \ | ||
109 | \ | ||
82 | /* Kernel symbol table: GPL-future-only symbols */ \ | 110 | /* Kernel symbol table: GPL-future-only symbols */ \ |
83 | __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ | 111 | __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ |
84 | VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ | 112 | VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ |
diff --git a/include/asm-h8300/Kbuild b/include/asm-h8300/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-h8300/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index f9f9d3eea8ed..d673077d2fd6 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h | |||
@@ -66,7 +66,6 @@ extern unsigned long memory_end; | |||
66 | 66 | ||
67 | #define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) | 67 | #define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) |
68 | #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) | 68 | #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) |
69 | #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) | ||
70 | #define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) | 69 | #define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) |
71 | #define pfn_valid(page) (page < max_mapnr) | 70 | #define pfn_valid(page) (page < max_mapnr) |
72 | 71 | ||
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h index c7e2f454b83a..99b664aa2083 100644 --- a/include/asm-h8300/processor.h +++ b/include/asm-h8300/processor.h | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | 18 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) |
19 | 19 | ||
20 | #include <linux/compiler.h> | ||
20 | #include <asm/segment.h> | 21 | #include <asm/segment.h> |
21 | #include <asm/fpu.h> | 22 | #include <asm/fpu.h> |
22 | #include <asm/ptrace.h> | 23 | #include <asm/ptrace.h> |
@@ -129,6 +130,6 @@ unsigned long get_wchan(struct task_struct *p); | |||
129 | eip; }) | 130 | eip; }) |
130 | #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) | 131 | #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) |
131 | 132 | ||
132 | #define cpu_relax() do { } while (0) | 133 | #define cpu_relax() barrier() |
133 | 134 | ||
134 | #endif | 135 | #endif |
diff --git a/include/asm-h8300/signal.h b/include/asm-h8300/signal.h index 8eccdc176163..7bc15048a64f 100644 --- a/include/asm-h8300/signal.h +++ b/include/asm-h8300/signal.h | |||
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t; | |||
74 | * SA_FLAGS values: | 74 | * SA_FLAGS values: |
75 | * | 75 | * |
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | 76 | * SA_ONSTACK indicates that a registered stack_t will be used. |
77 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 77 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
80 | * SA_RESETHAND clears the handler when the signal is delivered. | 79 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t; | |||
94 | 93 | ||
95 | #define SA_NOMASK SA_NODEFER | 94 | #define SA_NOMASK SA_NODEFER |
96 | #define SA_ONESHOT SA_RESETHAND | 95 | #define SA_ONESHOT SA_RESETHAND |
97 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
98 | 96 | ||
99 | #define SA_RESTORER 0x04000000 | 97 | #define SA_RESTORER 0x04000000 |
100 | 98 | ||
diff --git a/include/asm-h8300/socket.h b/include/asm-h8300/socket.h index d98cf85bafc1..ebc830fee0d0 100644 --- a/include/asm-h8300/socket.h +++ b/include/asm-h8300/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild new file mode 100644 index 000000000000..c064a8e9170f --- /dev/null +++ b/include/asm-i386/Kbuild | |||
@@ -0,0 +1,5 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | header-y += boot.h cpufeature.h debugreg.h ldt.h setup.h ucontext.h | ||
4 | |||
5 | unifdef-y += mtrr.h vm86.h | ||
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index c61bd1a17f37..96adbabec740 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h | |||
@@ -19,11 +19,19 @@ struct alt_instr { | |||
19 | extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); | 19 | extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); |
20 | 20 | ||
21 | struct module; | 21 | struct module; |
22 | #ifdef CONFIG_SMP | ||
22 | extern void alternatives_smp_module_add(struct module *mod, char *name, | 23 | extern void alternatives_smp_module_add(struct module *mod, char *name, |
23 | void *locks, void *locks_end, | 24 | void *locks, void *locks_end, |
24 | void *text, void *text_end); | 25 | void *text, void *text_end); |
25 | extern void alternatives_smp_module_del(struct module *mod); | 26 | extern void alternatives_smp_module_del(struct module *mod); |
26 | extern void alternatives_smp_switch(int smp); | 27 | extern void alternatives_smp_switch(int smp); |
28 | #else | ||
29 | static inline void alternatives_smp_module_add(struct module *mod, char *name, | ||
30 | void *locks, void *locks_end, | ||
31 | void *text, void *text_end) {} | ||
32 | static inline void alternatives_smp_module_del(struct module *mod) {} | ||
33 | static inline void alternatives_smp_switch(int smp) {} | ||
34 | #endif | ||
27 | 35 | ||
28 | #endif | 36 | #endif |
29 | 37 | ||
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index 4f061fa73794..51a166242522 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h | |||
@@ -46,8 +46,8 @@ static __inline__ void atomic_add(int i, atomic_t *v) | |||
46 | { | 46 | { |
47 | __asm__ __volatile__( | 47 | __asm__ __volatile__( |
48 | LOCK_PREFIX "addl %1,%0" | 48 | LOCK_PREFIX "addl %1,%0" |
49 | :"=m" (v->counter) | 49 | :"+m" (v->counter) |
50 | :"ir" (i), "m" (v->counter)); | 50 | :"ir" (i)); |
51 | } | 51 | } |
52 | 52 | ||
53 | /** | 53 | /** |
@@ -61,8 +61,8 @@ static __inline__ void atomic_sub(int i, atomic_t *v) | |||
61 | { | 61 | { |
62 | __asm__ __volatile__( | 62 | __asm__ __volatile__( |
63 | LOCK_PREFIX "subl %1,%0" | 63 | LOCK_PREFIX "subl %1,%0" |
64 | :"=m" (v->counter) | 64 | :"+m" (v->counter) |
65 | :"ir" (i), "m" (v->counter)); | 65 | :"ir" (i)); |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
@@ -80,8 +80,8 @@ static __inline__ int atomic_sub_and_test(int i, atomic_t *v) | |||
80 | 80 | ||
81 | __asm__ __volatile__( | 81 | __asm__ __volatile__( |
82 | LOCK_PREFIX "subl %2,%0; sete %1" | 82 | LOCK_PREFIX "subl %2,%0; sete %1" |
83 | :"=m" (v->counter), "=qm" (c) | 83 | :"+m" (v->counter), "=qm" (c) |
84 | :"ir" (i), "m" (v->counter) : "memory"); | 84 | :"ir" (i) : "memory"); |
85 | return c; | 85 | return c; |
86 | } | 86 | } |
87 | 87 | ||
@@ -95,8 +95,7 @@ static __inline__ void atomic_inc(atomic_t *v) | |||
95 | { | 95 | { |
96 | __asm__ __volatile__( | 96 | __asm__ __volatile__( |
97 | LOCK_PREFIX "incl %0" | 97 | LOCK_PREFIX "incl %0" |
98 | :"=m" (v->counter) | 98 | :"+m" (v->counter)); |
99 | :"m" (v->counter)); | ||
100 | } | 99 | } |
101 | 100 | ||
102 | /** | 101 | /** |
@@ -109,8 +108,7 @@ static __inline__ void atomic_dec(atomic_t *v) | |||
109 | { | 108 | { |
110 | __asm__ __volatile__( | 109 | __asm__ __volatile__( |
111 | LOCK_PREFIX "decl %0" | 110 | LOCK_PREFIX "decl %0" |
112 | :"=m" (v->counter) | 111 | :"+m" (v->counter)); |
113 | :"m" (v->counter)); | ||
114 | } | 112 | } |
115 | 113 | ||
116 | /** | 114 | /** |
@@ -127,8 +125,8 @@ static __inline__ int atomic_dec_and_test(atomic_t *v) | |||
127 | 125 | ||
128 | __asm__ __volatile__( | 126 | __asm__ __volatile__( |
129 | LOCK_PREFIX "decl %0; sete %1" | 127 | LOCK_PREFIX "decl %0; sete %1" |
130 | :"=m" (v->counter), "=qm" (c) | 128 | :"+m" (v->counter), "=qm" (c) |
131 | :"m" (v->counter) : "memory"); | 129 | : : "memory"); |
132 | return c != 0; | 130 | return c != 0; |
133 | } | 131 | } |
134 | 132 | ||
@@ -146,8 +144,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v) | |||
146 | 144 | ||
147 | __asm__ __volatile__( | 145 | __asm__ __volatile__( |
148 | LOCK_PREFIX "incl %0; sete %1" | 146 | LOCK_PREFIX "incl %0; sete %1" |
149 | :"=m" (v->counter), "=qm" (c) | 147 | :"+m" (v->counter), "=qm" (c) |
150 | :"m" (v->counter) : "memory"); | 148 | : : "memory"); |
151 | return c != 0; | 149 | return c != 0; |
152 | } | 150 | } |
153 | 151 | ||
@@ -166,8 +164,8 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v) | |||
166 | 164 | ||
167 | __asm__ __volatile__( | 165 | __asm__ __volatile__( |
168 | LOCK_PREFIX "addl %2,%0; sets %1" | 166 | LOCK_PREFIX "addl %2,%0; sets %1" |
169 | :"=m" (v->counter), "=qm" (c) | 167 | :"+m" (v->counter), "=qm" (c) |
170 | :"ir" (i), "m" (v->counter) : "memory"); | 168 | :"ir" (i) : "memory"); |
171 | return c; | 169 | return c; |
172 | } | 170 | } |
173 | 171 | ||
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index 9cb2793eb211..359ead60b718 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h | |||
@@ -144,11 +144,11 @@ static int vdma_get_dma_residue(unsigned int dummy) | |||
144 | static int fd_request_irq(void) | 144 | static int fd_request_irq(void) |
145 | { | 145 | { |
146 | if(can_use_virtual_dma) | 146 | if(can_use_virtual_dma) |
147 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 147 | return request_irq(FLOPPY_IRQ, floppy_hardint, |
148 | "floppy", NULL); | 148 | IRQF_DISABLED, "floppy", NULL); |
149 | else | 149 | else |
150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, | 150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
151 | "floppy", NULL); | 151 | IRQF_DISABLED, "floppy", NULL); |
152 | 152 | ||
153 | } | 153 | } |
154 | 154 | ||
diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h index 7b8ceefd010f..946d97cfea23 100644 --- a/include/asm-i386/futex.h +++ b/include/asm-i386/futex.h | |||
@@ -20,8 +20,8 @@ | |||
20 | .align 8\n\ | 20 | .align 8\n\ |
21 | .long 1b,3b\n\ | 21 | .long 1b,3b\n\ |
22 | .previous" \ | 22 | .previous" \ |
23 | : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \ | 23 | : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \ |
24 | : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0)) | 24 | : "i" (-EFAULT), "0" (oparg), "1" (0)) |
25 | 25 | ||
26 | #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ | 26 | #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ |
27 | __asm__ __volatile ( \ | 27 | __asm__ __volatile ( \ |
@@ -38,9 +38,9 @@ | |||
38 | .align 8\n\ | 38 | .align 8\n\ |
39 | .long 1b,4b,2b,4b\n\ | 39 | .long 1b,4b,2b,4b\n\ |
40 | .previous" \ | 40 | .previous" \ |
41 | : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \ | 41 | : "=&a" (oldval), "=&r" (ret), "+m" (*uaddr), \ |
42 | "=&r" (tem) \ | 42 | "=&r" (tem) \ |
43 | : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0)) | 43 | : "r" (oparg), "i" (-EFAULT), "1" (0)) |
44 | 44 | ||
45 | static inline int | 45 | static inline int |
46 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | 46 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) |
@@ -123,7 +123,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | |||
123 | " .long 1b,3b \n" | 123 | " .long 1b,3b \n" |
124 | " .previous \n" | 124 | " .previous \n" |
125 | 125 | ||
126 | : "=a" (oldval), "=m" (*uaddr) | 126 | : "=a" (oldval), "+m" (*uaddr) |
127 | : "i" (-EFAULT), "r" (newval), "0" (oldval) | 127 | : "i" (-EFAULT), "r" (newval), "0" (oldval) |
128 | : "memory" | 128 | : "memory" |
129 | ); | 129 | ); |
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index a4c0a5a9ffd8..87e5a351d881 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h | |||
@@ -69,14 +69,4 @@ extern atomic_t irq_mis_count; | |||
69 | 69 | ||
70 | #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) | 70 | #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) |
71 | 71 | ||
72 | #if defined(CONFIG_X86_IO_APIC) | ||
73 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) | ||
74 | { | ||
75 | if (IO_APIC_IRQ(i)) | ||
76 | send_IPI_self(IO_APIC_VECTOR(i)); | ||
77 | } | ||
78 | #else | ||
79 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
80 | #endif | ||
81 | |||
82 | #endif /* _ASM_HW_IRQ_H */ | 72 | #endif /* _ASM_HW_IRQ_H */ |
diff --git a/include/asm-i386/irqflags.h b/include/asm-i386/irqflags.h new file mode 100644 index 000000000000..e1bdb97c07fa --- /dev/null +++ b/include/asm-i386/irqflags.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * include/asm-i386/irqflags.h | ||
3 | * | ||
4 | * IRQ flags handling | ||
5 | * | ||
6 | * This file gets included from lowlevel asm headers too, to provide | ||
7 | * wrapped versions of the local_irq_*() APIs, based on the | ||
8 | * raw_local_irq_*() functions from the lowlevel headers. | ||
9 | */ | ||
10 | #ifndef _ASM_IRQFLAGS_H | ||
11 | #define _ASM_IRQFLAGS_H | ||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | |||
15 | static inline unsigned long __raw_local_save_flags(void) | ||
16 | { | ||
17 | unsigned long flags; | ||
18 | |||
19 | __asm__ __volatile__( | ||
20 | "pushfl ; popl %0" | ||
21 | : "=g" (flags) | ||
22 | : /* no input */ | ||
23 | ); | ||
24 | |||
25 | return flags; | ||
26 | } | ||
27 | |||
28 | #define raw_local_save_flags(flags) \ | ||
29 | do { (flags) = __raw_local_save_flags(); } while (0) | ||
30 | |||
31 | static inline void raw_local_irq_restore(unsigned long flags) | ||
32 | { | ||
33 | __asm__ __volatile__( | ||
34 | "pushl %0 ; popfl" | ||
35 | : /* no output */ | ||
36 | :"g" (flags) | ||
37 | :"memory", "cc" | ||
38 | ); | ||
39 | } | ||
40 | |||
41 | static inline void raw_local_irq_disable(void) | ||
42 | { | ||
43 | __asm__ __volatile__("cli" : : : "memory"); | ||
44 | } | ||
45 | |||
46 | static inline void raw_local_irq_enable(void) | ||
47 | { | ||
48 | __asm__ __volatile__("sti" : : : "memory"); | ||
49 | } | ||
50 | |||
51 | /* | ||
52 | * Used in the idle loop; sti takes one instruction cycle | ||
53 | * to complete: | ||
54 | */ | ||
55 | static inline void raw_safe_halt(void) | ||
56 | { | ||
57 | __asm__ __volatile__("sti; hlt" : : : "memory"); | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | * Used when interrupts are already enabled or to | ||
62 | * shutdown the processor: | ||
63 | */ | ||
64 | static inline void halt(void) | ||
65 | { | ||
66 | __asm__ __volatile__("hlt": : :"memory"); | ||
67 | } | ||
68 | |||
69 | static inline int raw_irqs_disabled_flags(unsigned long flags) | ||
70 | { | ||
71 | return !(flags & (1 << 9)); | ||
72 | } | ||
73 | |||
74 | static inline int raw_irqs_disabled(void) | ||
75 | { | ||
76 | unsigned long flags = __raw_local_save_flags(); | ||
77 | |||
78 | return raw_irqs_disabled_flags(flags); | ||
79 | } | ||
80 | |||
81 | /* | ||
82 | * For spinlocks, etc: | ||
83 | */ | ||
84 | static inline unsigned long __raw_local_irq_save(void) | ||
85 | { | ||
86 | unsigned long flags = __raw_local_save_flags(); | ||
87 | |||
88 | raw_local_irq_disable(); | ||
89 | |||
90 | return flags; | ||
91 | } | ||
92 | |||
93 | #define raw_local_irq_save(flags) \ | ||
94 | do { (flags) = __raw_local_irq_save(); } while (0) | ||
95 | |||
96 | #endif /* __ASSEMBLY__ */ | ||
97 | |||
98 | /* | ||
99 | * Do the CPU's IRQ-state tracing from assembly code. We call a | ||
100 | * C function, so save all the C-clobbered registers: | ||
101 | */ | ||
102 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
103 | |||
104 | # define TRACE_IRQS_ON \ | ||
105 | pushl %eax; \ | ||
106 | pushl %ecx; \ | ||
107 | pushl %edx; \ | ||
108 | call trace_hardirqs_on; \ | ||
109 | popl %edx; \ | ||
110 | popl %ecx; \ | ||
111 | popl %eax; | ||
112 | |||
113 | # define TRACE_IRQS_OFF \ | ||
114 | pushl %eax; \ | ||
115 | pushl %ecx; \ | ||
116 | pushl %edx; \ | ||
117 | call trace_hardirqs_off; \ | ||
118 | popl %edx; \ | ||
119 | popl %ecx; \ | ||
120 | popl %eax; | ||
121 | |||
122 | #else | ||
123 | # define TRACE_IRQS_ON | ||
124 | # define TRACE_IRQS_OFF | ||
125 | #endif | ||
126 | |||
127 | #endif | ||
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h index 3b4998c51d08..12060e22f7e2 100644 --- a/include/asm-i386/local.h +++ b/include/asm-i386/local.h | |||
@@ -17,32 +17,30 @@ static __inline__ void local_inc(local_t *v) | |||
17 | { | 17 | { |
18 | __asm__ __volatile__( | 18 | __asm__ __volatile__( |
19 | "incl %0" | 19 | "incl %0" |
20 | :"=m" (v->counter) | 20 | :"+m" (v->counter)); |
21 | :"m" (v->counter)); | ||
22 | } | 21 | } |
23 | 22 | ||
24 | static __inline__ void local_dec(local_t *v) | 23 | static __inline__ void local_dec(local_t *v) |
25 | { | 24 | { |
26 | __asm__ __volatile__( | 25 | __asm__ __volatile__( |
27 | "decl %0" | 26 | "decl %0" |
28 | :"=m" (v->counter) | 27 | :"+m" (v->counter)); |
29 | :"m" (v->counter)); | ||
30 | } | 28 | } |
31 | 29 | ||
32 | static __inline__ void local_add(long i, local_t *v) | 30 | static __inline__ void local_add(long i, local_t *v) |
33 | { | 31 | { |
34 | __asm__ __volatile__( | 32 | __asm__ __volatile__( |
35 | "addl %1,%0" | 33 | "addl %1,%0" |
36 | :"=m" (v->counter) | 34 | :"+m" (v->counter) |
37 | :"ir" (i), "m" (v->counter)); | 35 | :"ir" (i)); |
38 | } | 36 | } |
39 | 37 | ||
40 | static __inline__ void local_sub(long i, local_t *v) | 38 | static __inline__ void local_sub(long i, local_t *v) |
41 | { | 39 | { |
42 | __asm__ __volatile__( | 40 | __asm__ __volatile__( |
43 | "subl %1,%0" | 41 | "subl %1,%0" |
44 | :"=m" (v->counter) | 42 | :"+m" (v->counter) |
45 | :"ir" (i), "m" (v->counter)); | 43 | :"ir" (i)); |
46 | } | 44 | } |
47 | 45 | ||
48 | /* On x86, these are no better than the atomic variants. */ | 46 | /* On x86, these are no better than the atomic variants. */ |
diff --git a/include/asm-i386/mach-visws/setup_arch.h b/include/asm-i386/mach-visws/setup_arch.h index b92d6d9a4d3c..33f700ef6831 100644 --- a/include/asm-i386/mach-visws/setup_arch.h +++ b/include/asm-i386/mach-visws/setup_arch.h | |||
@@ -1,5 +1,8 @@ | |||
1 | /* Hook to call BIOS initialisation function */ | 1 | /* Hook to call BIOS initialisation function */ |
2 | 2 | ||
3 | extern unsigned long sgivwfb_mem_phys; | ||
4 | extern unsigned long sgivwfb_mem_size; | ||
5 | |||
3 | /* no action for visws */ | 6 | /* no action for visws */ |
4 | 7 | ||
5 | #define ARCH_SETUP | 8 | #define ARCH_SETUP |
diff --git a/include/asm-i386/posix_types.h b/include/asm-i386/posix_types.h index 4e47ed059ad6..133e31e7dfde 100644 --- a/include/asm-i386/posix_types.h +++ b/include/asm-i386/posix_types.h | |||
@@ -51,12 +51,12 @@ typedef struct { | |||
51 | #undef __FD_SET | 51 | #undef __FD_SET |
52 | #define __FD_SET(fd,fdsetp) \ | 52 | #define __FD_SET(fd,fdsetp) \ |
53 | __asm__ __volatile__("btsl %1,%0": \ | 53 | __asm__ __volatile__("btsl %1,%0": \ |
54 | "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) | 54 | "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) |
55 | 55 | ||
56 | #undef __FD_CLR | 56 | #undef __FD_CLR |
57 | #define __FD_CLR(fd,fdsetp) \ | 57 | #define __FD_CLR(fd,fdsetp) \ |
58 | __asm__ __volatile__("btrl %1,%0": \ | 58 | __asm__ __volatile__("btrl %1,%0": \ |
59 | "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) | 59 | "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) |
60 | 60 | ||
61 | #undef __FD_ISSET | 61 | #undef __FD_ISSET |
62 | #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \ | 62 | #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \ |
diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h index 94f00195d543..96b0bef2ea56 100644 --- a/include/asm-i386/rwlock.h +++ b/include/asm-i386/rwlock.h | |||
@@ -37,7 +37,7 @@ | |||
37 | "popl %%eax\n\t" \ | 37 | "popl %%eax\n\t" \ |
38 | "1:\n", \ | 38 | "1:\n", \ |
39 | "subl $1,%0\n\t", \ | 39 | "subl $1,%0\n\t", \ |
40 | "=m" (*(volatile int *)rw) : : "memory") | 40 | "+m" (*(volatile int *)rw) : : "memory") |
41 | 41 | ||
42 | #define __build_read_lock(rw, helper) do { \ | 42 | #define __build_read_lock(rw, helper) do { \ |
43 | if (__builtin_constant_p(rw)) \ | 43 | if (__builtin_constant_p(rw)) \ |
@@ -63,7 +63,7 @@ | |||
63 | "popl %%eax\n\t" \ | 63 | "popl %%eax\n\t" \ |
64 | "1:\n", \ | 64 | "1:\n", \ |
65 | "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \ | 65 | "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \ |
66 | "=m" (*(volatile int *)rw) : : "memory") | 66 | "+m" (*(volatile int *)rw) : : "memory") |
67 | 67 | ||
68 | #define __build_write_lock(rw, helper) do { \ | 68 | #define __build_write_lock(rw, helper) do { \ |
69 | if (__builtin_constant_p(rw)) \ | 69 | if (__builtin_constant_p(rw)) \ |
diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h index be4ab859238e..43113f5608eb 100644 --- a/include/asm-i386/rwsem.h +++ b/include/asm-i386/rwsem.h | |||
@@ -40,6 +40,7 @@ | |||
40 | 40 | ||
41 | #include <linux/list.h> | 41 | #include <linux/list.h> |
42 | #include <linux/spinlock.h> | 42 | #include <linux/spinlock.h> |
43 | #include <linux/lockdep.h> | ||
43 | 44 | ||
44 | struct rwsem_waiter; | 45 | struct rwsem_waiter; |
45 | 46 | ||
@@ -61,36 +62,34 @@ struct rw_semaphore { | |||
61 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 62 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
62 | spinlock_t wait_lock; | 63 | spinlock_t wait_lock; |
63 | struct list_head wait_list; | 64 | struct list_head wait_list; |
64 | #if RWSEM_DEBUG | 65 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
65 | int debug; | 66 | struct lockdep_map dep_map; |
66 | #endif | 67 | #endif |
67 | }; | 68 | }; |
68 | 69 | ||
69 | /* | 70 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
70 | * initialisation | 71 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } |
71 | */ | ||
72 | #if RWSEM_DEBUG | ||
73 | #define __RWSEM_DEBUG_INIT , 0 | ||
74 | #else | 72 | #else |
75 | #define __RWSEM_DEBUG_INIT /* */ | 73 | # define __RWSEM_DEP_MAP_INIT(lockname) |
76 | #endif | 74 | #endif |
77 | 75 | ||
76 | |||
78 | #define __RWSEM_INITIALIZER(name) \ | 77 | #define __RWSEM_INITIALIZER(name) \ |
79 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \ | 78 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \ |
80 | __RWSEM_DEBUG_INIT } | 79 | __RWSEM_DEP_MAP_INIT(name) } |
81 | 80 | ||
82 | #define DECLARE_RWSEM(name) \ | 81 | #define DECLARE_RWSEM(name) \ |
83 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 82 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
84 | 83 | ||
85 | static inline void init_rwsem(struct rw_semaphore *sem) | 84 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, |
86 | { | 85 | struct lock_class_key *key); |
87 | sem->count = RWSEM_UNLOCKED_VALUE; | 86 | |
88 | spin_lock_init(&sem->wait_lock); | 87 | #define init_rwsem(sem) \ |
89 | INIT_LIST_HEAD(&sem->wait_list); | 88 | do { \ |
90 | #if RWSEM_DEBUG | 89 | static struct lock_class_key __key; \ |
91 | sem->debug = 0; | 90 | \ |
92 | #endif | 91 | __init_rwsem((sem), #sem, &__key); \ |
93 | } | 92 | } while (0) |
94 | 93 | ||
95 | /* | 94 | /* |
96 | * lock for reading | 95 | * lock for reading |
@@ -112,8 +111,8 @@ LOCK_PREFIX " incl (%%eax)\n\t" /* adds 0x00000001, returns the old value | |||
112 | " jmp 1b\n" | 111 | " jmp 1b\n" |
113 | LOCK_SECTION_END | 112 | LOCK_SECTION_END |
114 | "# ending down_read\n\t" | 113 | "# ending down_read\n\t" |
115 | : "=m"(sem->count) | 114 | : "+m" (sem->count) |
116 | : "a"(sem), "m"(sem->count) | 115 | : "a" (sem) |
117 | : "memory", "cc"); | 116 | : "memory", "cc"); |
118 | } | 117 | } |
119 | 118 | ||
@@ -134,8 +133,8 @@ LOCK_PREFIX " cmpxchgl %2,%0\n\t" | |||
134 | " jnz 1b\n\t" | 133 | " jnz 1b\n\t" |
135 | "2:\n\t" | 134 | "2:\n\t" |
136 | "# ending __down_read_trylock\n\t" | 135 | "# ending __down_read_trylock\n\t" |
137 | : "+m"(sem->count), "=&a"(result), "=&r"(tmp) | 136 | : "+m" (sem->count), "=&a" (result), "=&r" (tmp) |
138 | : "i"(RWSEM_ACTIVE_READ_BIAS) | 137 | : "i" (RWSEM_ACTIVE_READ_BIAS) |
139 | : "memory", "cc"); | 138 | : "memory", "cc"); |
140 | return result>=0 ? 1 : 0; | 139 | return result>=0 ? 1 : 0; |
141 | } | 140 | } |
@@ -143,7 +142,7 @@ LOCK_PREFIX " cmpxchgl %2,%0\n\t" | |||
143 | /* | 142 | /* |
144 | * lock for writing | 143 | * lock for writing |
145 | */ | 144 | */ |
146 | static inline void __down_write(struct rw_semaphore *sem) | 145 | static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) |
147 | { | 146 | { |
148 | int tmp; | 147 | int tmp; |
149 | 148 | ||
@@ -162,11 +161,16 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the | |||
162 | " jmp 1b\n" | 161 | " jmp 1b\n" |
163 | LOCK_SECTION_END | 162 | LOCK_SECTION_END |
164 | "# ending down_write" | 163 | "# ending down_write" |
165 | : "=m"(sem->count), "=d"(tmp) | 164 | : "+m" (sem->count), "=d" (tmp) |
166 | : "a"(sem), "1"(tmp), "m"(sem->count) | 165 | : "a" (sem), "1" (tmp) |
167 | : "memory", "cc"); | 166 | : "memory", "cc"); |
168 | } | 167 | } |
169 | 168 | ||
169 | static inline void __down_write(struct rw_semaphore *sem) | ||
170 | { | ||
171 | __down_write_nested(sem, 0); | ||
172 | } | ||
173 | |||
170 | /* | 174 | /* |
171 | * trylock for writing -- returns 1 if successful, 0 if contention | 175 | * trylock for writing -- returns 1 if successful, 0 if contention |
172 | */ | 176 | */ |
@@ -201,8 +205,8 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtracts 1, returns the old valu | |||
201 | " jmp 1b\n" | 205 | " jmp 1b\n" |
202 | LOCK_SECTION_END | 206 | LOCK_SECTION_END |
203 | "# ending __up_read\n" | 207 | "# ending __up_read\n" |
204 | : "=m"(sem->count), "=d"(tmp) | 208 | : "+m" (sem->count), "=d" (tmp) |
205 | : "a"(sem), "1"(tmp), "m"(sem->count) | 209 | : "a" (sem), "1" (tmp) |
206 | : "memory", "cc"); | 210 | : "memory", "cc"); |
207 | } | 211 | } |
208 | 212 | ||
@@ -227,8 +231,8 @@ LOCK_PREFIX " xaddl %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> | |||
227 | " jmp 1b\n" | 231 | " jmp 1b\n" |
228 | LOCK_SECTION_END | 232 | LOCK_SECTION_END |
229 | "# ending __up_write\n" | 233 | "# ending __up_write\n" |
230 | : "=m"(sem->count) | 234 | : "+m" (sem->count) |
231 | : "a"(sem), "i"(-RWSEM_ACTIVE_WRITE_BIAS), "m"(sem->count) | 235 | : "a" (sem), "i" (-RWSEM_ACTIVE_WRITE_BIAS) |
232 | : "memory", "cc", "edx"); | 236 | : "memory", "cc", "edx"); |
233 | } | 237 | } |
234 | 238 | ||
@@ -252,8 +256,8 @@ LOCK_PREFIX " addl %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 | |||
252 | " jmp 1b\n" | 256 | " jmp 1b\n" |
253 | LOCK_SECTION_END | 257 | LOCK_SECTION_END |
254 | "# ending __downgrade_write\n" | 258 | "# ending __downgrade_write\n" |
255 | : "=m"(sem->count) | 259 | : "+m" (sem->count) |
256 | : "a"(sem), "i"(-RWSEM_WAITING_BIAS), "m"(sem->count) | 260 | : "a" (sem), "i" (-RWSEM_WAITING_BIAS) |
257 | : "memory", "cc"); | 261 | : "memory", "cc"); |
258 | } | 262 | } |
259 | 263 | ||
@@ -264,8 +268,8 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) | |||
264 | { | 268 | { |
265 | __asm__ __volatile__( | 269 | __asm__ __volatile__( |
266 | LOCK_PREFIX "addl %1,%0" | 270 | LOCK_PREFIX "addl %1,%0" |
267 | : "=m"(sem->count) | 271 | : "+m" (sem->count) |
268 | : "ir"(delta), "m"(sem->count)); | 272 | : "ir" (delta)); |
269 | } | 273 | } |
270 | 274 | ||
271 | /* | 275 | /* |
@@ -276,10 +280,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | |||
276 | int tmp = delta; | 280 | int tmp = delta; |
277 | 281 | ||
278 | __asm__ __volatile__( | 282 | __asm__ __volatile__( |
279 | LOCK_PREFIX "xadd %0,(%2)" | 283 | LOCK_PREFIX "xadd %0,%1" |
280 | : "+r"(tmp), "=m"(sem->count) | 284 | : "+r" (tmp), "+m" (sem->count) |
281 | : "r"(sem), "m"(sem->count) | 285 | : : "memory"); |
282 | : "memory"); | ||
283 | 286 | ||
284 | return tmp+delta; | 287 | return tmp+delta; |
285 | } | 288 | } |
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h index f7a0f310c524..d51e800acf29 100644 --- a/include/asm-i386/semaphore.h +++ b/include/asm-i386/semaphore.h | |||
@@ -107,7 +107,7 @@ static inline void down(struct semaphore * sem) | |||
107 | "call __down_failed\n\t" | 107 | "call __down_failed\n\t" |
108 | "jmp 1b\n" | 108 | "jmp 1b\n" |
109 | LOCK_SECTION_END | 109 | LOCK_SECTION_END |
110 | :"=m" (sem->count) | 110 | :"+m" (sem->count) |
111 | : | 111 | : |
112 | :"memory","ax"); | 112 | :"memory","ax"); |
113 | } | 113 | } |
@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem) | |||
132 | "call __down_failed_interruptible\n\t" | 132 | "call __down_failed_interruptible\n\t" |
133 | "jmp 1b\n" | 133 | "jmp 1b\n" |
134 | LOCK_SECTION_END | 134 | LOCK_SECTION_END |
135 | :"=a" (result), "=m" (sem->count) | 135 | :"=a" (result), "+m" (sem->count) |
136 | : | 136 | : |
137 | :"memory"); | 137 | :"memory"); |
138 | return result; | 138 | return result; |
@@ -157,7 +157,7 @@ static inline int down_trylock(struct semaphore * sem) | |||
157 | "call __down_failed_trylock\n\t" | 157 | "call __down_failed_trylock\n\t" |
158 | "jmp 1b\n" | 158 | "jmp 1b\n" |
159 | LOCK_SECTION_END | 159 | LOCK_SECTION_END |
160 | :"=a" (result), "=m" (sem->count) | 160 | :"=a" (result), "+m" (sem->count) |
161 | : | 161 | : |
162 | :"memory"); | 162 | :"memory"); |
163 | return result; | 163 | return result; |
@@ -182,7 +182,7 @@ static inline void up(struct semaphore * sem) | |||
182 | "jmp 1b\n" | 182 | "jmp 1b\n" |
183 | LOCK_SECTION_END | 183 | LOCK_SECTION_END |
184 | ".subsection 0\n" | 184 | ".subsection 0\n" |
185 | :"=m" (sem->count) | 185 | :"+m" (sem->count) |
186 | : | 186 | : |
187 | :"memory","ax"); | 187 | :"memory","ax"); |
188 | } | 188 | } |
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h index 026fd231488d..3824a502351f 100644 --- a/include/asm-i386/signal.h +++ b/include/asm-i386/signal.h | |||
@@ -77,7 +77,6 @@ typedef unsigned long sigset_t; | |||
77 | * SA_FLAGS values: | 77 | * SA_FLAGS values: |
78 | * | 78 | * |
79 | * SA_ONSTACK indicates that a registered stack_t will be used. | 79 | * SA_ONSTACK indicates that a registered stack_t will be used. |
80 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
81 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 80 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
82 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 81 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
83 | * SA_RESETHAND clears the handler when the signal is delivered. | 82 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -97,7 +96,6 @@ typedef unsigned long sigset_t; | |||
97 | 96 | ||
98 | #define SA_NOMASK SA_NODEFER | 97 | #define SA_NOMASK SA_NODEFER |
99 | #define SA_ONESHOT SA_RESETHAND | 98 | #define SA_ONESHOT SA_RESETHAND |
100 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
101 | 99 | ||
102 | #define SA_RESTORER 0x04000000 | 100 | #define SA_RESTORER 0x04000000 |
103 | 101 | ||
diff --git a/include/asm-i386/socket.h b/include/asm-i386/socket.h index 802ae76195b7..5755d57c4e95 100644 --- a/include/asm-i386/socket.h +++ b/include/asm-i386/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index 04ba30234c48..d816c62a7a1d 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h | |||
@@ -31,6 +31,11 @@ | |||
31 | "jmp 1b\n" \ | 31 | "jmp 1b\n" \ |
32 | "3:\n\t" | 32 | "3:\n\t" |
33 | 33 | ||
34 | /* | ||
35 | * NOTE: there's an irqs-on section here, which normally would have to be | ||
36 | * irq-traced, but on CONFIG_TRACE_IRQFLAGS we never use | ||
37 | * __raw_spin_lock_string_flags(). | ||
38 | */ | ||
34 | #define __raw_spin_lock_string_flags \ | 39 | #define __raw_spin_lock_string_flags \ |
35 | "\n1:\t" \ | 40 | "\n1:\t" \ |
36 | "lock ; decb %0\n\t" \ | 41 | "lock ; decb %0\n\t" \ |
@@ -60,23 +65,30 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) | |||
60 | alternative_smp( | 65 | alternative_smp( |
61 | __raw_spin_lock_string, | 66 | __raw_spin_lock_string, |
62 | __raw_spin_lock_string_up, | 67 | __raw_spin_lock_string_up, |
63 | "=m" (lock->slock) : : "memory"); | 68 | "+m" (lock->slock) : : "memory"); |
64 | } | 69 | } |
65 | 70 | ||
71 | /* | ||
72 | * It is easier for the lock validator if interrupts are not re-enabled | ||
73 | * in the middle of a lock-acquire. This is a performance feature anyway | ||
74 | * so we turn it off: | ||
75 | */ | ||
76 | #ifndef CONFIG_PROVE_LOCKING | ||
66 | static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) | 77 | static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) |
67 | { | 78 | { |
68 | alternative_smp( | 79 | alternative_smp( |
69 | __raw_spin_lock_string_flags, | 80 | __raw_spin_lock_string_flags, |
70 | __raw_spin_lock_string_up, | 81 | __raw_spin_lock_string_up, |
71 | "=m" (lock->slock) : "r" (flags) : "memory"); | 82 | "+m" (lock->slock) : "r" (flags) : "memory"); |
72 | } | 83 | } |
84 | #endif | ||
73 | 85 | ||
74 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) | 86 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) |
75 | { | 87 | { |
76 | char oldval; | 88 | char oldval; |
77 | __asm__ __volatile__( | 89 | __asm__ __volatile__( |
78 | "xchgb %b0,%1" | 90 | "xchgb %b0,%1" |
79 | :"=q" (oldval), "=m" (lock->slock) | 91 | :"=q" (oldval), "+m" (lock->slock) |
80 | :"0" (0) : "memory"); | 92 | :"0" (0) : "memory"); |
81 | return oldval > 0; | 93 | return oldval > 0; |
82 | } | 94 | } |
@@ -92,7 +104,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock) | |||
92 | 104 | ||
93 | #define __raw_spin_unlock_string \ | 105 | #define __raw_spin_unlock_string \ |
94 | "movb $1,%0" \ | 106 | "movb $1,%0" \ |
95 | :"=m" (lock->slock) : : "memory" | 107 | :"+m" (lock->slock) : : "memory" |
96 | 108 | ||
97 | 109 | ||
98 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) | 110 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
@@ -106,7 +118,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) | |||
106 | 118 | ||
107 | #define __raw_spin_unlock_string \ | 119 | #define __raw_spin_unlock_string \ |
108 | "xchgb %b0, %1" \ | 120 | "xchgb %b0, %1" \ |
109 | :"=q" (oldval), "=m" (lock->slock) \ | 121 | :"=q" (oldval), "+m" (lock->slock) \ |
110 | :"0" (oldval) : "memory" | 122 | :"0" (oldval) : "memory" |
111 | 123 | ||
112 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) | 124 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
@@ -187,13 +199,13 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock) | |||
187 | 199 | ||
188 | static inline void __raw_read_unlock(raw_rwlock_t *rw) | 200 | static inline void __raw_read_unlock(raw_rwlock_t *rw) |
189 | { | 201 | { |
190 | asm volatile(LOCK_PREFIX "incl %0" :"=m" (rw->lock) : : "memory"); | 202 | asm volatile(LOCK_PREFIX "incl %0" :"+m" (rw->lock) : : "memory"); |
191 | } | 203 | } |
192 | 204 | ||
193 | static inline void __raw_write_unlock(raw_rwlock_t *rw) | 205 | static inline void __raw_write_unlock(raw_rwlock_t *rw) |
194 | { | 206 | { |
195 | asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0" | 207 | asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0" |
196 | : "=m" (rw->lock) : : "memory"); | 208 | : "+m" (rw->lock) : : "memory"); |
197 | } | 209 | } |
198 | 210 | ||
199 | #endif /* __ASM_SPINLOCK_H */ | 211 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index cab0180567f9..2db168ef949f 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -82,10 +82,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
82 | #define savesegment(seg, value) \ | 82 | #define savesegment(seg, value) \ |
83 | asm volatile("mov %%" #seg ",%0":"=rm" (value)) | 83 | asm volatile("mov %%" #seg ",%0":"=rm" (value)) |
84 | 84 | ||
85 | /* | ||
86 | * Clear and set 'TS' bit respectively | ||
87 | */ | ||
88 | #define clts() __asm__ __volatile__ ("clts") | ||
89 | #define read_cr0() ({ \ | 85 | #define read_cr0() ({ \ |
90 | unsigned int __dummy; \ | 86 | unsigned int __dummy; \ |
91 | __asm__ __volatile__( \ | 87 | __asm__ __volatile__( \ |
@@ -94,7 +90,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
94 | __dummy; \ | 90 | __dummy; \ |
95 | }) | 91 | }) |
96 | #define write_cr0(x) \ | 92 | #define write_cr0(x) \ |
97 | __asm__ __volatile__("movl %0,%%cr0": :"r" (x)); | 93 | __asm__ __volatile__("movl %0,%%cr0": :"r" (x)) |
98 | 94 | ||
99 | #define read_cr2() ({ \ | 95 | #define read_cr2() ({ \ |
100 | unsigned int __dummy; \ | 96 | unsigned int __dummy; \ |
@@ -104,7 +100,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
104 | __dummy; \ | 100 | __dummy; \ |
105 | }) | 101 | }) |
106 | #define write_cr2(x) \ | 102 | #define write_cr2(x) \ |
107 | __asm__ __volatile__("movl %0,%%cr2": :"r" (x)); | 103 | __asm__ __volatile__("movl %0,%%cr2": :"r" (x)) |
108 | 104 | ||
109 | #define read_cr3() ({ \ | 105 | #define read_cr3() ({ \ |
110 | unsigned int __dummy; \ | 106 | unsigned int __dummy; \ |
@@ -114,7 +110,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
114 | __dummy; \ | 110 | __dummy; \ |
115 | }) | 111 | }) |
116 | #define write_cr3(x) \ | 112 | #define write_cr3(x) \ |
117 | __asm__ __volatile__("movl %0,%%cr3": :"r" (x)); | 113 | __asm__ __volatile__("movl %0,%%cr3": :"r" (x)) |
118 | 114 | ||
119 | #define read_cr4() ({ \ | 115 | #define read_cr4() ({ \ |
120 | unsigned int __dummy; \ | 116 | unsigned int __dummy; \ |
@@ -123,7 +119,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
123 | :"=r" (__dummy)); \ | 119 | :"=r" (__dummy)); \ |
124 | __dummy; \ | 120 | __dummy; \ |
125 | }) | 121 | }) |
126 | |||
127 | #define read_cr4_safe() ({ \ | 122 | #define read_cr4_safe() ({ \ |
128 | unsigned int __dummy; \ | 123 | unsigned int __dummy; \ |
129 | /* This could fault if %cr4 does not exist */ \ | 124 | /* This could fault if %cr4 does not exist */ \ |
@@ -135,15 +130,19 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
135 | : "=r" (__dummy): "0" (0)); \ | 130 | : "=r" (__dummy): "0" (0)); \ |
136 | __dummy; \ | 131 | __dummy; \ |
137 | }) | 132 | }) |
138 | |||
139 | #define write_cr4(x) \ | 133 | #define write_cr4(x) \ |
140 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); | 134 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)) |
135 | |||
136 | /* | ||
137 | * Clear and set 'TS' bit respectively | ||
138 | */ | ||
139 | #define clts() __asm__ __volatile__ ("clts") | ||
141 | #define stts() write_cr0(8 | read_cr0()) | 140 | #define stts() write_cr0(8 | read_cr0()) |
142 | 141 | ||
143 | #endif /* __KERNEL__ */ | 142 | #endif /* __KERNEL__ */ |
144 | 143 | ||
145 | #define wbinvd() \ | 144 | #define wbinvd() \ |
146 | __asm__ __volatile__ ("wbinvd": : :"memory"); | 145 | __asm__ __volatile__ ("wbinvd": : :"memory") |
147 | 146 | ||
148 | static inline unsigned long get_limit(unsigned long segment) | 147 | static inline unsigned long get_limit(unsigned long segment) |
149 | { | 148 | { |
@@ -456,25 +455,7 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l | |||
456 | 455 | ||
457 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | 456 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) |
458 | 457 | ||
459 | /* interrupt control.. */ | 458 | #include <linux/irqflags.h> |
460 | #define local_save_flags(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */); } while (0) | ||
461 | #define local_irq_restore(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc"); } while (0) | ||
462 | #define local_irq_disable() __asm__ __volatile__("cli": : :"memory") | ||
463 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") | ||
464 | /* used in the idle loop; sti takes one instruction cycle to complete */ | ||
465 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") | ||
466 | /* used when interrupts are already enabled or to shutdown the processor */ | ||
467 | #define halt() __asm__ __volatile__("hlt": : :"memory") | ||
468 | |||
469 | #define irqs_disabled() \ | ||
470 | ({ \ | ||
471 | unsigned long flags; \ | ||
472 | local_save_flags(flags); \ | ||
473 | !(flags & (1<<9)); \ | ||
474 | }) | ||
475 | |||
476 | /* For spinlocks etc */ | ||
477 | #define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory") | ||
478 | 459 | ||
479 | /* | 460 | /* |
480 | * disable hlt during certain critical i/o operations | 461 | * disable hlt during certain critical i/o operations |
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 2833fa2c0dd0..54d6d7aea938 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h | |||
@@ -140,6 +140,8 @@ static inline struct thread_info *current_thread_info(void) | |||
140 | #define TIF_SECCOMP 8 /* secure computing */ | 140 | #define TIF_SECCOMP 8 /* secure computing */ |
141 | #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ | 141 | #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ |
142 | #define TIF_MEMDIE 16 | 142 | #define TIF_MEMDIE 16 |
143 | #define TIF_DEBUG 17 /* uses debug registers */ | ||
144 | #define TIF_IO_BITMAP 18 /* uses I/O bitmap */ | ||
143 | 145 | ||
144 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 146 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
145 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 147 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
@@ -151,6 +153,8 @@ static inline struct thread_info *current_thread_info(void) | |||
151 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 153 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
152 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 154 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
153 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 155 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
156 | #define _TIF_DEBUG (1<<TIF_DEBUG) | ||
157 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) | ||
154 | 158 | ||
155 | /* work to do on interrupt/exception return */ | 159 | /* work to do on interrupt/exception return */ |
156 | #define _TIF_WORK_MASK \ | 160 | #define _TIF_WORK_MASK \ |
@@ -159,6 +163,9 @@ static inline struct thread_info *current_thread_info(void) | |||
159 | /* work to do on any return to u-space */ | 163 | /* work to do on any return to u-space */ |
160 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) | 164 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) |
161 | 165 | ||
166 | /* flags to check in __switch_to() */ | ||
167 | #define _TIF_WORK_CTXSW (_TIF_DEBUG|_TIF_IO_BITMAP) | ||
168 | |||
162 | /* | 169 | /* |
163 | * Thread-synchronous status. | 170 | * Thread-synchronous status. |
164 | * | 171 | * |
diff --git a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild new file mode 100644 index 000000000000..85d6f8005eb4 --- /dev/null +++ b/include/asm-ia64/Kbuild | |||
@@ -0,0 +1,7 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | header-y += break.h fpu.h fpswa.h gcc_intrin.h ia64regs.h \ | ||
4 | intel_intrin.h intrinsics.h perfmon_default_smpl.h \ | ||
5 | ptrace_offsets.h rse.h setup.h ucontext.h | ||
6 | |||
7 | unifdef-y += perfmon.h | ||
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h index ea8b8c407ab4..27f9df6b9145 100644 --- a/include/asm-ia64/hw_irq.h +++ b/include/asm-ia64/hw_irq.h | |||
@@ -97,8 +97,7 @@ extern int reserve_irq_vector (int vector); | |||
97 | extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); | 97 | extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); |
98 | extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); | 98 | extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); |
99 | 99 | ||
100 | static inline void | 100 | static inline void ia64_resend_irq(unsigned int vector) |
101 | hw_resend_irq (struct hw_interrupt_type *h, unsigned int vector) | ||
102 | { | 101 | { |
103 | platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0); | 102 | platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0); |
104 | } | 103 | } |
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h index 781ee2c7e8c3..43bfff6c6b87 100644 --- a/include/asm-ia64/io.h +++ b/include/asm-ia64/io.h | |||
@@ -90,7 +90,7 @@ phys_to_virt (unsigned long address) | |||
90 | #define ARCH_HAS_VALID_PHYS_ADDR_RANGE | 90 | #define ARCH_HAS_VALID_PHYS_ADDR_RANGE |
91 | extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size); | 91 | extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size); |
92 | extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */ | 92 | extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */ |
93 | extern int valid_mmap_phys_addr_range (unsigned long addr, size_t count); | 93 | extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count); |
94 | 94 | ||
95 | /* | 95 | /* |
96 | * The following two macros are deprecated and scheduled for removal. | 96 | * The following two macros are deprecated and scheduled for removal. |
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h index dbe86c0bbce5..79479e2c6966 100644 --- a/include/asm-ia64/irq.h +++ b/include/asm-ia64/irq.h | |||
@@ -14,11 +14,6 @@ | |||
14 | #define NR_IRQS 256 | 14 | #define NR_IRQS 256 |
15 | #define NR_IRQ_VECTORS NR_IRQS | 15 | #define NR_IRQ_VECTORS NR_IRQS |
16 | 16 | ||
17 | /* | ||
18 | * IRQ line status macro IRQ_PER_CPU is used | ||
19 | */ | ||
20 | #define ARCH_HAS_IRQ_PER_CPU | ||
21 | |||
22 | static __inline__ int | 17 | static __inline__ int |
23 | irq_canonicalize (int irq) | 18 | irq_canonicalize (int irq) |
24 | { | 19 | { |
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h index 24d898b650c5..fbe5cf3ab8dc 100644 --- a/include/asm-ia64/percpu.h +++ b/include/asm-ia64/percpu.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #ifdef CONFIG_SMP | 36 | #ifdef CONFIG_SMP |
37 | 37 | ||
38 | extern unsigned long __per_cpu_offset[NR_CPUS]; | 38 | extern unsigned long __per_cpu_offset[NR_CPUS]; |
39 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
39 | 40 | ||
40 | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ | 41 | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ |
41 | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); | 42 | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); |
diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h index 1327c91ea39c..2d1640cc240a 100644 --- a/include/asm-ia64/rwsem.h +++ b/include/asm-ia64/rwsem.h | |||
@@ -33,9 +33,6 @@ struct rw_semaphore { | |||
33 | signed long count; | 33 | signed long count; |
34 | spinlock_t wait_lock; | 34 | spinlock_t wait_lock; |
35 | struct list_head wait_list; | 35 | struct list_head wait_list; |
36 | #if RWSEM_DEBUG | ||
37 | int debug; | ||
38 | #endif | ||
39 | }; | 36 | }; |
40 | 37 | ||
41 | #define RWSEM_UNLOCKED_VALUE __IA64_UL_CONST(0x0000000000000000) | 38 | #define RWSEM_UNLOCKED_VALUE __IA64_UL_CONST(0x0000000000000000) |
@@ -45,19 +42,9 @@ struct rw_semaphore { | |||
45 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS | 42 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS |
46 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 43 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
47 | 44 | ||
48 | /* | ||
49 | * initialization | ||
50 | */ | ||
51 | #if RWSEM_DEBUG | ||
52 | #define __RWSEM_DEBUG_INIT , 0 | ||
53 | #else | ||
54 | #define __RWSEM_DEBUG_INIT /* */ | ||
55 | #endif | ||
56 | |||
57 | #define __RWSEM_INITIALIZER(name) \ | 45 | #define __RWSEM_INITIALIZER(name) \ |
58 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | 46 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ |
59 | LIST_HEAD_INIT((name).wait_list) \ | 47 | LIST_HEAD_INIT((name).wait_list) } |
60 | __RWSEM_DEBUG_INIT } | ||
61 | 48 | ||
62 | #define DECLARE_RWSEM(name) \ | 49 | #define DECLARE_RWSEM(name) \ |
63 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 50 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
@@ -73,9 +60,6 @@ init_rwsem (struct rw_semaphore *sem) | |||
73 | sem->count = RWSEM_UNLOCKED_VALUE; | 60 | sem->count = RWSEM_UNLOCKED_VALUE; |
74 | spin_lock_init(&sem->wait_lock); | 61 | spin_lock_init(&sem->wait_lock); |
75 | INIT_LIST_HEAD(&sem->wait_list); | 62 | INIT_LIST_HEAD(&sem->wait_list); |
76 | #if RWSEM_DEBUG | ||
77 | sem->debug = 0; | ||
78 | #endif | ||
79 | } | 63 | } |
80 | 64 | ||
81 | /* | 65 | /* |
diff --git a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h index 5e328ed5d01d..4f5ca5643cb1 100644 --- a/include/asm-ia64/signal.h +++ b/include/asm-ia64/signal.h | |||
@@ -56,7 +56,6 @@ | |||
56 | * SA_FLAGS values: | 56 | * SA_FLAGS values: |
57 | * | 57 | * |
58 | * SA_ONSTACK indicates that a registered stack_t will be used. | 58 | * SA_ONSTACK indicates that a registered stack_t will be used. |
59 | * SA_INTERRUPT is a no-op, but left due to historical reasons. | ||
60 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 59 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
61 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 60 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
62 | * SA_RESETHAND clears the handler when the signal is delivered. | 61 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -76,7 +75,6 @@ | |||
76 | 75 | ||
77 | #define SA_NOMASK SA_NODEFER | 76 | #define SA_NOMASK SA_NODEFER |
78 | #define SA_ONESHOT SA_RESETHAND | 77 | #define SA_ONESHOT SA_RESETHAND |
79 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
80 | 78 | ||
81 | #define SA_RESTORER 0x04000000 | 79 | #define SA_RESTORER 0x04000000 |
82 | 80 | ||
@@ -114,8 +112,6 @@ | |||
114 | #define _NSIG_BPW 64 | 112 | #define _NSIG_BPW 64 |
115 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | 113 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) |
116 | 114 | ||
117 | #define SA_PERCPU_IRQ 0x02000000 | ||
118 | |||
119 | #endif /* __KERNEL__ */ | 115 | #endif /* __KERNEL__ */ |
120 | 116 | ||
121 | #include <asm-generic/signal.h> | 117 | #include <asm-generic/signal.h> |
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index cd490b20d592..bd4452bda357 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h | |||
@@ -85,6 +85,7 @@ | |||
85 | #define SN_SAL_GET_PROM_FEATURE_SET 0x02000065 | 85 | #define SN_SAL_GET_PROM_FEATURE_SET 0x02000065 |
86 | #define SN_SAL_SET_OS_FEATURE_SET 0x02000066 | 86 | #define SN_SAL_SET_OS_FEATURE_SET 0x02000066 |
87 | #define SN_SAL_INJECT_ERROR 0x02000067 | 87 | #define SN_SAL_INJECT_ERROR 0x02000067 |
88 | #define SN_SAL_SET_CPU_NUMBER 0x02000068 | ||
88 | 89 | ||
89 | /* | 90 | /* |
90 | * Service-specific constants | 91 | * Service-specific constants |
@@ -1150,4 +1151,13 @@ sn_inject_error(u64 paddr, u64 *data, u64 *ecc) | |||
1150 | local_irq_restore(irq_flags); | 1151 | local_irq_restore(irq_flags); |
1151 | return ret_stuff.status; | 1152 | return ret_stuff.status; |
1152 | } | 1153 | } |
1154 | |||
1155 | static inline int | ||
1156 | ia64_sn_set_cpu_number(int cpu) | ||
1157 | { | ||
1158 | struct ia64_sal_retval rv; | ||
1159 | |||
1160 | SAL_CALL_NOLOCK(rv, SN_SAL_SET_CPU_NUMBER, cpu, 0, 0, 0, 0, 0, 0); | ||
1161 | return rv.status; | ||
1162 | } | ||
1153 | #endif /* _ASM_IA64_SN_SN_SAL_H */ | 1163 | #endif /* _ASM_IA64_SN_SN_SAL_H */ |
diff --git a/include/asm-ia64/sn/tioca_provider.h b/include/asm-ia64/sn/tioca_provider.h index ab7fe2463468..65cdd73c2a57 100644 --- a/include/asm-ia64/sn/tioca_provider.h +++ b/include/asm-ia64/sn/tioca_provider.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #define PV908234 (1 << 1) | 27 | #define PV908234 (1 << 1) |
28 | /* CA:AGPDMA write request data mismatch with ABC1CL merge */ | 28 | /* CA:AGPDMA write request data mismatch with ABC1CL merge */ |
29 | #define PV895469 (1 << 1) | 29 | #define PV895469 (1 << 1) |
30 | /* TIO:CA TLB invalidate of written GART entries possibly not occuring in CA*/ | 30 | /* TIO:CA TLB invalidate of written GART entries possibly not occurring in CA*/ |
31 | #define PV910244 (1 << 1) | 31 | #define PV910244 (1 << 1) |
32 | 32 | ||
33 | struct tioca_dmamap{ | 33 | struct tioca_dmamap{ |
diff --git a/include/asm-ia64/socket.h b/include/asm-ia64/socket.h index a255006fb7b5..d638ef3d50c3 100644 --- a/include/asm-ia64/socket.h +++ b/include/asm-ia64/socket.h | |||
@@ -57,5 +57,6 @@ | |||
57 | #define SO_ACCEPTCONN 30 | 57 | #define SO_ACCEPTCONN 30 |
58 | 58 | ||
59 | #define SO_PEERSEC 31 | 59 | #define SO_PEERSEC 31 |
60 | #define SO_PASSSEC 34 | ||
60 | 61 | ||
61 | #endif /* _ASM_IA64_SOCKET_H */ | 62 | #endif /* _ASM_IA64_SOCKET_H */ |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 8bc9869e5765..8adcde0934ca 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -68,7 +68,7 @@ struct thread_info { | |||
68 | #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) | 68 | #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) |
69 | 69 | ||
70 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR | 70 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR |
71 | #define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER)) | 71 | #define alloc_task_struct() ((struct task_struct *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER)) |
72 | #define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER) | 72 | #define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER) |
73 | 73 | ||
74 | #endif /* !__ASSEMBLY */ | 74 | #endif /* !__ASSEMBLY */ |
diff --git a/include/asm-m32r/Kbuild b/include/asm-m32r/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-m32r/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-m32r/hw_irq.h b/include/asm-m32r/hw_irq.h index 8d7e9d0e09e8..7138537cda03 100644 --- a/include/asm-m32r/hw_irq.h +++ b/include/asm-m32r/hw_irq.h | |||
@@ -1,9 +1,4 @@ | |||
1 | #ifndef _ASM_M32R_HW_IRQ_H | 1 | #ifndef _ASM_M32R_HW_IRQ_H |
2 | #define _ASM_M32R_HW_IRQ_H | 2 | #define _ASM_M32R_HW_IRQ_H |
3 | 3 | ||
4 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) | ||
5 | { | ||
6 | /* Nothing to do */ | ||
7 | } | ||
8 | |||
9 | #endif /* _ASM_M32R_HW_IRQ_H */ | 4 | #endif /* _ASM_M32R_HW_IRQ_H */ |
diff --git a/include/asm-m32r/signal.h b/include/asm-m32r/signal.h index 95f69b191953..e750045164d4 100644 --- a/include/asm-m32r/signal.h +++ b/include/asm-m32r/signal.h | |||
@@ -81,7 +81,6 @@ typedef unsigned long sigset_t; | |||
81 | * SA_FLAGS values: | 81 | * SA_FLAGS values: |
82 | * | 82 | * |
83 | * SA_ONSTACK indicates that a registered stack_t will be used. | 83 | * SA_ONSTACK indicates that a registered stack_t will be used. |
84 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
85 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 84 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
86 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 85 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
87 | * SA_RESETHAND clears the handler when the signal is delivered. | 86 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -101,7 +100,6 @@ typedef unsigned long sigset_t; | |||
101 | 100 | ||
102 | #define SA_NOMASK SA_NODEFER | 101 | #define SA_NOMASK SA_NODEFER |
103 | #define SA_ONESHOT SA_RESETHAND | 102 | #define SA_ONESHOT SA_RESETHAND |
104 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
105 | 103 | ||
106 | #define SA_RESTORER 0x04000000 | 104 | #define SA_RESTORER 0x04000000 |
107 | 105 | ||
diff --git a/include/asm-m32r/socket.h b/include/asm-m32r/socket.h index 8b6680f223c0..acdf748fcdc8 100644 --- a/include/asm-m32r/socket.h +++ b/include/asm-m32r/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_M32R_SOCKET_H */ | 53 | #endif /* _ASM_M32R_SOCKET_H */ |
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index 66c4742f09e7..311cebf44eff 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h | |||
@@ -18,7 +18,7 @@ | |||
18 | * switch_to(prev, next) should switch from task `prev' to `next' | 18 | * switch_to(prev, next) should switch from task `prev' to `next' |
19 | * `prev' will never be the same as `next'. | 19 | * `prev' will never be the same as `next'. |
20 | * | 20 | * |
21 | * `next' and `prev' should be task_t, but it isn't always defined | 21 | * `next' and `prev' should be struct task_struct, but it isn't always defined |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #define switch_to(prev, next, last) do { \ | 24 | #define switch_to(prev, next, last) do { \ |
diff --git a/include/asm-m68k/Kbuild b/include/asm-m68k/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-m68k/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-m68k/floppy.h b/include/asm-m68k/floppy.h index 63a05ed95c17..57f4fdda65ab 100644 --- a/include/asm-m68k/floppy.h +++ b/include/asm-m68k/floppy.h | |||
@@ -88,8 +88,8 @@ static __inline__ void fd_outb(unsigned char value, int port) | |||
88 | static int fd_request_irq(void) | 88 | static int fd_request_irq(void) |
89 | { | 89 | { |
90 | if(MACH_IS_Q40) | 90 | if(MACH_IS_Q40) |
91 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 91 | return request_irq(FLOPPY_IRQ, floppy_hardint, |
92 | "floppy", floppy_hardint); | 92 | IRQF_DISABLED, "floppy", floppy_hardint); |
93 | else if(MACH_IS_SUN3X) | 93 | else if(MACH_IS_SUN3X) |
94 | return sun3xflop_request_irq(); | 94 | return sun3xflop_request_irq(); |
95 | return -ENXIO; | 95 | return -ENXIO; |
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index f4ae7d8feac6..3257f9881002 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h | |||
@@ -67,8 +67,8 @@ struct pt_regs; | |||
67 | 67 | ||
68 | /* | 68 | /* |
69 | * various flags for request_irq() - the Amiga now uses the standard | 69 | * various flags for request_irq() - the Amiga now uses the standard |
70 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ | 70 | * mechanism like all other architectures - IRQF_DISABLED and |
71 | * are your friends. | 71 | * IRQF_SHARED are your friends. |
72 | */ | 72 | */ |
73 | #ifndef MACH_AMIGA_ONLY | 73 | #ifndef MACH_AMIGA_ONLY |
74 | #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ | 74 | #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ |
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h index 85037a3d3e8e..de1ba6ead3b4 100644 --- a/include/asm-m68k/signal.h +++ b/include/asm-m68k/signal.h | |||
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t; | |||
74 | * SA_FLAGS values: | 74 | * SA_FLAGS values: |
75 | * | 75 | * |
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | 76 | * SA_ONSTACK indicates that a registered stack_t will be used. |
77 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 77 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
80 | * SA_RESETHAND clears the handler when the signal is delivered. | 79 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t; | |||
94 | 93 | ||
95 | #define SA_NOMASK SA_NODEFER | 94 | #define SA_NOMASK SA_NODEFER |
96 | #define SA_ONESHOT SA_RESETHAND | 95 | #define SA_ONESHOT SA_RESETHAND |
97 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
98 | 96 | ||
99 | /* | 97 | /* |
100 | * sigaltstack controls | 98 | * sigaltstack controls |
diff --git a/include/asm-m68k/socket.h b/include/asm-m68k/socket.h index f578ca4b776a..a5966ec005ae 100644 --- a/include/asm-m68k/socket.h +++ b/include/asm-m68k/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-m68k/sun3xflop.h b/include/asm-m68k/sun3xflop.h index 98a9f79dab29..ca8cc4113843 100644 --- a/include/asm-m68k/sun3xflop.h +++ b/include/asm-m68k/sun3xflop.h | |||
@@ -208,7 +208,8 @@ static int sun3xflop_request_irq(void) | |||
208 | 208 | ||
209 | if(!once) { | 209 | if(!once) { |
210 | once = 1; | 210 | once = 1; |
211 | error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, SA_INTERRUPT, "floppy", NULL); | 211 | error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, |
212 | IRQF_DISABLED, "floppy", NULL); | ||
212 | return ((error == 0) ? 0 : -1); | 213 | return ((error == 0) ? 0 : -1); |
213 | } else return 0; | 214 | } else return 0; |
214 | } | 215 | } |
diff --git a/include/asm-m68knommu/Kbuild b/include/asm-m68knommu/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-m68knommu/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-m68knommu/bootstd.h b/include/asm-m68knommu/bootstd.h index 3fdc79f06d50..bdc1a4ac4fe9 100644 --- a/include/asm-m68knommu/bootstd.h +++ b/include/asm-m68knommu/bootstd.h | |||
@@ -52,7 +52,7 @@ type name(void) \ | |||
52 | __asm__ __volatile__ ("trap #2" \ | 52 | __asm__ __volatile__ ("trap #2" \ |
53 | : "=g" (__res) \ | 53 | : "=g" (__res) \ |
54 | : "0" (__res) \ | 54 | : "0" (__res) \ |
55 | : "%d0"); \ | 55 | ); \ |
56 | __bsc_return(type,__res); \ | 56 | __bsc_return(type,__res); \ |
57 | } | 57 | } |
58 | 58 | ||
@@ -64,7 +64,7 @@ type name(atype a) \ | |||
64 | __asm__ __volatile__ ("trap #2" \ | 64 | __asm__ __volatile__ ("trap #2" \ |
65 | : "=g" (__res) \ | 65 | : "=g" (__res) \ |
66 | : "0" (__res), "d" (__a) \ | 66 | : "0" (__res), "d" (__a) \ |
67 | : "%d0"); \ | 67 | ); \ |
68 | __bsc_return(type,__res); \ | 68 | __bsc_return(type,__res); \ |
69 | } | 69 | } |
70 | 70 | ||
@@ -77,7 +77,7 @@ type name(atype a, btype b) \ | |||
77 | __asm__ __volatile__ ("trap #2" \ | 77 | __asm__ __volatile__ ("trap #2" \ |
78 | : "=g" (__res) \ | 78 | : "=g" (__res) \ |
79 | : "0" (__res), "d" (__a), "d" (__b) \ | 79 | : "0" (__res), "d" (__a), "d" (__b) \ |
80 | : "%d0"); \ | 80 | ); \ |
81 | __bsc_return(type,__res); \ | 81 | __bsc_return(type,__res); \ |
82 | } | 82 | } |
83 | 83 | ||
@@ -92,7 +92,7 @@ type name(atype a, btype b, ctype c) \ | |||
92 | : "=g" (__res) \ | 92 | : "=g" (__res) \ |
93 | : "0" (__res), "d" (__a), "d" (__b), \ | 93 | : "0" (__res), "d" (__a), "d" (__b), \ |
94 | "d" (__c) \ | 94 | "d" (__c) \ |
95 | : "%d0"); \ | 95 | ); \ |
96 | __bsc_return(type,__res); \ | 96 | __bsc_return(type,__res); \ |
97 | } | 97 | } |
98 | 98 | ||
@@ -108,7 +108,7 @@ type name(atype a, btype b, ctype c, dtype d) \ | |||
108 | : "=g" (__res) \ | 108 | : "=g" (__res) \ |
109 | : "0" (__res), "d" (__a), "d" (__b), \ | 109 | : "0" (__res), "d" (__a), "d" (__b), \ |
110 | "d" (__c), "d" (__d) \ | 110 | "d" (__c), "d" (__d) \ |
111 | : "%d0"); \ | 111 | ); \ |
112 | __bsc_return(type,__res); \ | 112 | __bsc_return(type,__res); \ |
113 | } | 113 | } |
114 | 114 | ||
@@ -125,7 +125,7 @@ type name(atype a, btype b, ctype c, dtype d, etype e) \ | |||
125 | : "=g" (__res) \ | 125 | : "=g" (__res) \ |
126 | : "0" (__res), "d" (__a), "d" (__b), \ | 126 | : "0" (__res), "d" (__a), "d" (__b), \ |
127 | "d" (__c), "d" (__d), "d" (__e) \ | 127 | "d" (__c), "d" (__d), "d" (__e) \ |
128 | : "%d0"); \ | 128 | ); \ |
129 | __bsc_return(type,__res); \ | 129 | __bsc_return(type,__res); \ |
130 | } | 130 | } |
131 | 131 | ||
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h index 53557274eef8..45e7a2fd1689 100644 --- a/include/asm-m68knommu/irq.h +++ b/include/asm-m68knommu/irq.h | |||
@@ -62,8 +62,8 @@ extern void (*mach_disable_irq)(unsigned int); | |||
62 | 62 | ||
63 | /* | 63 | /* |
64 | * various flags for request_irq() - the Amiga now uses the standard | 64 | * various flags for request_irq() - the Amiga now uses the standard |
65 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ | 65 | * mechanism like all other architectures - IRQF_DISABLED and |
66 | * are your friends. | 66 | * IRQF_SHARED are your friends. |
67 | */ | 67 | */ |
68 | #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ | 68 | #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ |
69 | #define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */ | 69 | #define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */ |
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h index 0ee158e09abb..9d3a1bf41231 100644 --- a/include/asm-m68knommu/processor.h +++ b/include/asm-m68knommu/processor.h | |||
@@ -13,6 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | 14 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) |
15 | 15 | ||
16 | #include <linux/compiler.h> | ||
16 | #include <linux/threads.h> | 17 | #include <linux/threads.h> |
17 | #include <asm/types.h> | 18 | #include <asm/types.h> |
18 | #include <asm/segment.h> | 19 | #include <asm/segment.h> |
@@ -137,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p); | |||
137 | eip; }) | 138 | eip; }) |
138 | #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) | 139 | #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) |
139 | 140 | ||
140 | #define cpu_relax() do { } while (0) | 141 | #define cpu_relax() barrier() |
141 | 142 | ||
142 | #endif | 143 | #endif |
diff --git a/include/asm-m68knommu/signal.h b/include/asm-m68knommu/signal.h index 1d13187f6062..216c08be54a0 100644 --- a/include/asm-m68knommu/signal.h +++ b/include/asm-m68knommu/signal.h | |||
@@ -74,7 +74,6 @@ typedef unsigned long sigset_t; | |||
74 | * SA_FLAGS values: | 74 | * SA_FLAGS values: |
75 | * | 75 | * |
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | 76 | * SA_ONSTACK indicates that a registered stack_t will be used. |
77 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 77 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
80 | * SA_RESETHAND clears the handler when the signal is delivered. | 79 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -94,7 +93,6 @@ typedef unsigned long sigset_t; | |||
94 | 93 | ||
95 | #define SA_NOMASK SA_NODEFER | 94 | #define SA_NOMASK SA_NODEFER |
96 | #define SA_ONESHOT SA_RESETHAND | 95 | #define SA_ONESHOT SA_RESETHAND |
97 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
98 | 96 | ||
99 | /* | 97 | /* |
100 | * sigaltstack controls | 98 | * sigaltstack controls |
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index 05be9515a2d2..62b29b10bc6d 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/include/asm-m68knommu/uaccess.h | |||
@@ -93,7 +93,7 @@ extern int __put_user_bad(void); | |||
93 | #define get_user(x, ptr) \ | 93 | #define get_user(x, ptr) \ |
94 | ({ \ | 94 | ({ \ |
95 | int __gu_err = 0; \ | 95 | int __gu_err = 0; \ |
96 | typeof(*(ptr)) __gu_val = 0; \ | 96 | typeof(x) __gu_val = 0; \ |
97 | switch (sizeof(*(ptr))) { \ | 97 | switch (sizeof(*(ptr))) { \ |
98 | case 1: \ | 98 | case 1: \ |
99 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ | 99 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ |
@@ -105,23 +105,23 @@ extern int __put_user_bad(void); | |||
105 | __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ | 105 | __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ |
106 | break; \ | 106 | break; \ |
107 | case 8: \ | 107 | case 8: \ |
108 | memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ | 108 | memcpy((void *) &__gu_val, ptr, sizeof (*(ptr))); \ |
109 | break; \ | 109 | break; \ |
110 | default: \ | 110 | default: \ |
111 | __gu_val = 0; \ | 111 | __gu_val = 0; \ |
112 | __gu_err = __get_user_bad(); \ | 112 | __gu_err = __get_user_bad(); \ |
113 | break; \ | 113 | break; \ |
114 | } \ | 114 | } \ |
115 | (x) = __gu_val; \ | 115 | (x) = (typeof(*(ptr))) __gu_val; \ |
116 | __gu_err; \ | 116 | __gu_err; \ |
117 | }) | 117 | }) |
118 | #define __get_user(x, ptr) get_user(x, ptr) | 118 | #define __get_user(x, ptr) get_user(x, ptr) |
119 | 119 | ||
120 | extern int __get_user_bad(void); | 120 | extern int __get_user_bad(void); |
121 | 121 | ||
122 | #define __get_user_asm(err,x,ptr,bwl,reg) \ | 122 | #define __get_user_asm(err,x,ptr,bwl,reg) \ |
123 | __asm__ ("move" #bwl " %1,%0" \ | 123 | __asm__ ("move" #bwl " %1,%0" \ |
124 | : "=d" (x) \ | 124 | : "=d" (x) \ |
125 | : "m" (*__ptr(ptr))) | 125 | : "m" (*__ptr(ptr))) |
126 | 126 | ||
127 | #define copy_from_user(to, from, n) (memcpy(to, from, n), 0) | 127 | #define copy_from_user(to, from, n) (memcpy(to, from, n), 0) |
diff --git a/include/asm-mips/Kbuild b/include/asm-mips/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-mips/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h index 2c42f6b00a49..92e62ef711ed 100644 --- a/include/asm-mips/asmmacro.h +++ b/include/asm-mips/asmmacro.h | |||
@@ -26,14 +26,14 @@ | |||
26 | ori \reg, \reg, TCSTATUS_IXMT | 26 | ori \reg, \reg, TCSTATUS_IXMT |
27 | xori \reg, \reg, TCSTATUS_IXMT | 27 | xori \reg, \reg, TCSTATUS_IXMT |
28 | mtc0 \reg, CP0_TCSTATUS | 28 | mtc0 \reg, CP0_TCSTATUS |
29 | ehb | 29 | _ehb |
30 | .endm | 30 | .endm |
31 | 31 | ||
32 | .macro local_irq_disable reg=t0 | 32 | .macro local_irq_disable reg=t0 |
33 | mfc0 \reg, CP0_TCSTATUS | 33 | mfc0 \reg, CP0_TCSTATUS |
34 | ori \reg, \reg, TCSTATUS_IXMT | 34 | ori \reg, \reg, TCSTATUS_IXMT |
35 | mtc0 \reg, CP0_TCSTATUS | 35 | mtc0 \reg, CP0_TCSTATUS |
36 | ehb | 36 | _ehb |
37 | .endm | 37 | .endm |
38 | #else | 38 | #else |
39 | .macro local_irq_enable reg=t0 | 39 | .macro local_irq_enable reg=t0 |
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 881ce1f9803d..44285a9d5520 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -187,19 +187,15 @@ | |||
187 | # endif | 187 | # endif |
188 | #endif | 188 | #endif |
189 | 189 | ||
190 | #ifdef CONFIG_CPU_MIPSR2 | 190 | #if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint) |
191 | # if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint) | 191 | # define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT) |
192 | # define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT) | 192 | #elif !defined(cpu_has_vint) |
193 | # else | ||
194 | # define cpu_has_vint 0 | ||
195 | # endif | ||
196 | # if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic) | ||
197 | # define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC) | ||
198 | # else | ||
199 | # define cpu_has_veic 0 | ||
200 | # endif | ||
201 | #else | ||
202 | # define cpu_has_vint 0 | 193 | # define cpu_has_vint 0 |
194 | #endif | ||
195 | |||
196 | #if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic) | ||
197 | # define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC) | ||
198 | #elif !defined(cpu_has_veic) | ||
203 | # define cpu_has_veic 0 | 199 | # define cpu_has_veic 0 |
204 | #endif | 200 | #endif |
205 | 201 | ||
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h index 1cadefbbc037..6959bdb59310 100644 --- a/include/asm-mips/fixmap.h +++ b/include/asm-mips/fixmap.h | |||
@@ -69,7 +69,11 @@ extern void __set_fixmap (enum fixed_addresses idx, | |||
69 | * the start of the fixmap, and leave one page empty | 69 | * the start of the fixmap, and leave one page empty |
70 | * at the top of mem.. | 70 | * at the top of mem.. |
71 | */ | 71 | */ |
72 | #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) | ||
73 | #define FIXADDR_TOP (0xff000000UL - 0x2000) | ||
74 | #else | ||
72 | #define FIXADDR_TOP (0xffffe000UL) | 75 | #define FIXADDR_TOP (0xffffe000UL) |
76 | #endif | ||
73 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) | 77 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) |
74 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) | 78 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
75 | 79 | ||
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h index 66943c451c1d..25f5e8a4177d 100644 --- a/include/asm-mips/hazards.h +++ b/include/asm-mips/hazards.h | |||
@@ -69,10 +69,10 @@ | |||
69 | * Use a macro for ehb unless explicit support for MIPSR2 is enabled | 69 | * Use a macro for ehb unless explicit support for MIPSR2 is enabled |
70 | */ | 70 | */ |
71 | 71 | ||
72 | #define irq_enable_hazard | 72 | #define irq_enable_hazard \ |
73 | _ehb | 73 | _ehb |
74 | 74 | ||
75 | #define irq_disable_hazard | 75 | #define irq_disable_hazard \ |
76 | _ehb | 76 | _ehb |
77 | 77 | ||
78 | #elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) | 78 | #elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) |
diff --git a/include/asm-mips/hw_irq.h b/include/asm-mips/hw_irq.h index c854d017c0e5..458d9fdc76bf 100644 --- a/include/asm-mips/hw_irq.h +++ b/include/asm-mips/hw_irq.h | |||
@@ -19,9 +19,9 @@ extern void init_8259A(int aeoi); | |||
19 | 19 | ||
20 | extern atomic_t irq_err_count; | 20 | extern atomic_t irq_err_count; |
21 | 21 | ||
22 | /* This may not be apropriate for all machines, we'll see ... */ | 22 | /* |
23 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) | 23 | * interrupt-retrigger: NOP for now. This may not be apropriate for all |
24 | { | 24 | * machines, we'll see ... |
25 | } | 25 | */ |
26 | 26 | ||
27 | #endif /* __ASM_HW_IRQ_H */ | 27 | #endif /* __ASM_HW_IRQ_H */ |
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index d35c61776a02..896550bad322 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h | |||
@@ -76,4 +76,8 @@ extern int setup_irq_smtc(unsigned int irq, struct irqaction * new, | |||
76 | unsigned long hwmask); | 76 | unsigned long hwmask); |
77 | #endif /* CONFIG_MIPS_MT_SMTC */ | 77 | #endif /* CONFIG_MIPS_MT_SMTC */ |
78 | 78 | ||
79 | #ifdef CONFIG_SMP | ||
80 | #define ARCH_HAS_IRQ_PER_CPU | ||
81 | #endif | ||
82 | |||
79 | #endif /* _ASM_IRQ_H */ | 83 | #endif /* _ASM_IRQ_H */ |
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h index d7cbacdd21fe..1bd4e27caf6b 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_psc.h +++ b/include/asm-mips/mach-au1x00/au1xxx_psc.h | |||
@@ -512,7 +512,7 @@ typedef struct psc_smb { | |||
512 | 512 | ||
513 | /* Transmit register control. | 513 | /* Transmit register control. |
514 | */ | 514 | */ |
515 | #define PSC_SMBTXRX_RSR (1 << 30) | 515 | #define PSC_SMBTXRX_RSR (1 << 28) |
516 | #define PSC_SMBTXRX_STP (1 << 29) | 516 | #define PSC_SMBTXRX_STP (1 << 29) |
517 | #define PSC_SMBTXRX_DATAMASK (0xff) | 517 | #define PSC_SMBTXRX_DATAMASK (0xff) |
518 | 518 | ||
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h index 6d37a5675803..6724e99e43e1 100644 --- a/include/asm-mips/mach-dec/mc146818rtc.h +++ b/include/asm-mips/mach-dec/mc146818rtc.h | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | extern volatile u8 *dec_rtc_base; | 20 | extern volatile u8 *dec_rtc_base; |
21 | 21 | ||
22 | #define ARCH_RTC_LOCATION | ||
23 | |||
22 | #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) | 24 | #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) |
23 | #define RTC_IO_EXTENT dec_kn_slot_size | 25 | #define RTC_IO_EXTENT dec_kn_slot_size |
24 | #define RTC_IOMAPPED 0 | 26 | #define RTC_IOMAPPED 0 |
diff --git a/include/asm-mips/mach-generic/floppy.h b/include/asm-mips/mach-generic/floppy.h index 83cd69e30ec3..001a8ce17c17 100644 --- a/include/asm-mips/mach-generic/floppy.h +++ b/include/asm-mips/mach-generic/floppy.h | |||
@@ -98,7 +98,7 @@ static inline void fd_disable_irq(void) | |||
98 | static inline int fd_request_irq(void) | 98 | static inline int fd_request_irq(void) |
99 | { | 99 | { |
100 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 100 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
101 | SA_INTERRUPT, "floppy", NULL); | 101 | IRQF_DISABLED, "floppy", NULL); |
102 | } | 102 | } |
103 | 103 | ||
104 | static inline void fd_free_irq(void) | 104 | static inline void fd_free_irq(void) |
diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h index 9413117915f4..56e9ca6ae426 100644 --- a/include/asm-mips/mach-jazz/floppy.h +++ b/include/asm-mips/mach-jazz/floppy.h | |||
@@ -90,7 +90,7 @@ static inline void fd_disable_irq(void) | |||
90 | static inline int fd_request_irq(void) | 90 | static inline int fd_request_irq(void) |
91 | { | 91 | { |
92 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 92 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
93 | SA_INTERRUPT, "floppy", NULL); | 93 | IRQF_DISABLED, "floppy", NULL); |
94 | } | 94 | } |
95 | 95 | ||
96 | static inline void fd_free_irq(void) | 96 | static inline void fd_free_irq(void) |
diff --git a/include/asm-mips/mach-mips/irq.h b/include/asm-mips/mach-mips/irq.h index 083d9c512a04..e994b0c01227 100644 --- a/include/asm-mips/mach-mips/irq.h +++ b/include/asm-mips/mach-mips/irq.h | |||
@@ -4,10 +4,4 @@ | |||
4 | 4 | ||
5 | #define NR_IRQS 256 | 5 | #define NR_IRQS 256 |
6 | 6 | ||
7 | #ifdef CONFIG_SMP | ||
8 | |||
9 | #define ARCH_HAS_IRQ_PER_CPU | ||
10 | |||
11 | #endif | ||
12 | |||
13 | #endif /* __ASM_MACH_MIPS_IRQ_H */ | 7 | #endif /* __ASM_MACH_MIPS_IRQ_H */ |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 673977901ed3..9192d76c133d 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -1459,7 +1459,8 @@ static inline void __emt(unsigned int previous) | |||
1459 | static inline void __ehb(void) | 1459 | static inline void __ehb(void) |
1460 | { | 1460 | { |
1461 | __asm__ __volatile__( | 1461 | __asm__ __volatile__( |
1462 | " ehb \n"); | 1462 | " .set mips32r2 \n" |
1463 | " ehb \n" " .set mips0 \n"); | ||
1463 | } | 1464 | } |
1464 | 1465 | ||
1465 | /* | 1466 | /* |
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h index a1f3a3fa9bd6..87a1dff95199 100644 --- a/include/asm-mips/signal.h +++ b/include/asm-mips/signal.h | |||
@@ -64,7 +64,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ | |||
64 | * SA_FLAGS values: | 64 | * SA_FLAGS values: |
65 | * | 65 | * |
66 | * SA_ONSTACK indicates that a registered stack_t will be used. | 66 | * SA_ONSTACK indicates that a registered stack_t will be used. |
67 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
68 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 67 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
69 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 68 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
70 | * SA_RESETHAND clears the handler when the signal is delivered. | 69 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -84,7 +83,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ | |||
84 | 83 | ||
85 | #define SA_NOMASK SA_NODEFER | 84 | #define SA_NOMASK SA_NODEFER |
86 | #define SA_ONESHOT SA_RESETHAND | 85 | #define SA_ONESHOT SA_RESETHAND |
87 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
88 | 86 | ||
89 | #define SA_RESTORER 0x04000000 /* Only for o32 */ | 87 | #define SA_RESTORER 0x04000000 /* Only for o32 */ |
90 | 88 | ||
@@ -99,15 +97,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ | |||
99 | 97 | ||
100 | #ifdef __KERNEL__ | 98 | #ifdef __KERNEL__ |
101 | 99 | ||
102 | /* | ||
103 | * These values of sa_flags are used only by the kernel as part of the | ||
104 | * irq handling routines. | ||
105 | * | ||
106 | * SA_INTERRUPT is also used by the irq handling routines. | ||
107 | * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. | ||
108 | */ | ||
109 | #define SA_SAMPLE_RANDOM SA_RESTART | ||
110 | |||
111 | #ifdef CONFIG_TRAD_SIGNALS | 100 | #ifdef CONFIG_TRAD_SIGNALS |
112 | #define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO) | 101 | #define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO) |
113 | #else | 102 | #else |
diff --git a/include/asm-mips/sn/ioc3.h b/include/asm-mips/sn/ioc3.h index f7d530f306f2..099677774d71 100644 --- a/include/asm-mips/sn/ioc3.h +++ b/include/asm-mips/sn/ioc3.h | |||
@@ -5,6 +5,8 @@ | |||
5 | #ifndef _IOC3_H | 5 | #ifndef _IOC3_H |
6 | #define _IOC3_H | 6 | #define _IOC3_H |
7 | 7 | ||
8 | #include <linux/types.h> | ||
9 | |||
8 | /* SUPERIO uart register map */ | 10 | /* SUPERIO uart register map */ |
9 | typedef volatile struct ioc3_uartregs { | 11 | typedef volatile struct ioc3_uartregs { |
10 | union { | 12 | union { |
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h index 52238e65af8e..b63cd0655b3d 100644 --- a/include/asm-mips/sn/klconfig.h +++ b/include/asm-mips/sn/klconfig.h | |||
@@ -602,7 +602,7 @@ typedef struct klcpu_s { /* CPU */ | |||
602 | 602 | ||
603 | typedef struct klhub_s { /* HUB */ | 603 | typedef struct klhub_s { /* HUB */ |
604 | klinfo_t hub_info; | 604 | klinfo_t hub_info; |
605 | uint hub_flags; /* PCFG_HUB_xxx flags */ | 605 | unsigned int hub_flags; /* PCFG_HUB_xxx flags */ |
606 | klport_t hub_port; /* hub is connected to this */ | 606 | klport_t hub_port; /* hub is connected to this */ |
607 | nic_t hub_box_nic; /* nic of containing box */ | 607 | nic_t hub_box_nic; /* nic of containing box */ |
608 | klconf_off_t hub_mfg_nic; /* MFG NIC string */ | 608 | klconf_off_t hub_mfg_nic; /* MFG NIC string */ |
@@ -611,7 +611,7 @@ typedef struct klhub_s { /* HUB */ | |||
611 | 611 | ||
612 | typedef struct klhub_uart_s { /* HUB */ | 612 | typedef struct klhub_uart_s { /* HUB */ |
613 | klinfo_t hubuart_info; | 613 | klinfo_t hubuart_info; |
614 | uint hubuart_flags; /* PCFG_HUB_xxx flags */ | 614 | unsigned int hubuart_flags; /* PCFG_HUB_xxx flags */ |
615 | nic_t hubuart_box_nic; /* nic of containing box */ | 615 | nic_t hubuart_box_nic; /* nic of containing box */ |
616 | } klhub_uart_t ; | 616 | } klhub_uart_t ; |
617 | 617 | ||
@@ -710,7 +710,7 @@ typedef struct klvmed_s { /* VME DEVICE - VME BOARD */ | |||
710 | /* XXX - Don't we need the number of ports here?!? */ | 710 | /* XXX - Don't we need the number of ports here?!? */ |
711 | typedef struct klrou_s { /* ROUTER */ | 711 | typedef struct klrou_s { /* ROUTER */ |
712 | klinfo_t rou_info ; | 712 | klinfo_t rou_info ; |
713 | uint rou_flags ; /* PCFG_ROUTER_xxx flags */ | 713 | unsigned int rou_flags ; /* PCFG_ROUTER_xxx flags */ |
714 | nic_t rou_box_nic ; /* nic of the containing module */ | 714 | nic_t rou_box_nic ; /* nic of the containing module */ |
715 | klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */ | 715 | klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */ |
716 | klconf_off_t rou_mfg_nic ; /* MFG NIC string */ | 716 | klconf_off_t rou_mfg_nic ; /* MFG NIC string */ |
@@ -733,8 +733,8 @@ typedef struct klgfx_s { /* GRAPHICS Device */ | |||
733 | klinfo_t gfx_info; | 733 | klinfo_t gfx_info; |
734 | klconf_off_t old_gndevs; /* for compatibility with older proms */ | 734 | klconf_off_t old_gndevs; /* for compatibility with older proms */ |
735 | klconf_off_t old_gdoff0; /* for compatibility with older proms */ | 735 | klconf_off_t old_gdoff0; /* for compatibility with older proms */ |
736 | uint cookie; /* for compatibility with older proms */ | 736 | unsigned int cookie; /* for compatibility with older proms */ |
737 | uint moduleslot; | 737 | unsigned int moduleslot; |
738 | struct klgfx_s *gfx_next_pipe; | 738 | struct klgfx_s *gfx_next_pipe; |
739 | graphics_t gfx_specific; | 739 | graphics_t gfx_specific; |
740 | klconf_off_t pad0; /* for compatibility with older proms */ | 740 | klconf_off_t pad0; /* for compatibility with older proms */ |
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h index 0bb31e5aaca6..36ebe4e186a7 100644 --- a/include/asm-mips/socket.h +++ b/include/asm-mips/socket.h | |||
@@ -69,6 +69,7 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ | |||
69 | #define SO_PEERSEC 30 | 69 | #define SO_PEERSEC 30 |
70 | #define SO_SNDBUFFORCE 31 | 70 | #define SO_SNDBUFFORCE 31 |
71 | #define SO_RCVBUFFORCE 33 | 71 | #define SO_RCVBUFFORCE 33 |
72 | #define SO_PASSSEC 34 | ||
72 | 73 | ||
73 | #ifdef __KERNEL__ | 74 | #ifdef __KERNEL__ |
74 | 75 | ||
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index 513aa5133830..158a4cd12e46 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h | |||
@@ -304,7 +304,7 @@ | |||
304 | mfc0 v0, CP0_TCSTATUS | 304 | mfc0 v0, CP0_TCSTATUS |
305 | ori v0, TCSTATUS_IXMT | 305 | ori v0, TCSTATUS_IXMT |
306 | mtc0 v0, CP0_TCSTATUS | 306 | mtc0 v0, CP0_TCSTATUS |
307 | ehb | 307 | _ehb |
308 | DMT 5 # dmt a1 | 308 | DMT 5 # dmt a1 |
309 | jal mips_ihb | 309 | jal mips_ihb |
310 | #endif /* CONFIG_MIPS_MT_SMTC */ | 310 | #endif /* CONFIG_MIPS_MT_SMTC */ |
@@ -325,14 +325,14 @@ | |||
325 | * restore TCStatus.IXMT. | 325 | * restore TCStatus.IXMT. |
326 | */ | 326 | */ |
327 | LONG_L v1, PT_TCSTATUS(sp) | 327 | LONG_L v1, PT_TCSTATUS(sp) |
328 | ehb | 328 | _ehb |
329 | mfc0 v0, CP0_TCSTATUS | 329 | mfc0 v0, CP0_TCSTATUS |
330 | andi v1, TCSTATUS_IXMT | 330 | andi v1, TCSTATUS_IXMT |
331 | /* We know that TCStatua.IXMT should be set from above */ | 331 | /* We know that TCStatua.IXMT should be set from above */ |
332 | xori v0, v0, TCSTATUS_IXMT | 332 | xori v0, v0, TCSTATUS_IXMT |
333 | or v0, v0, v1 | 333 | or v0, v0, v1 |
334 | mtc0 v0, CP0_TCSTATUS | 334 | mtc0 v0, CP0_TCSTATUS |
335 | ehb | 335 | _ehb |
336 | andi a1, a1, VPECONTROL_TE | 336 | andi a1, a1, VPECONTROL_TE |
337 | beqz a1, 1f | 337 | beqz a1, 1f |
338 | emt | 338 | emt |
@@ -411,7 +411,7 @@ | |||
411 | /* Clear TKSU, leave IXMT */ | 411 | /* Clear TKSU, leave IXMT */ |
412 | xori t0, 0x00001800 | 412 | xori t0, 0x00001800 |
413 | mtc0 t0, CP0_TCSTATUS | 413 | mtc0 t0, CP0_TCSTATUS |
414 | ehb | 414 | _ehb |
415 | /* We need to leave the global IE bit set, but clear EXL...*/ | 415 | /* We need to leave the global IE bit set, but clear EXL...*/ |
416 | mfc0 t0, CP0_STATUS | 416 | mfc0 t0, CP0_STATUS |
417 | ori t0, ST0_EXL | ST0_ERL | 417 | ori t0, ST0_EXL | ST0_ERL |
@@ -438,7 +438,7 @@ | |||
438 | * and enable interrupts only for the | 438 | * and enable interrupts only for the |
439 | * current TC, using the TCStatus register. | 439 | * current TC, using the TCStatus register. |
440 | */ | 440 | */ |
441 | ehb | 441 | _ehb |
442 | mfc0 t0,CP0_TCSTATUS | 442 | mfc0 t0,CP0_TCSTATUS |
443 | /* Fortunately CU 0 is in the same place in both registers */ | 443 | /* Fortunately CU 0 is in the same place in both registers */ |
444 | /* Set TCU0, TKSU (for later inversion) and IXMT */ | 444 | /* Set TCU0, TKSU (for later inversion) and IXMT */ |
@@ -447,7 +447,7 @@ | |||
447 | /* Clear TKSU *and* IXMT */ | 447 | /* Clear TKSU *and* IXMT */ |
448 | xori t0, 0x00001c00 | 448 | xori t0, 0x00001c00 |
449 | mtc0 t0, CP0_TCSTATUS | 449 | mtc0 t0, CP0_TCSTATUS |
450 | ehb | 450 | _ehb |
451 | /* We need to leave the global IE bit set, but clear EXL...*/ | 451 | /* We need to leave the global IE bit set, but clear EXL...*/ |
452 | mfc0 t0, CP0_STATUS | 452 | mfc0 t0, CP0_STATUS |
453 | ori t0, ST0_EXL | 453 | ori t0, ST0_EXL |
@@ -479,7 +479,7 @@ | |||
479 | andi v1, v0, TCSTATUS_IXMT | 479 | andi v1, v0, TCSTATUS_IXMT |
480 | ori v0, TCSTATUS_IXMT | 480 | ori v0, TCSTATUS_IXMT |
481 | mtc0 v0, CP0_TCSTATUS | 481 | mtc0 v0, CP0_TCSTATUS |
482 | ehb | 482 | _ehb |
483 | DMT 2 # dmt v0 | 483 | DMT 2 # dmt v0 |
484 | /* | 484 | /* |
485 | * We don't know a priori if ra is "live" | 485 | * We don't know a priori if ra is "live" |
@@ -495,7 +495,7 @@ | |||
495 | xori t0, 0x1e | 495 | xori t0, 0x1e |
496 | mtc0 t0, CP0_STATUS | 496 | mtc0 t0, CP0_STATUS |
497 | #ifdef CONFIG_MIPS_MT_SMTC | 497 | #ifdef CONFIG_MIPS_MT_SMTC |
498 | ehb | 498 | _ehb |
499 | andi v0, v0, VPECONTROL_TE | 499 | andi v0, v0, VPECONTROL_TE |
500 | beqz v0, 2f | 500 | beqz v0, 2f |
501 | nop /* delay slot */ | 501 | nop /* delay slot */ |
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 8bb0bb9b2e68..809f9f55bacb 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h | |||
@@ -326,16 +326,17 @@ | |||
326 | #define __NR_unshare (__NR_Linux + 303) | 326 | #define __NR_unshare (__NR_Linux + 303) |
327 | #define __NR_splice (__NR_Linux + 304) | 327 | #define __NR_splice (__NR_Linux + 304) |
328 | #define __NR_sync_file_range (__NR_Linux + 305) | 328 | #define __NR_sync_file_range (__NR_Linux + 305) |
329 | #define __NR_tee (__NR_Linux + 306) | ||
329 | 330 | ||
330 | /* | 331 | /* |
331 | * Offset of the last Linux o32 flavoured syscall | 332 | * Offset of the last Linux o32 flavoured syscall |
332 | */ | 333 | */ |
333 | #define __NR_Linux_syscalls 305 | 334 | #define __NR_Linux_syscalls 306 |
334 | 335 | ||
335 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 336 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
336 | 337 | ||
337 | #define __NR_O32_Linux 4000 | 338 | #define __NR_O32_Linux 4000 |
338 | #define __NR_O32_Linux_syscalls 305 | 339 | #define __NR_O32_Linux_syscalls 306 |
339 | 340 | ||
340 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 341 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
341 | 342 | ||
@@ -608,16 +609,17 @@ | |||
608 | #define __NR_unshare (__NR_Linux + 262) | 609 | #define __NR_unshare (__NR_Linux + 262) |
609 | #define __NR_splice (__NR_Linux + 263) | 610 | #define __NR_splice (__NR_Linux + 263) |
610 | #define __NR_sync_file_range (__NR_Linux + 264) | 611 | #define __NR_sync_file_range (__NR_Linux + 264) |
612 | #define __NR_tee (__NR_Linux + 265) | ||
611 | 613 | ||
612 | /* | 614 | /* |
613 | * Offset of the last Linux 64-bit flavoured syscall | 615 | * Offset of the last Linux 64-bit flavoured syscall |
614 | */ | 616 | */ |
615 | #define __NR_Linux_syscalls 264 | 617 | #define __NR_Linux_syscalls 265 |
616 | 618 | ||
617 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 619 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
618 | 620 | ||
619 | #define __NR_64_Linux 5000 | 621 | #define __NR_64_Linux 5000 |
620 | #define __NR_64_Linux_syscalls 264 | 622 | #define __NR_64_Linux_syscalls 265 |
621 | 623 | ||
622 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 624 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
623 | 625 | ||
@@ -894,16 +896,17 @@ | |||
894 | #define __NR_unshare (__NR_Linux + 266) | 896 | #define __NR_unshare (__NR_Linux + 266) |
895 | #define __NR_splice (__NR_Linux + 267) | 897 | #define __NR_splice (__NR_Linux + 267) |
896 | #define __NR_sync_file_range (__NR_Linux + 268) | 898 | #define __NR_sync_file_range (__NR_Linux + 268) |
899 | #define __NR_tee (__NR_Linux + 269) | ||
897 | 900 | ||
898 | /* | 901 | /* |
899 | * Offset of the last N32 flavoured syscall | 902 | * Offset of the last N32 flavoured syscall |
900 | */ | 903 | */ |
901 | #define __NR_Linux_syscalls 268 | 904 | #define __NR_Linux_syscalls 269 |
902 | 905 | ||
903 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 906 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
904 | 907 | ||
905 | #define __NR_N32_Linux 6000 | 908 | #define __NR_N32_Linux 6000 |
906 | #define __NR_N32_Linux_syscalls 268 | 909 | #define __NR_N32_Linux_syscalls 269 |
907 | 910 | ||
908 | #ifdef __KERNEL__ | 911 | #ifdef __KERNEL__ |
909 | 912 | ||
diff --git a/include/asm-parisc/Kbuild b/include/asm-parisc/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-parisc/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index 3ce3440d1b0c..1a7bfe699e0c 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) | 48 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) |
49 | 49 | ||
50 | #ifdef CONFIG_PA20 | 50 | #ifdef CONFIG_PA20 |
51 | #define LDCW ldcw,co | ||
51 | #define BL b,l | 52 | #define BL b,l |
52 | # ifdef CONFIG_64BIT | 53 | # ifdef CONFIG_64BIT |
53 | # define LEVEL 2.0w | 54 | # define LEVEL 2.0w |
@@ -55,6 +56,7 @@ | |||
55 | # define LEVEL 2.0 | 56 | # define LEVEL 2.0 |
56 | # endif | 57 | # endif |
57 | #else | 58 | #else |
59 | #define LDCW ldcw | ||
58 | #define BL bl | 60 | #define BL bl |
59 | #define LEVEL 1.1 | 61 | #define LEVEL 1.1 |
60 | #endif | 62 | #endif |
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h index 289624d8b2d4..71b4eeea205a 100644 --- a/include/asm-parisc/compat.h +++ b/include/asm-parisc/compat.h | |||
@@ -5,6 +5,7 @@ | |||
5 | */ | 5 | */ |
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/personality.h> | ||
8 | 9 | ||
9 | #define COMPAT_USER_HZ 100 | 10 | #define COMPAT_USER_HZ 100 |
10 | 11 | ||
@@ -149,4 +150,14 @@ static __inline__ void __user *compat_alloc_user_space(long len) | |||
149 | return (void __user *)regs->gr[30]; | 150 | return (void __user *)regs->gr[30]; |
150 | } | 151 | } |
151 | 152 | ||
153 | static inline int __is_compat_task(struct task_struct *t) | ||
154 | { | ||
155 | return personality(t->personality) == PER_LINUX32; | ||
156 | } | ||
157 | |||
158 | static inline int is_compat_task(void) | ||
159 | { | ||
160 | return __is_compat_task(current); | ||
161 | } | ||
162 | |||
152 | #endif /* _ASM_PARISC_COMPAT_H */ | 163 | #endif /* _ASM_PARISC_COMPAT_H */ |
diff --git a/include/asm-parisc/floppy.h b/include/asm-parisc/floppy.h index 458cdb2a7530..da2f9c157143 100644 --- a/include/asm-parisc/floppy.h +++ b/include/asm-parisc/floppy.h | |||
@@ -156,11 +156,11 @@ static int vdma_get_dma_residue(unsigned int dummy) | |||
156 | static int fd_request_irq(void) | 156 | static int fd_request_irq(void) |
157 | { | 157 | { |
158 | if(can_use_virtual_dma) | 158 | if(can_use_virtual_dma) |
159 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 159 | return request_irq(FLOPPY_IRQ, floppy_hardint, |
160 | "floppy", NULL); | 160 | IRQF_DISABLED, "floppy", NULL); |
161 | else | 161 | else |
162 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, | 162 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
163 | "floppy", NULL); | 163 | IRQF_DISABLED, "floppy", NULL); |
164 | } | 164 | } |
165 | 165 | ||
166 | static unsigned long dma_mem_alloc(unsigned long size) | 166 | static unsigned long dma_mem_alloc(unsigned long size) |
diff --git a/include/asm-parisc/hw_irq.h b/include/asm-parisc/hw_irq.h index 151426e27521..6707f7df3921 100644 --- a/include/asm-parisc/hw_irq.h +++ b/include/asm-parisc/hw_irq.h | |||
@@ -3,15 +3,6 @@ | |||
3 | 3 | ||
4 | /* | 4 | /* |
5 | * linux/include/asm/hw_irq.h | 5 | * linux/include/asm/hw_irq.h |
6 | * | ||
7 | * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar | ||
8 | * | ||
9 | * moved some of the old arch/i386/kernel/irq.h to here. VY | ||
10 | * | ||
11 | * IRQ/IPI changes taken from work by Thomas Radke | ||
12 | * <tomsoft@informatik.tu-chemnitz.de> | ||
13 | */ | 6 | */ |
14 | 7 | ||
15 | extern void hw_resend_irq(struct hw_interrupt_type *, unsigned int); | ||
16 | |||
17 | #endif | 8 | #endif |
diff --git a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h index 377ba90c7d02..5cae260615a2 100644 --- a/include/asm-parisc/irq.h +++ b/include/asm-parisc/irq.h | |||
@@ -26,11 +26,6 @@ | |||
26 | 26 | ||
27 | #define NR_IRQS (CPU_IRQ_MAX + 1) | 27 | #define NR_IRQS (CPU_IRQ_MAX + 1) |
28 | 28 | ||
29 | /* | ||
30 | * IRQ line status macro IRQ_PER_CPU is used | ||
31 | */ | ||
32 | #define ARCH_HAS_IRQ_PER_CPU | ||
33 | |||
34 | static __inline__ int irq_canonicalize(int irq) | 29 | static __inline__ int irq_canonicalize(int irq) |
35 | { | 30 | { |
36 | return (irq == 2) ? 9 : irq; | 31 | return (irq == 2) ? 9 : irq; |
diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h index 08364f957e7a..c9b2e35326ee 100644 --- a/include/asm-parisc/pdc.h +++ b/include/asm-parisc/pdc.h | |||
@@ -278,12 +278,11 @@ typedef struct { | |||
278 | /* constants for OS (NVM...) */ | 278 | /* constants for OS (NVM...) */ |
279 | #define OS_ID_NONE 0 /* Undefined OS ID */ | 279 | #define OS_ID_NONE 0 /* Undefined OS ID */ |
280 | #define OS_ID_HPUX 1 /* HP-UX OS */ | 280 | #define OS_ID_HPUX 1 /* HP-UX OS */ |
281 | #define OS_ID_LINUX OS_ID_HPUX /* just use the same value as hpux */ | ||
282 | #define OS_ID_MPEXL 2 /* MPE XL OS */ | 281 | #define OS_ID_MPEXL 2 /* MPE XL OS */ |
283 | #define OS_ID_OSF 3 /* OSF OS */ | 282 | #define OS_ID_OSF 3 /* OSF OS */ |
284 | #define OS_ID_HPRT 4 /* HP-RT OS */ | 283 | #define OS_ID_HPRT 4 /* HP-RT OS */ |
285 | #define OS_ID_NOVEL 5 /* NOVELL OS */ | 284 | #define OS_ID_NOVEL 5 /* NOVELL OS */ |
286 | #define OS_ID_NT 6 /* NT OS */ | 285 | #define OS_ID_LINUX 6 /* Linux */ |
287 | 286 | ||
288 | 287 | ||
289 | /* constants for PDC_CHASSIS */ | 288 | /* constants for PDC_CHASSIS */ |
@@ -352,8 +351,8 @@ struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */ | |||
352 | cc_wt : 1, /* 0 = WT-Dcache, 1 = WB-Dcache */ | 351 | cc_wt : 1, /* 0 = WT-Dcache, 1 = WB-Dcache */ |
353 | cc_sh : 2, /* 0 = separate I/D-cache, else shared I/D-cache */ | 352 | cc_sh : 2, /* 0 = separate I/D-cache, else shared I/D-cache */ |
354 | cc_cst : 3, /* 0 = incoherent D-cache, 1=coherent D-cache */ | 353 | cc_cst : 3, /* 0 = incoherent D-cache, 1=coherent D-cache */ |
355 | cc_pad1 : 5, /* reserved */ | 354 | cc_pad1 : 10, /* reserved */ |
356 | cc_assoc: 8; /* associativity of I/D-cache */ | 355 | cc_hv : 3; /* hversion dependent */ |
357 | }; | 356 | }; |
358 | 357 | ||
359 | struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */ | 358 | struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */ |
@@ -719,6 +718,7 @@ void setup_pdc(void); /* in inventory.c */ | |||
719 | int pdc_add_valid(unsigned long address); | 718 | int pdc_add_valid(unsigned long address); |
720 | int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len); | 719 | int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len); |
721 | int pdc_chassis_disp(unsigned long disp); | 720 | int pdc_chassis_disp(unsigned long disp); |
721 | int pdc_chassis_warn(unsigned long *warn); | ||
722 | int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info); | 722 | int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info); |
723 | int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index, | 723 | int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index, |
724 | void *iodc_data, unsigned int iodc_data_size); | 724 | void *iodc_data, unsigned int iodc_data_size); |
@@ -732,6 +732,7 @@ int pdc_model_cpuid(unsigned long *cpu_id); | |||
732 | int pdc_model_versions(unsigned long *versions, int id); | 732 | int pdc_model_versions(unsigned long *versions, int id); |
733 | int pdc_model_capabilities(unsigned long *capabilities); | 733 | int pdc_model_capabilities(unsigned long *capabilities); |
734 | int pdc_cache_info(struct pdc_cache_info *cache); | 734 | int pdc_cache_info(struct pdc_cache_info *cache); |
735 | int pdc_spaceid_bits(unsigned long *space_bits); | ||
735 | #ifndef CONFIG_PA20 | 736 | #ifndef CONFIG_PA20 |
736 | int pdc_btlb_info(struct pdc_btlb_info *btlb); | 737 | int pdc_btlb_info(struct pdc_btlb_info *btlb); |
737 | int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path); | 738 | int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path); |
@@ -775,6 +776,18 @@ int pdc_sti_call(unsigned long func, unsigned long flags, | |||
775 | 776 | ||
776 | extern void pdc_init(void); | 777 | extern void pdc_init(void); |
777 | 778 | ||
779 | static inline char * os_id_to_string(u16 os_id) { | ||
780 | switch(os_id) { | ||
781 | case OS_ID_NONE: return "No OS"; | ||
782 | case OS_ID_HPUX: return "HP-UX"; | ||
783 | case OS_ID_MPEXL: return "MPE-iX"; | ||
784 | case OS_ID_OSF: return "OSF"; | ||
785 | case OS_ID_HPRT: return "HP-RT"; | ||
786 | case OS_ID_NOVEL: return "Novell Netware"; | ||
787 | case OS_ID_LINUX: return "Linux"; | ||
788 | default: return "Unknown"; | ||
789 | } | ||
790 | } | ||
778 | #endif /* __ASSEMBLY__ */ | 791 | #endif /* __ASSEMBLY__ */ |
779 | 792 | ||
780 | #endif /* _PARISC_PDC_H */ | 793 | #endif /* _PARISC_PDC_H */ |
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index b6bcc672ba80..5066c54dae0a 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h | |||
@@ -506,13 +506,13 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
506 | 506 | ||
507 | /* TLB page size encoding - see table 3-1 in parisc20.pdf */ | 507 | /* TLB page size encoding - see table 3-1 in parisc20.pdf */ |
508 | #define _PAGE_SIZE_ENCODING_4K 0 | 508 | #define _PAGE_SIZE_ENCODING_4K 0 |
509 | #define _PAGE_SIZE_ENCODING_16K 1 | 509 | #define _PAGE_SIZE_ENCODING_16K 1 |
510 | #define _PAGE_SIZE_ENCODING_64K 2 | 510 | #define _PAGE_SIZE_ENCODING_64K 2 |
511 | #define _PAGE_SIZE_ENCODING_256K 3 | 511 | #define _PAGE_SIZE_ENCODING_256K 3 |
512 | #define _PAGE_SIZE_ENCODING_1M 4 | 512 | #define _PAGE_SIZE_ENCODING_1M 4 |
513 | #define _PAGE_SIZE_ENCODING_4M 5 | 513 | #define _PAGE_SIZE_ENCODING_4M 5 |
514 | #define _PAGE_SIZE_ENCODING_16M 6 | 514 | #define _PAGE_SIZE_ENCODING_16M 6 |
515 | #define _PAGE_SIZE_ENCODING_64M 7 | 515 | #define _PAGE_SIZE_ENCODING_64M 7 |
516 | 516 | ||
517 | #if defined(CONFIG_PARISC_PAGE_SIZE_4KB) | 517 | #if defined(CONFIG_PARISC_PAGE_SIZE_4KB) |
518 | # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K | 518 | # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K |
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index ca49dc91f4fc..b73626f040da 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h | |||
@@ -26,14 +26,12 @@ | |||
26 | * Default implementation of macro that returns current | 26 | * Default implementation of macro that returns current |
27 | * instruction pointer ("program counter"). | 27 | * instruction pointer ("program counter"). |
28 | */ | 28 | */ |
29 | 29 | #ifdef CONFIG_PA20 | |
30 | /* We cannot use MFIA as it was added for PA2.0 - prumpf | 30 | #define current_ia(x) __asm__("mfia %0" : "=r"(x)) |
31 | 31 | #else /* mfia added in pa2.0 */ | |
32 | At one point there were no "0f/0b" type local symbols in gas for | 32 | #define current_ia(x) __asm__("blr 0,%0\n\tnop" : "=r"(x)) |
33 | PA-RISC. This is no longer true, but this still seems like the | 33 | #endif |
34 | nicest way to implement this. */ | 34 | #define current_text_addr() ({ void *pc; current_ia(pc); pc; }) |
35 | |||
36 | #define current_text_addr() ({ void *pc; __asm__("\n\tblr 0,%0\n\tnop":"=r" (pc)); pc; }) | ||
37 | 35 | ||
38 | #define TASK_SIZE (current->thread.task_size) | 36 | #define TASK_SIZE (current->thread.task_size) |
39 | #define TASK_UNMAPPED_BASE (current->thread.map_base) | 37 | #define TASK_UNMAPPED_BASE (current->thread.map_base) |
diff --git a/include/asm-parisc/signal.h b/include/asm-parisc/signal.h index 25cb23ef7dd1..98a82fa0cfdb 100644 --- a/include/asm-parisc/signal.h +++ b/include/asm-parisc/signal.h | |||
@@ -48,7 +48,6 @@ | |||
48 | * SA_FLAGS values: | 48 | * SA_FLAGS values: |
49 | * | 49 | * |
50 | * SA_ONSTACK indicates that a registered stack_t will be used. | 50 | * SA_ONSTACK indicates that a registered stack_t will be used. |
51 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
52 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 51 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
53 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 52 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
54 | * SA_RESETHAND clears the handler when the signal is delivered. | 53 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -69,7 +68,6 @@ | |||
69 | 68 | ||
70 | #define SA_NOMASK SA_NODEFER | 69 | #define SA_NOMASK SA_NODEFER |
71 | #define SA_ONESHOT SA_RESETHAND | 70 | #define SA_ONESHOT SA_RESETHAND |
72 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
73 | 71 | ||
74 | #define SA_RESTORER 0x04000000 /* obsolete -- ignored */ | 72 | #define SA_RESTORER 0x04000000 /* obsolete -- ignored */ |
75 | 73 | ||
diff --git a/include/asm-parisc/socket.h b/include/asm-parisc/socket.h index 1bf54dc53c10..ce2eae1708b5 100644 --- a/include/asm-parisc/socket.h +++ b/include/asm-parisc/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 0x401c | 48 | #define SO_ACCEPTCONN 0x401c |
49 | 49 | ||
50 | #define SO_PEERSEC 0x401d | 50 | #define SO_PEERSEC 0x401d |
51 | #define SO_PASSSEC 0x401e | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index 863876134b2c..5fe2d2329ab5 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h | |||
@@ -155,13 +155,14 @@ static inline void set_eiem(unsigned long val) | |||
155 | type and dynamically select the 16-byte aligned int from the array | 155 | type and dynamically select the 16-byte aligned int from the array |
156 | for the semaphore. */ | 156 | for the semaphore. */ |
157 | 157 | ||
158 | #define __PA_LDCW_ALIGNMENT 16 | 158 | #define __PA_LDCW_ALIGNMENT 16 |
159 | #define __ldcw_align(a) ({ \ | 159 | #define __ldcw_align(a) ({ \ |
160 | unsigned long __ret = (unsigned long) &(a)->lock[0]; \ | 160 | unsigned long __ret = (unsigned long) &(a)->lock[0]; \ |
161 | __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \ | 161 | __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) \ |
162 | (volatile unsigned int *) __ret; \ | 162 | & ~(__PA_LDCW_ALIGNMENT - 1); \ |
163 | (volatile unsigned int *) __ret; \ | ||
163 | }) | 164 | }) |
164 | #define LDCW "ldcw" | 165 | #define __LDCW "ldcw" |
165 | 166 | ||
166 | #else /*CONFIG_PA20*/ | 167 | #else /*CONFIG_PA20*/ |
167 | /* From: "Jim Hull" <jim.hull of hp.com> | 168 | /* From: "Jim Hull" <jim.hull of hp.com> |
@@ -171,17 +172,18 @@ static inline void set_eiem(unsigned long val) | |||
171 | they only require "natural" alignment (4-byte for ldcw, 8-byte for | 172 | they only require "natural" alignment (4-byte for ldcw, 8-byte for |
172 | ldcd). */ | 173 | ldcd). */ |
173 | 174 | ||
174 | #define __PA_LDCW_ALIGNMENT 4 | 175 | #define __PA_LDCW_ALIGNMENT 4 |
175 | #define __ldcw_align(a) ((volatile unsigned int *)a) | 176 | #define __ldcw_align(a) ((volatile unsigned int *)a) |
176 | #define LDCW "ldcw,co" | 177 | #define __LDCW "ldcw,co" |
177 | 178 | ||
178 | #endif /*!CONFIG_PA20*/ | 179 | #endif /*!CONFIG_PA20*/ |
179 | 180 | ||
180 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ | 181 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ |
181 | #define __ldcw(a) ({ \ | 182 | #define __ldcw(a) ({ \ |
182 | unsigned __ret; \ | 183 | unsigned __ret; \ |
183 | __asm__ __volatile__(LDCW " 0(%1),%0" : "=r" (__ret) : "r" (a)); \ | 184 | __asm__ __volatile__(__LDCW " 0(%1),%0" \ |
184 | __ret; \ | 185 | : "=r" (__ret) : "r" (a)); \ |
186 | __ret; \ | ||
185 | }) | 187 | }) |
186 | 188 | ||
187 | #ifdef CONFIG_SMP | 189 | #ifdef CONFIG_SMP |
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h index f6c417c8c484..d973e8b3466c 100644 --- a/include/asm-parisc/uaccess.h +++ b/include/asm-parisc/uaccess.h | |||
@@ -172,7 +172,11 @@ struct exception_data { | |||
172 | /* | 172 | /* |
173 | * The "__put_user/kernel_asm()" macros tell gcc they read from memory | 173 | * The "__put_user/kernel_asm()" macros tell gcc they read from memory |
174 | * instead of writing. This is because they do not write to any memory | 174 | * instead of writing. This is because they do not write to any memory |
175 | * gcc knows about, so there are no aliasing issues. | 175 | * gcc knows about, so there are no aliasing issues. These macros must |
176 | * also be aware that "fixup_put_user_skip_[12]" are executed in the | ||
177 | * context of the fault, and any registers used there must be listed | ||
178 | * as clobbers. In this case only "r1" is used by the current routines. | ||
179 | * r8/r9 are already listed as err/val. | ||
176 | */ | 180 | */ |
177 | 181 | ||
178 | #ifdef __LP64__ | 182 | #ifdef __LP64__ |
@@ -183,7 +187,8 @@ struct exception_data { | |||
183 | "\t.dword\t1b,fixup_put_user_skip_1\n" \ | 187 | "\t.dword\t1b,fixup_put_user_skip_1\n" \ |
184 | "\t.previous" \ | 188 | "\t.previous" \ |
185 | : "=r"(__pu_err) \ | 189 | : "=r"(__pu_err) \ |
186 | : "r"(ptr), "r"(x), "0"(__pu_err)) | 190 | : "r"(ptr), "r"(x), "0"(__pu_err) \ |
191 | : "r1") | ||
187 | 192 | ||
188 | #define __put_user_asm(stx,x,ptr) \ | 193 | #define __put_user_asm(stx,x,ptr) \ |
189 | __asm__ __volatile__ ( \ | 194 | __asm__ __volatile__ ( \ |
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 12b867238a47..27bcfad1c3e3 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h | |||
@@ -797,11 +797,6 @@ | |||
797 | 797 | ||
798 | #define SYS_ify(syscall_name) __NR_##syscall_name | 798 | #define SYS_ify(syscall_name) __NR_##syscall_name |
799 | 799 | ||
800 | /* Assume all syscalls are done from PIC code just to be | ||
801 | * safe. The worst case scenario is that you lose a register | ||
802 | * and save/restore r19 across the syscall. */ | ||
803 | #define PIC | ||
804 | |||
805 | #ifndef ASM_LINE_SEP | 800 | #ifndef ASM_LINE_SEP |
806 | # define ASM_LINE_SEP ; | 801 | # define ASM_LINE_SEP ; |
807 | #endif | 802 | #endif |
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild new file mode 100644 index 000000000000..ac61d7eb6021 --- /dev/null +++ b/include/asm-powerpc/Kbuild | |||
@@ -0,0 +1,10 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | unifdef-y += a.out.h asm-compat.h bootx.h byteorder.h cputable.h elf.h \ | ||
4 | nvram.h param.h posix_types.h ptrace.h seccomp.h signal.h \ | ||
5 | termios.h types.h unistd.h | ||
6 | |||
7 | header-y += auxvec.h ioctls.h mman.h sembuf.h siginfo.h stat.h errno.h \ | ||
8 | ipcbuf.h msgbuf.h shmbuf.h socket.h termbits.h fcntl.h ipc.h \ | ||
9 | poll.h shmparam.h sockios.h ucontext.h ioctl.h linkage.h \ | ||
10 | resource.h sigcontext.h statfs.h | ||
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h index bb3c0ab7e667..53283e2540b3 100644 --- a/include/asm-powerpc/atomic.h +++ b/include/asm-powerpc/atomic.h | |||
@@ -27,8 +27,8 @@ static __inline__ void atomic_add(int a, atomic_t *v) | |||
27 | PPC405_ERR77(0,%3) | 27 | PPC405_ERR77(0,%3) |
28 | " stwcx. %0,0,%3 \n\ | 28 | " stwcx. %0,0,%3 \n\ |
29 | bne- 1b" | 29 | bne- 1b" |
30 | : "=&r" (t), "=m" (v->counter) | 30 | : "=&r" (t), "+m" (v->counter) |
31 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 31 | : "r" (a), "r" (&v->counter) |
32 | : "cc"); | 32 | : "cc"); |
33 | } | 33 | } |
34 | 34 | ||
@@ -63,8 +63,8 @@ static __inline__ void atomic_sub(int a, atomic_t *v) | |||
63 | PPC405_ERR77(0,%3) | 63 | PPC405_ERR77(0,%3) |
64 | " stwcx. %0,0,%3 \n\ | 64 | " stwcx. %0,0,%3 \n\ |
65 | bne- 1b" | 65 | bne- 1b" |
66 | : "=&r" (t), "=m" (v->counter) | 66 | : "=&r" (t), "+m" (v->counter) |
67 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 67 | : "r" (a), "r" (&v->counter) |
68 | : "cc"); | 68 | : "cc"); |
69 | } | 69 | } |
70 | 70 | ||
@@ -97,8 +97,8 @@ static __inline__ void atomic_inc(atomic_t *v) | |||
97 | PPC405_ERR77(0,%2) | 97 | PPC405_ERR77(0,%2) |
98 | " stwcx. %0,0,%2 \n\ | 98 | " stwcx. %0,0,%2 \n\ |
99 | bne- 1b" | 99 | bne- 1b" |
100 | : "=&r" (t), "=m" (v->counter) | 100 | : "=&r" (t), "+m" (v->counter) |
101 | : "r" (&v->counter), "m" (v->counter) | 101 | : "r" (&v->counter) |
102 | : "cc"); | 102 | : "cc"); |
103 | } | 103 | } |
104 | 104 | ||
@@ -141,8 +141,8 @@ static __inline__ void atomic_dec(atomic_t *v) | |||
141 | PPC405_ERR77(0,%2)\ | 141 | PPC405_ERR77(0,%2)\ |
142 | " stwcx. %0,0,%2\n\ | 142 | " stwcx. %0,0,%2\n\ |
143 | bne- 1b" | 143 | bne- 1b" |
144 | : "=&r" (t), "=m" (v->counter) | 144 | : "=&r" (t), "+m" (v->counter) |
145 | : "r" (&v->counter), "m" (v->counter) | 145 | : "r" (&v->counter) |
146 | : "cc"); | 146 | : "cc"); |
147 | } | 147 | } |
148 | 148 | ||
@@ -253,8 +253,8 @@ static __inline__ void atomic64_add(long a, atomic64_t *v) | |||
253 | add %0,%2,%0\n\ | 253 | add %0,%2,%0\n\ |
254 | stdcx. %0,0,%3 \n\ | 254 | stdcx. %0,0,%3 \n\ |
255 | bne- 1b" | 255 | bne- 1b" |
256 | : "=&r" (t), "=m" (v->counter) | 256 | : "=&r" (t), "+m" (v->counter) |
257 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 257 | : "r" (a), "r" (&v->counter) |
258 | : "cc"); | 258 | : "cc"); |
259 | } | 259 | } |
260 | 260 | ||
@@ -287,8 +287,8 @@ static __inline__ void atomic64_sub(long a, atomic64_t *v) | |||
287 | subf %0,%2,%0\n\ | 287 | subf %0,%2,%0\n\ |
288 | stdcx. %0,0,%3 \n\ | 288 | stdcx. %0,0,%3 \n\ |
289 | bne- 1b" | 289 | bne- 1b" |
290 | : "=&r" (t), "=m" (v->counter) | 290 | : "=&r" (t), "+m" (v->counter) |
291 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 291 | : "r" (a), "r" (&v->counter) |
292 | : "cc"); | 292 | : "cc"); |
293 | } | 293 | } |
294 | 294 | ||
@@ -319,8 +319,8 @@ static __inline__ void atomic64_inc(atomic64_t *v) | |||
319 | addic %0,%0,1\n\ | 319 | addic %0,%0,1\n\ |
320 | stdcx. %0,0,%2 \n\ | 320 | stdcx. %0,0,%2 \n\ |
321 | bne- 1b" | 321 | bne- 1b" |
322 | : "=&r" (t), "=m" (v->counter) | 322 | : "=&r" (t), "+m" (v->counter) |
323 | : "r" (&v->counter), "m" (v->counter) | 323 | : "r" (&v->counter) |
324 | : "cc"); | 324 | : "cc"); |
325 | } | 325 | } |
326 | 326 | ||
@@ -361,8 +361,8 @@ static __inline__ void atomic64_dec(atomic64_t *v) | |||
361 | addic %0,%0,-1\n\ | 361 | addic %0,%0,-1\n\ |
362 | stdcx. %0,0,%2\n\ | 362 | stdcx. %0,0,%2\n\ |
363 | bne- 1b" | 363 | bne- 1b" |
364 | : "=&r" (t), "=m" (v->counter) | 364 | : "=&r" (t), "+m" (v->counter) |
365 | : "r" (&v->counter), "m" (v->counter) | 365 | : "r" (&v->counter) |
366 | : "cc"); | 366 | : "cc"); |
367 | } | 367 | } |
368 | 368 | ||
diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h index a5e9e656e332..58d4b6f8d827 100644 --- a/include/asm-powerpc/backlight.h +++ b/include/asm-powerpc/backlight.h | |||
@@ -16,13 +16,19 @@ | |||
16 | extern struct backlight_device *pmac_backlight; | 16 | extern struct backlight_device *pmac_backlight; |
17 | extern struct mutex pmac_backlight_mutex; | 17 | extern struct mutex pmac_backlight_mutex; |
18 | 18 | ||
19 | extern void pmac_backlight_calc_curve(struct fb_info*); | ||
20 | extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); | 19 | extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); |
21 | 20 | ||
22 | extern int pmac_has_backlight_type(const char *type); | 21 | extern int pmac_has_backlight_type(const char *type); |
23 | 22 | ||
24 | extern void pmac_backlight_key_up(void); | 23 | extern void pmac_backlight_key(int direction); |
25 | extern void pmac_backlight_key_down(void); | 24 | static inline void pmac_backlight_key_up(void) |
25 | { | ||
26 | pmac_backlight_key(0); | ||
27 | } | ||
28 | static inline void pmac_backlight_key_down(void) | ||
29 | { | ||
30 | pmac_backlight_key(1); | ||
31 | } | ||
26 | 32 | ||
27 | extern int pmac_backlight_set_legacy_brightness(int brightness); | 33 | extern int pmac_backlight_set_legacy_brightness(int brightness); |
28 | extern int pmac_backlight_get_legacy_brightness(void); | 34 | extern int pmac_backlight_get_legacy_brightness(void); |
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index 76e2f08c3c83..c341063d0804 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h | |||
@@ -65,8 +65,8 @@ static __inline__ void set_bit(int nr, volatile unsigned long *addr) | |||
65 | PPC405_ERR77(0,%3) | 65 | PPC405_ERR77(0,%3) |
66 | PPC_STLCX "%0,0,%3\n" | 66 | PPC_STLCX "%0,0,%3\n" |
67 | "bne- 1b" | 67 | "bne- 1b" |
68 | : "=&r"(old), "=m"(*p) | 68 | : "=&r" (old), "+m" (*p) |
69 | : "r"(mask), "r"(p), "m"(*p) | 69 | : "r" (mask), "r" (p) |
70 | : "cc" ); | 70 | : "cc" ); |
71 | } | 71 | } |
72 | 72 | ||
@@ -82,8 +82,8 @@ static __inline__ void clear_bit(int nr, volatile unsigned long *addr) | |||
82 | PPC405_ERR77(0,%3) | 82 | PPC405_ERR77(0,%3) |
83 | PPC_STLCX "%0,0,%3\n" | 83 | PPC_STLCX "%0,0,%3\n" |
84 | "bne- 1b" | 84 | "bne- 1b" |
85 | : "=&r"(old), "=m"(*p) | 85 | : "=&r" (old), "+m" (*p) |
86 | : "r"(mask), "r"(p), "m"(*p) | 86 | : "r" (mask), "r" (p) |
87 | : "cc" ); | 87 | : "cc" ); |
88 | } | 88 | } |
89 | 89 | ||
@@ -99,8 +99,8 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr) | |||
99 | PPC405_ERR77(0,%3) | 99 | PPC405_ERR77(0,%3) |
100 | PPC_STLCX "%0,0,%3\n" | 100 | PPC_STLCX "%0,0,%3\n" |
101 | "bne- 1b" | 101 | "bne- 1b" |
102 | : "=&r"(old), "=m"(*p) | 102 | : "=&r" (old), "+m" (*p) |
103 | : "r"(mask), "r"(p), "m"(*p) | 103 | : "r" (mask), "r" (p) |
104 | : "cc" ); | 104 | : "cc" ); |
105 | } | 105 | } |
106 | 106 | ||
@@ -179,8 +179,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr) | |||
179 | "or %0,%0,%2\n" | 179 | "or %0,%0,%2\n" |
180 | PPC_STLCX "%0,0,%3\n" | 180 | PPC_STLCX "%0,0,%3\n" |
181 | "bne- 1b" | 181 | "bne- 1b" |
182 | : "=&r" (old), "=m" (*addr) | 182 | : "=&r" (old), "+m" (*addr) |
183 | : "r" (mask), "r" (addr), "m" (*addr) | 183 | : "r" (mask), "r" (addr) |
184 | : "cc"); | 184 | : "cc"); |
185 | } | 185 | } |
186 | 186 | ||
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index fab41c280aa1..1ba3c9983614 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
@@ -117,38 +117,30 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
117 | #define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) | 117 | #define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) |
118 | #define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) | 118 | #define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) |
119 | 119 | ||
120 | /* | ||
121 | * Add the 64-bit processor unique features in the top half of the word; | ||
122 | * on 32-bit, make the names available but defined to be 0. | ||
123 | */ | ||
120 | #ifdef __powerpc64__ | 124 | #ifdef __powerpc64__ |
121 | /* Add the 64b processor unique features in the top half of the word */ | 125 | #define LONG_ASM_CONST(x) ASM_CONST(x) |
122 | #define CPU_FTR_SLB ASM_CONST(0x0000000100000000) | ||
123 | #define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) | ||
124 | #define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) | ||
125 | #define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) | ||
126 | #define CPU_FTR_IABR ASM_CONST(0x0000002000000000) | ||
127 | #define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) | ||
128 | #define CPU_FTR_CTRL ASM_CONST(0x0000008000000000) | ||
129 | #define CPU_FTR_SMT ASM_CONST(0x0000010000000000) | ||
130 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) | ||
131 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) | ||
132 | #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000) | ||
133 | #define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000) | ||
134 | #define CPU_FTR_PURR ASM_CONST(0x0000400000000000) | ||
135 | #else | 126 | #else |
136 | /* ensure on 32b processors the flags are available for compiling but | 127 | #define LONG_ASM_CONST(x) 0 |
137 | * don't do anything */ | ||
138 | #define CPU_FTR_SLB ASM_CONST(0x0) | ||
139 | #define CPU_FTR_16M_PAGE ASM_CONST(0x0) | ||
140 | #define CPU_FTR_TLBIEL ASM_CONST(0x0) | ||
141 | #define CPU_FTR_NOEXECUTE ASM_CONST(0x0) | ||
142 | #define CPU_FTR_IABR ASM_CONST(0x0) | ||
143 | #define CPU_FTR_MMCRA ASM_CONST(0x0) | ||
144 | #define CPU_FTR_CTRL ASM_CONST(0x0) | ||
145 | #define CPU_FTR_SMT ASM_CONST(0x0) | ||
146 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) | ||
147 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0) | ||
148 | #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0) | ||
149 | #define CPU_FTR_PURR ASM_CONST(0x0) | ||
150 | #endif | 128 | #endif |
151 | 129 | ||
130 | #define CPU_FTR_SLB LONG_ASM_CONST(0x0000000100000000) | ||
131 | #define CPU_FTR_16M_PAGE LONG_ASM_CONST(0x0000000200000000) | ||
132 | #define CPU_FTR_TLBIEL LONG_ASM_CONST(0x0000000400000000) | ||
133 | #define CPU_FTR_NOEXECUTE LONG_ASM_CONST(0x0000000800000000) | ||
134 | #define CPU_FTR_IABR LONG_ASM_CONST(0x0000002000000000) | ||
135 | #define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000) | ||
136 | #define CPU_FTR_CTRL LONG_ASM_CONST(0x0000008000000000) | ||
137 | #define CPU_FTR_SMT LONG_ASM_CONST(0x0000010000000000) | ||
138 | #define CPU_FTR_COHERENT_ICACHE LONG_ASM_CONST(0x0000020000000000) | ||
139 | #define CPU_FTR_LOCKLESS_TLBIE LONG_ASM_CONST(0x0000040000000000) | ||
140 | #define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) | ||
141 | #define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) | ||
142 | #define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) | ||
143 | |||
152 | #ifndef __ASSEMBLY__ | 144 | #ifndef __ASSEMBLY__ |
153 | 145 | ||
154 | #define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \ | 146 | #define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \ |
diff --git a/include/asm-powerpc/cputime.h b/include/asm-powerpc/cputime.h index a21185d47883..310804485208 100644 --- a/include/asm-powerpc/cputime.h +++ b/include/asm-powerpc/cputime.h | |||
@@ -43,6 +43,7 @@ typedef u64 cputime64_t; | |||
43 | 43 | ||
44 | #define cputime64_zero ((cputime64_t)0) | 44 | #define cputime64_zero ((cputime64_t)0) |
45 | #define cputime64_add(__a, __b) ((__a) + (__b)) | 45 | #define cputime64_add(__a, __b) ((__a) + (__b)) |
46 | #define cputime64_sub(__a, __b) ((__a) - (__b)) | ||
46 | #define cputime_to_cputime64(__ct) (__ct) | 47 | #define cputime_to_cputime64(__ct) (__ct) |
47 | 48 | ||
48 | #ifdef __KERNEL__ | 49 | #ifdef __KERNEL__ |
@@ -74,6 +75,23 @@ static inline cputime_t jiffies_to_cputime(const unsigned long jif) | |||
74 | return ct; | 75 | return ct; |
75 | } | 76 | } |
76 | 77 | ||
78 | static inline cputime64_t jiffies64_to_cputime64(const u64 jif) | ||
79 | { | ||
80 | cputime_t ct; | ||
81 | u64 sec; | ||
82 | |||
83 | /* have to be a little careful about overflow */ | ||
84 | ct = jif % HZ; | ||
85 | sec = jif / HZ; | ||
86 | if (ct) { | ||
87 | ct *= tb_ticks_per_sec; | ||
88 | do_div(ct, HZ); | ||
89 | } | ||
90 | if (sec) | ||
91 | ct += (cputime_t) sec * tb_ticks_per_sec; | ||
92 | return ct; | ||
93 | } | ||
94 | |||
77 | static inline u64 cputime64_to_jiffies64(const cputime_t ct) | 95 | static inline u64 cputime64_to_jiffies64(const cputime_t ct) |
78 | { | 96 | { |
79 | return mulhdu(ct, __cputime_jiffies_factor); | 97 | return mulhdu(ct, __cputime_jiffies_factor); |
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h index 9c8d91bf5a0d..fd242a22331c 100644 --- a/include/asm-powerpc/floppy.h +++ b/include/asm-powerpc/floppy.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) | 27 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) |
28 | #define fd_cacheflush(addr,size) /* nothing */ | 28 | #define fd_cacheflush(addr,size) /* nothing */ |
29 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ | 29 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ |
30 | SA_INTERRUPT, "floppy", NULL) | 30 | IRQF_DISABLED, "floppy", NULL) |
31 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); | 31 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); |
32 | 32 | ||
33 | #ifdef CONFIG_PCI | 33 | #ifdef CONFIG_PCI |
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h index ce0f7db63c16..d40359204aba 100644 --- a/include/asm-powerpc/hw_irq.h +++ b/include/asm-powerpc/hw_irq.h | |||
@@ -86,27 +86,27 @@ static inline void local_irq_save_ptr(unsigned long *flags) | |||
86 | #define mask_irq(irq) \ | 86 | #define mask_irq(irq) \ |
87 | ({ \ | 87 | ({ \ |
88 | irq_desc_t *desc = get_irq_desc(irq); \ | 88 | irq_desc_t *desc = get_irq_desc(irq); \ |
89 | if (desc->handler && desc->handler->disable) \ | 89 | if (desc->chip && desc->chip->disable) \ |
90 | desc->handler->disable(irq); \ | 90 | desc->chip->disable(irq); \ |
91 | }) | 91 | }) |
92 | #define unmask_irq(irq) \ | 92 | #define unmask_irq(irq) \ |
93 | ({ \ | 93 | ({ \ |
94 | irq_desc_t *desc = get_irq_desc(irq); \ | 94 | irq_desc_t *desc = get_irq_desc(irq); \ |
95 | if (desc->handler && desc->handler->enable) \ | 95 | if (desc->chip && desc->chip->enable) \ |
96 | desc->handler->enable(irq); \ | 96 | desc->chip->enable(irq); \ |
97 | }) | 97 | }) |
98 | #define ack_irq(irq) \ | 98 | #define ack_irq(irq) \ |
99 | ({ \ | 99 | ({ \ |
100 | irq_desc_t *desc = get_irq_desc(irq); \ | 100 | irq_desc_t *desc = get_irq_desc(irq); \ |
101 | if (desc->handler && desc->handler->ack) \ | 101 | if (desc->chip && desc->chip->ack) \ |
102 | desc->handler->ack(irq); \ | 102 | desc->chip->ack(irq); \ |
103 | }) | 103 | }) |
104 | 104 | ||
105 | /* Should we handle this via lost interrupts and IPIs or should we don't care like | 105 | /* |
106 | * we do now ? --BenH. | 106 | * interrupt-retrigger: should we handle this via lost interrupts and IPIs |
107 | * or should we not care like we do now ? --BenH. | ||
107 | */ | 108 | */ |
108 | struct hw_interrupt_type; | 109 | struct hw_interrupt_type; |
109 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
110 | 110 | ||
111 | #endif /* __KERNEL__ */ | 111 | #endif /* __KERNEL__ */ |
112 | #endif /* _ASM_POWERPC_HW_IRQ_H */ | 112 | #endif /* _ASM_POWERPC_HW_IRQ_H */ |
diff --git a/include/asm-powerpc/i8259.h b/include/asm-powerpc/i8259.h index 0392159e16e4..c80e113052cd 100644 --- a/include/asm-powerpc/i8259.h +++ b/include/asm-powerpc/i8259.h | |||
@@ -4,11 +4,13 @@ | |||
4 | 4 | ||
5 | #include <linux/irq.h> | 5 | #include <linux/irq.h> |
6 | 6 | ||
7 | extern struct hw_interrupt_type i8259_pic; | 7 | #ifdef CONFIG_PPC_MERGE |
8 | 8 | extern void i8259_init(struct device_node *node, unsigned long intack_addr); | |
9 | extern unsigned int i8259_irq(struct pt_regs *regs); | ||
10 | #else | ||
9 | extern void i8259_init(unsigned long intack_addr, int offset); | 11 | extern void i8259_init(unsigned long intack_addr, int offset); |
10 | extern int i8259_irq(struct pt_regs *regs); | 12 | extern int i8259_irq(struct pt_regs *regs); |
11 | extern int i8259_irq_cascade(struct pt_regs *regs, void *unused); | 13 | #endif |
12 | 14 | ||
13 | #endif /* __KERNEL__ */ | 15 | #endif /* __KERNEL__ */ |
14 | #endif /* _ASM_POWERPC_I8259_H */ | 16 | #endif /* _ASM_POWERPC_I8259_H */ |
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index a10feec29d4d..d903a62959da 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -9,31 +9,14 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/config.h> | ||
12 | #include <linux/threads.h> | 13 | #include <linux/threads.h> |
14 | #include <linux/list.h> | ||
15 | #include <linux/radix-tree.h> | ||
13 | 16 | ||
14 | #include <asm/types.h> | 17 | #include <asm/types.h> |
15 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
16 | 19 | ||
17 | /* this number is used when no interrupt has been assigned */ | ||
18 | #define NO_IRQ (-1) | ||
19 | |||
20 | /* | ||
21 | * These constants are used for passing information about interrupt | ||
22 | * signal polarity and level/edge sensing to the low-level PIC chip | ||
23 | * drivers. | ||
24 | */ | ||
25 | #define IRQ_SENSE_MASK 0x1 | ||
26 | #define IRQ_SENSE_LEVEL 0x1 /* interrupt on active level */ | ||
27 | #define IRQ_SENSE_EDGE 0x0 /* interrupt triggered by edge */ | ||
28 | |||
29 | #define IRQ_POLARITY_MASK 0x2 | ||
30 | #define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ | ||
31 | #define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ | ||
32 | |||
33 | /* | ||
34 | * IRQ line status macro IRQ_PER_CPU is used | ||
35 | */ | ||
36 | #define ARCH_HAS_IRQ_PER_CPU | ||
37 | 20 | ||
38 | #define get_irq_desc(irq) (&irq_desc[(irq)]) | 21 | #define get_irq_desc(irq) (&irq_desc[(irq)]) |
39 | 22 | ||
@@ -41,50 +24,313 @@ | |||
41 | #define for_each_irq(i) \ | 24 | #define for_each_irq(i) \ |
42 | for ((i) = 0; (i) < NR_IRQS; ++(i)) | 25 | for ((i) = 0; (i) < NR_IRQS; ++(i)) |
43 | 26 | ||
44 | #ifdef CONFIG_PPC64 | 27 | extern atomic_t ppc_n_lost_interrupts; |
45 | 28 | ||
46 | /* | 29 | #ifdef CONFIG_PPC_MERGE |
47 | * Maximum number of interrupt sources that we can handle. | 30 | |
31 | /* This number is used when no interrupt has been assigned */ | ||
32 | #define NO_IRQ (0) | ||
33 | |||
34 | /* This is a special irq number to return from get_irq() to tell that | ||
35 | * no interrupt happened _and_ ignore it (don't count it as bad). Some | ||
36 | * platforms like iSeries rely on that. | ||
48 | */ | 37 | */ |
38 | #define NO_IRQ_IGNORE ((unsigned int)-1) | ||
39 | |||
40 | /* Total number of virq in the platform (make it a CONFIG_* option ? */ | ||
49 | #define NR_IRQS 512 | 41 | #define NR_IRQS 512 |
50 | 42 | ||
51 | /* Interrupt numbers are virtual in case they are sparsely | 43 | /* Number of irqs reserved for the legacy controller */ |
52 | * distributed by the hardware. | 44 | #define NUM_ISA_INTERRUPTS 16 |
45 | |||
46 | /* This type is the placeholder for a hardware interrupt number. It has to | ||
47 | * be big enough to enclose whatever representation is used by a given | ||
48 | * platform. | ||
49 | */ | ||
50 | typedef unsigned long irq_hw_number_t; | ||
51 | |||
52 | /* Interrupt controller "host" data structure. This could be defined as a | ||
53 | * irq domain controller. That is, it handles the mapping between hardware | ||
54 | * and virtual interrupt numbers for a given interrupt domain. The host | ||
55 | * structure is generally created by the PIC code for a given PIC instance | ||
56 | * (though a host can cover more than one PIC if they have a flat number | ||
57 | * model). It's the host callbacks that are responsible for setting the | ||
58 | * irq_chip on a given irq_desc after it's been mapped. | ||
59 | * | ||
60 | * The host code and data structures are fairly agnostic to the fact that | ||
61 | * we use an open firmware device-tree. We do have references to struct | ||
62 | * device_node in two places: in irq_find_host() to find the host matching | ||
63 | * a given interrupt controller node, and of course as an argument to its | ||
64 | * counterpart host->ops->match() callback. However, those are treated as | ||
65 | * generic pointers by the core and the fact that it's actually a device-node | ||
66 | * pointer is purely a convention between callers and implementation. This | ||
67 | * code could thus be used on other architectures by replacing those two | ||
68 | * by some sort of arch-specific void * "token" used to identify interrupt | ||
69 | * controllers. | ||
70 | */ | ||
71 | struct irq_host; | ||
72 | struct radix_tree_root; | ||
73 | |||
74 | /* Functions below are provided by the host and called whenever a new mapping | ||
75 | * is created or an old mapping is disposed. The host can then proceed to | ||
76 | * whatever internal data structures management is required. It also needs | ||
77 | * to setup the irq_desc when returning from map(). | ||
78 | */ | ||
79 | struct irq_host_ops { | ||
80 | /* Match an interrupt controller device node to a host, returns | ||
81 | * 1 on a match | ||
82 | */ | ||
83 | int (*match)(struct irq_host *h, struct device_node *node); | ||
84 | |||
85 | /* Create or update a mapping between a virtual irq number and a hw | ||
86 | * irq number. This is called only once for a given mapping. | ||
87 | */ | ||
88 | int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw); | ||
89 | |||
90 | /* Dispose of such a mapping */ | ||
91 | void (*unmap)(struct irq_host *h, unsigned int virq); | ||
92 | |||
93 | /* Translate device-tree interrupt specifier from raw format coming | ||
94 | * from the firmware to a irq_hw_number_t (interrupt line number) and | ||
95 | * type (sense) that can be passed to set_irq_type(). In the absence | ||
96 | * of this callback, irq_create_of_mapping() and irq_of_parse_and_map() | ||
97 | * will return the hw number in the first cell and IRQ_TYPE_NONE for | ||
98 | * the type (which amount to keeping whatever default value the | ||
99 | * interrupt controller has for that line) | ||
100 | */ | ||
101 | int (*xlate)(struct irq_host *h, struct device_node *ctrler, | ||
102 | u32 *intspec, unsigned int intsize, | ||
103 | irq_hw_number_t *out_hwirq, unsigned int *out_type); | ||
104 | }; | ||
105 | |||
106 | struct irq_host { | ||
107 | struct list_head link; | ||
108 | |||
109 | /* type of reverse mapping technique */ | ||
110 | unsigned int revmap_type; | ||
111 | #define IRQ_HOST_MAP_LEGACY 0 /* legacy 8259, gets irqs 1..15 */ | ||
112 | #define IRQ_HOST_MAP_NOMAP 1 /* no fast reverse mapping */ | ||
113 | #define IRQ_HOST_MAP_LINEAR 2 /* linear map of interrupts */ | ||
114 | #define IRQ_HOST_MAP_TREE 3 /* radix tree */ | ||
115 | union { | ||
116 | struct { | ||
117 | unsigned int size; | ||
118 | unsigned int *revmap; | ||
119 | } linear; | ||
120 | struct radix_tree_root tree; | ||
121 | } revmap_data; | ||
122 | struct irq_host_ops *ops; | ||
123 | void *host_data; | ||
124 | irq_hw_number_t inval_irq; | ||
125 | }; | ||
126 | |||
127 | /* The main irq map itself is an array of NR_IRQ entries containing the | ||
128 | * associate host and irq number. An entry with a host of NULL is free. | ||
129 | * An entry can be allocated if it's free, the allocator always then sets | ||
130 | * hwirq first to the host's invalid irq number and then fills ops. | ||
131 | */ | ||
132 | struct irq_map_entry { | ||
133 | irq_hw_number_t hwirq; | ||
134 | struct irq_host *host; | ||
135 | }; | ||
136 | |||
137 | extern struct irq_map_entry irq_map[NR_IRQS]; | ||
138 | |||
139 | |||
140 | /*** | ||
141 | * irq_alloc_host - Allocate a new irq_host data structure | ||
142 | * @node: device-tree node of the interrupt controller | ||
143 | * @revmap_type: type of reverse mapping to use | ||
144 | * @revmap_arg: for IRQ_HOST_MAP_LINEAR linear only: size of the map | ||
145 | * @ops: map/unmap host callbacks | ||
146 | * @inval_irq: provide a hw number in that host space that is always invalid | ||
147 | * | ||
148 | * Allocates and initialize and irq_host structure. Note that in the case of | ||
149 | * IRQ_HOST_MAP_LEGACY, the map() callback will be called before this returns | ||
150 | * for all legacy interrupts except 0 (which is always the invalid irq for | ||
151 | * a legacy controller). For a IRQ_HOST_MAP_LINEAR, the map is allocated by | ||
152 | * this call as well. For a IRQ_HOST_MAP_TREE, the radix tree will be allocated | ||
153 | * later during boot automatically (the reverse mapping will use the slow path | ||
154 | * until that happens). | ||
155 | */ | ||
156 | extern struct irq_host *irq_alloc_host(unsigned int revmap_type, | ||
157 | unsigned int revmap_arg, | ||
158 | struct irq_host_ops *ops, | ||
159 | irq_hw_number_t inval_irq); | ||
160 | |||
161 | |||
162 | /*** | ||
163 | * irq_find_host - Locates a host for a given device node | ||
164 | * @node: device-tree node of the interrupt controller | ||
165 | */ | ||
166 | extern struct irq_host *irq_find_host(struct device_node *node); | ||
167 | |||
168 | |||
169 | /*** | ||
170 | * irq_set_default_host - Set a "default" host | ||
171 | * @host: default host pointer | ||
172 | * | ||
173 | * For convenience, it's possible to set a "default" host that will be used | ||
174 | * whenever NULL is passed to irq_create_mapping(). It makes life easier for | ||
175 | * platforms that want to manipulate a few hard coded interrupt numbers that | ||
176 | * aren't properly represented in the device-tree. | ||
177 | */ | ||
178 | extern void irq_set_default_host(struct irq_host *host); | ||
179 | |||
180 | |||
181 | /*** | ||
182 | * irq_set_virq_count - Set the maximum number of virt irqs | ||
183 | * @count: number of linux virtual irqs, capped with NR_IRQS | ||
184 | * | ||
185 | * This is mainly for use by platforms like iSeries who want to program | ||
186 | * the virtual irq number in the controller to avoid the reverse mapping | ||
187 | */ | ||
188 | extern void irq_set_virq_count(unsigned int count); | ||
189 | |||
190 | |||
191 | /*** | ||
192 | * irq_create_mapping - Map a hardware interrupt into linux virq space | ||
193 | * @host: host owning this hardware interrupt or NULL for default host | ||
194 | * @hwirq: hardware irq number in that host space | ||
195 | * | ||
196 | * Only one mapping per hardware interrupt is permitted. Returns a linux | ||
197 | * virq number. | ||
198 | * If the sense/trigger is to be specified, set_irq_type() should be called | ||
199 | * on the number returned from that call. | ||
200 | */ | ||
201 | extern unsigned int irq_create_mapping(struct irq_host *host, | ||
202 | irq_hw_number_t hwirq); | ||
203 | |||
204 | |||
205 | /*** | ||
206 | * irq_dispose_mapping - Unmap an interrupt | ||
207 | * @virq: linux virq number of the interrupt to unmap | ||
53 | */ | 208 | */ |
54 | extern unsigned int virt_irq_to_real_map[NR_IRQS]; | 209 | extern void irq_dispose_mapping(unsigned int virq); |
55 | 210 | ||
56 | /* The maximum virtual IRQ number that we support. This | 211 | /*** |
57 | * can be set by the platform and will be reduced by the | 212 | * irq_find_mapping - Find a linux virq from an hw irq number. |
58 | * value of __irq_offset_value. It defaults to and is | 213 | * @host: host owning this hardware interrupt |
59 | * capped by (NR_IRQS - 1). | 214 | * @hwirq: hardware irq number in that host space |
215 | * | ||
216 | * This is a slow path, for use by generic code. It's expected that an | ||
217 | * irq controller implementation directly calls the appropriate low level | ||
218 | * mapping function. | ||
219 | */ | ||
220 | extern unsigned int irq_find_mapping(struct irq_host *host, | ||
221 | irq_hw_number_t hwirq); | ||
222 | |||
223 | |||
224 | /*** | ||
225 | * irq_radix_revmap - Find a linux virq from a hw irq number. | ||
226 | * @host: host owning this hardware interrupt | ||
227 | * @hwirq: hardware irq number in that host space | ||
228 | * | ||
229 | * This is a fast path, for use by irq controller code that uses radix tree | ||
230 | * revmaps | ||
60 | */ | 231 | */ |
61 | extern unsigned int virt_irq_max; | 232 | extern unsigned int irq_radix_revmap(struct irq_host *host, |
233 | irq_hw_number_t hwirq); | ||
234 | |||
235 | /*** | ||
236 | * irq_linear_revmap - Find a linux virq from a hw irq number. | ||
237 | * @host: host owning this hardware interrupt | ||
238 | * @hwirq: hardware irq number in that host space | ||
239 | * | ||
240 | * This is a fast path, for use by irq controller code that uses linear | ||
241 | * revmaps. It does fallback to the slow path if the revmap doesn't exist | ||
242 | * yet and will create the revmap entry with appropriate locking | ||
243 | */ | ||
244 | |||
245 | extern unsigned int irq_linear_revmap(struct irq_host *host, | ||
246 | irq_hw_number_t hwirq); | ||
247 | |||
248 | |||
62 | 249 | ||
63 | /* Create a mapping for a real_irq if it doesn't already exist. | 250 | /*** |
64 | * Return the virtual irq as a convenience. | 251 | * irq_alloc_virt - Allocate virtual irq numbers |
252 | * @host: host owning these new virtual irqs | ||
253 | * @count: number of consecutive numbers to allocate | ||
254 | * @hint: pass a hint number, the allocator will try to use a 1:1 mapping | ||
255 | * | ||
256 | * This is a low level function that is used internally by irq_create_mapping() | ||
257 | * and that can be used by some irq controllers implementations for things | ||
258 | * like allocating ranges of numbers for MSIs. The revmaps are left untouched. | ||
259 | */ | ||
260 | extern unsigned int irq_alloc_virt(struct irq_host *host, | ||
261 | unsigned int count, | ||
262 | unsigned int hint); | ||
263 | |||
264 | /*** | ||
265 | * irq_free_virt - Free virtual irq numbers | ||
266 | * @virq: virtual irq number of the first interrupt to free | ||
267 | * @count: number of interrupts to free | ||
268 | * | ||
269 | * This function is the opposite of irq_alloc_virt. It will not clear reverse | ||
270 | * maps, this should be done previously by unmap'ing the interrupt. In fact, | ||
271 | * all interrupts covered by the range being freed should have been unmapped | ||
272 | * prior to calling this. | ||
273 | */ | ||
274 | extern void irq_free_virt(unsigned int virq, unsigned int count); | ||
275 | |||
276 | |||
277 | /* -- OF helpers -- */ | ||
278 | |||
279 | /* irq_create_of_mapping - Map a hardware interrupt into linux virq space | ||
280 | * @controller: Device node of the interrupt controller | ||
281 | * @inspec: Interrupt specifier from the device-tree | ||
282 | * @intsize: Size of the interrupt specifier from the device-tree | ||
283 | * | ||
284 | * This function is identical to irq_create_mapping except that it takes | ||
285 | * as input informations straight from the device-tree (typically the results | ||
286 | * of the of_irq_map_*() functions. | ||
287 | */ | ||
288 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | ||
289 | u32 *intspec, unsigned int intsize); | ||
290 | |||
291 | |||
292 | /* irq_of_parse_and_map - Parse nad Map an interrupt into linux virq space | ||
293 | * @device: Device node of the device whose interrupt is to be mapped | ||
294 | * @index: Index of the interrupt to map | ||
295 | * | ||
296 | * This function is a wrapper that chains of_irq_map_one() and | ||
297 | * irq_create_of_mapping() to make things easier to callers | ||
65 | */ | 298 | */ |
66 | int virt_irq_create_mapping(unsigned int real_irq); | 299 | extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index); |
67 | void virt_irq_init(void); | ||
68 | 300 | ||
69 | static inline unsigned int virt_irq_to_real(unsigned int virt_irq) | 301 | /* -- End OF helpers -- */ |
302 | |||
303 | /*** | ||
304 | * irq_early_init - Init irq remapping subsystem | ||
305 | */ | ||
306 | extern void irq_early_init(void); | ||
307 | |||
308 | static __inline__ int irq_canonicalize(int irq) | ||
70 | { | 309 | { |
71 | return virt_irq_to_real_map[virt_irq]; | 310 | return irq; |
72 | } | 311 | } |
73 | 312 | ||
74 | extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq); | 313 | |
314 | #else /* CONFIG_PPC_MERGE */ | ||
315 | |||
316 | /* This number is used when no interrupt has been assigned */ | ||
317 | #define NO_IRQ (-1) | ||
318 | #define NO_IRQ_IGNORE (-2) | ||
319 | |||
75 | 320 | ||
76 | /* | 321 | /* |
77 | * List of interrupt controllers. | 322 | * These constants are used for passing information about interrupt |
323 | * signal polarity and level/edge sensing to the low-level PIC chip | ||
324 | * drivers. | ||
78 | */ | 325 | */ |
79 | #define IC_INVALID 0 | 326 | #define IRQ_SENSE_MASK 0x1 |
80 | #define IC_OPEN_PIC 1 | 327 | #define IRQ_SENSE_LEVEL 0x1 /* interrupt on active level */ |
81 | #define IC_PPC_XIC 2 | 328 | #define IRQ_SENSE_EDGE 0x0 /* interrupt triggered by edge */ |
82 | #define IC_CELL_PIC 3 | ||
83 | #define IC_ISERIES 4 | ||
84 | 329 | ||
85 | extern u64 ppc64_interrupt_controller; | 330 | #define IRQ_POLARITY_MASK 0x2 |
331 | #define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ | ||
332 | #define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ | ||
86 | 333 | ||
87 | #else /* 32-bit */ | ||
88 | 334 | ||
89 | #if defined(CONFIG_40x) | 335 | #if defined(CONFIG_40x) |
90 | #include <asm/ibm4xx.h> | 336 | #include <asm/ibm4xx.h> |
@@ -517,16 +763,11 @@ extern u64 ppc64_interrupt_controller; | |||
517 | 763 | ||
518 | #endif /* CONFIG_8260 */ | 764 | #endif /* CONFIG_8260 */ |
519 | 765 | ||
520 | #endif | 766 | #endif /* Whatever way too big #ifdef */ |
521 | 767 | ||
522 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | 768 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) |
523 | /* pedantic: these are long because they are used with set_bit --RR */ | 769 | /* pedantic: these are long because they are used with set_bit --RR */ |
524 | extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | 770 | extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; |
525 | extern atomic_t ppc_n_lost_interrupts; | ||
526 | |||
527 | #define virt_irq_create_mapping(x) (x) | ||
528 | |||
529 | #endif | ||
530 | 771 | ||
531 | /* | 772 | /* |
532 | * Because many systems have two overlapping names spaces for | 773 | * Because many systems have two overlapping names spaces for |
@@ -565,6 +806,7 @@ static __inline__ int irq_canonicalize(int irq) | |||
565 | irq = 9; | 806 | irq = 9; |
566 | return irq; | 807 | return irq; |
567 | } | 808 | } |
809 | #endif /* CONFIG_PPC_MERGE */ | ||
568 | 810 | ||
569 | extern int distribute_irqs; | 811 | extern int distribute_irqs; |
570 | 812 | ||
@@ -584,9 +826,8 @@ extern struct thread_info *softirq_ctx[NR_CPUS]; | |||
584 | 826 | ||
585 | extern void irq_ctx_init(void); | 827 | extern void irq_ctx_init(void); |
586 | extern void call_do_softirq(struct thread_info *tp); | 828 | extern void call_do_softirq(struct thread_info *tp); |
587 | extern int call___do_IRQ(int irq, struct pt_regs *regs, | 829 | extern int call_handle_irq(int irq, void *p1, void *p2, |
588 | struct thread_info *tp); | 830 | struct thread_info *tp, void *func); |
589 | |||
590 | #else | 831 | #else |
591 | #define irq_ctx_init() | 832 | #define irq_ctx_init() |
592 | 833 | ||
diff --git a/include/asm-powerpc/irqflags.h b/include/asm-powerpc/irqflags.h new file mode 100644 index 000000000000..7970cbaeaa54 --- /dev/null +++ b/include/asm-powerpc/irqflags.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * include/asm-powerpc/irqflags.h | ||
3 | * | ||
4 | * IRQ flags handling | ||
5 | * | ||
6 | * This file gets included from lowlevel asm headers too, to provide | ||
7 | * wrapped versions of the local_irq_*() APIs, based on the | ||
8 | * raw_local_irq_*() macros from the lowlevel headers. | ||
9 | */ | ||
10 | #ifndef _ASM_IRQFLAGS_H | ||
11 | #define _ASM_IRQFLAGS_H | ||
12 | |||
13 | /* | ||
14 | * Get definitions for raw_local_save_flags(x), etc. | ||
15 | */ | ||
16 | #include <asm-powerpc/hw_irq.h> | ||
17 | |||
18 | /* | ||
19 | * Do the CPU's IRQ-state tracing from assembly code. We call a | ||
20 | * C function, so save all the C-clobbered registers: | ||
21 | */ | ||
22 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
23 | |||
24 | #error No support on PowerPC yet for CONFIG_TRACE_IRQFLAGS | ||
25 | |||
26 | #else | ||
27 | # define TRACE_IRQS_ON | ||
28 | # define TRACE_IRQS_OFF | ||
29 | #endif | ||
30 | |||
31 | #endif | ||
diff --git a/include/asm-powerpc/iseries/it_lp_queue.h b/include/asm-powerpc/iseries/it_lp_queue.h index b7c6fc12cce2..284c5a7db3ac 100644 --- a/include/asm-powerpc/iseries/it_lp_queue.h +++ b/include/asm-powerpc/iseries/it_lp_queue.h | |||
@@ -29,20 +29,20 @@ | |||
29 | 29 | ||
30 | struct HvLpEvent; | 30 | struct HvLpEvent; |
31 | 31 | ||
32 | #define ITMaxLpQueues 8 | 32 | #define IT_LP_MAX_QUEUES 8 |
33 | 33 | ||
34 | #define NotUsed 0 // Queue will not be used by PLIC | 34 | #define IT_LP_NOT_USED 0 /* Queue will not be used by PLIC */ |
35 | #define DedicatedIo 1 // Queue dedicated to IO processor specified | 35 | #define IT_LP_DEDICATED_IO 1 /* Queue dedicated to IO processor specified */ |
36 | #define DedicatedLp 2 // Queue dedicated to LP specified | 36 | #define IT_LP_DEDICATED_LP 2 /* Queue dedicated to LP specified */ |
37 | #define Shared 3 // Queue shared for both IO and LP | 37 | #define IT_LP_SHARED 3 /* Queue shared for both IO and LP */ |
38 | 38 | ||
39 | #define LpEventStackSize 4096 | 39 | #define IT_LP_EVENT_STACK_SIZE 4096 |
40 | #define LpEventMaxSize 256 | 40 | #define IT_LP_EVENT_MAX_SIZE 256 |
41 | #define LpEventAlign 64 | 41 | #define IT_LP_EVENT_ALIGN 64 |
42 | 42 | ||
43 | struct hvlpevent_queue { | 43 | struct hvlpevent_queue { |
44 | /* | 44 | /* |
45 | * The xSlicCurEventPtr is the pointer to the next event stack entry | 45 | * The hq_current_event is the pointer to the next event stack entry |
46 | * that will become valid. The OS must peek at this entry to determine | 46 | * that will become valid. The OS must peek at this entry to determine |
47 | * if it is valid. PLIC will set the valid indicator as the very last | 47 | * if it is valid. PLIC will set the valid indicator as the very last |
48 | * store into that entry. | 48 | * store into that entry. |
@@ -52,23 +52,23 @@ struct hvlpevent_queue { | |||
52 | * location again. | 52 | * location again. |
53 | * | 53 | * |
54 | * If the event stack fills and there are overflow events, then PLIC | 54 | * If the event stack fills and there are overflow events, then PLIC |
55 | * will set the xPlicOverflowIntPending flag in which case the OS will | 55 | * will set the hq_overflow_pending flag in which case the OS will |
56 | * have to fetch the additional LP events once they have drained the | 56 | * have to fetch the additional LP events once they have drained the |
57 | * event stack. | 57 | * event stack. |
58 | * | 58 | * |
59 | * The first 16-bytes are known by both the OS and PLIC. The remainder | 59 | * The first 16-bytes are known by both the OS and PLIC. The remainder |
60 | * of the cache line is for use by the OS. | 60 | * of the cache line is for use by the OS. |
61 | */ | 61 | */ |
62 | u8 xPlicOverflowIntPending;// 0x00 Overflow events are pending | 62 | u8 hq_overflow_pending; /* 0x00 Overflow events are pending */ |
63 | u8 xPlicStatus; // 0x01 DedicatedIo or DedicatedLp or NotUsed | 63 | u8 hq_status; /* 0x01 DedicatedIo or DedicatedLp or NotUsed */ |
64 | u16 xSlicLogicalProcIndex; // 0x02 Logical Proc Index for correlation | 64 | u16 hq_proc_index; /* 0x02 Logical Proc Index for correlation */ |
65 | u8 xPlicRsvd[12]; // 0x04 | 65 | u8 hq_reserved1[12]; /* 0x04 */ |
66 | char *xSlicCurEventPtr; // 0x10 | 66 | char *hq_current_event; /* 0x10 */ |
67 | char *xSlicLastValidEventPtr; // 0x18 | 67 | char *hq_last_event; /* 0x18 */ |
68 | char *xSlicEventStackPtr; // 0x20 | 68 | char *hq_event_stack; /* 0x20 */ |
69 | u8 xIndex; // 0x28 unique sequential index. | 69 | u8 hq_index; /* 0x28 unique sequential index. */ |
70 | u8 xSlicRsvd[3]; // 0x29-2b | 70 | u8 hq_reserved2[3]; /* 0x29-2b */ |
71 | spinlock_t lock; | 71 | spinlock_t hq_lock; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | extern struct hvlpevent_queue hvlpevent_queue; | 74 | extern struct hvlpevent_queue hvlpevent_queue; |
diff --git a/include/asm-powerpc/kdump.h b/include/asm-powerpc/kdump.h index 5a5c3b5ab1e0..dc1574c945f8 100644 --- a/include/asm-powerpc/kdump.h +++ b/include/asm-powerpc/kdump.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #define KDUMP_TRAMPOLINE_START 0x0100 | 15 | #define KDUMP_TRAMPOLINE_START 0x0100 |
16 | #define KDUMP_TRAMPOLINE_END 0x3000 | 16 | #define KDUMP_TRAMPOLINE_END 0x3000 |
17 | 17 | ||
18 | #define KDUMP_MIN_TCE_ENTRIES 2048 | ||
19 | |||
18 | #else /* !CONFIG_CRASH_DUMP */ | 20 | #else /* !CONFIG_CRASH_DUMP */ |
19 | 21 | ||
20 | #define PHYSICAL_START 0x0 | 22 | #define PHYSICAL_START 0x0 |
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h index efe8872ec583..8f7fd5cfec34 100644 --- a/include/asm-powerpc/kexec.h +++ b/include/asm-powerpc/kexec.h | |||
@@ -112,9 +112,13 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
112 | #ifdef __powerpc64__ | 112 | #ifdef __powerpc64__ |
113 | extern void kexec_smp_wait(void); /* get and clear naca physid, wait for | 113 | extern void kexec_smp_wait(void); /* get and clear naca physid, wait for |
114 | master to copy new code to 0 */ | 114 | master to copy new code to 0 */ |
115 | extern void __init kexec_setup(void); | ||
116 | extern int crashing_cpu; | 115 | extern int crashing_cpu; |
117 | extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)); | 116 | extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)); |
117 | extern cpumask_t cpus_in_sr; | ||
118 | static inline int kexec_sr_activated(int cpu) | ||
119 | { | ||
120 | return cpu_isset(cpu,cpus_in_sr); | ||
121 | } | ||
118 | #endif /* __powerpc64 __ */ | 122 | #endif /* __powerpc64 __ */ |
119 | 123 | ||
120 | struct kimage; | 124 | struct kimage; |
@@ -124,10 +128,13 @@ extern int default_machine_kexec_prepare(struct kimage *image); | |||
124 | extern void default_machine_crash_shutdown(struct pt_regs *regs); | 128 | extern void default_machine_crash_shutdown(struct pt_regs *regs); |
125 | 129 | ||
126 | extern void machine_kexec_simple(struct kimage *image); | 130 | extern void machine_kexec_simple(struct kimage *image); |
131 | extern void crash_kexec_secondary(struct pt_regs *regs); | ||
127 | extern int overlaps_crashkernel(unsigned long start, unsigned long size); | 132 | extern int overlaps_crashkernel(unsigned long start, unsigned long size); |
128 | extern void reserve_crashkernel(void); | 133 | extern void reserve_crashkernel(void); |
129 | 134 | ||
130 | #else /* !CONFIG_KEXEC */ | 135 | #else /* !CONFIG_KEXEC */ |
136 | static inline int kexec_sr_activated(int cpu) { return 0; } | ||
137 | static inline void crash_kexec_secondary(struct pt_regs *regs) { } | ||
131 | 138 | ||
132 | static inline int overlaps_crashkernel(unsigned long start, unsigned long size) | 139 | static inline int overlaps_crashkernel(unsigned long start, unsigned long size) |
133 | { | 140 | { |
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 73db1f71329d..c17c13742401 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
@@ -81,6 +81,8 @@ struct machdep_calls { | |||
81 | void (*tce_free)(struct iommu_table *tbl, | 81 | void (*tce_free)(struct iommu_table *tbl, |
82 | long index, | 82 | long index, |
83 | long npages); | 83 | long npages); |
84 | unsigned long (*tce_get)(struct iommu_table *tbl, | ||
85 | long index); | ||
84 | void (*tce_flush)(struct iommu_table *tbl); | 86 | void (*tce_flush)(struct iommu_table *tbl); |
85 | void (*iommu_dev_setup)(struct pci_dev *dev); | 87 | void (*iommu_dev_setup)(struct pci_dev *dev); |
86 | void (*iommu_bus_setup)(struct pci_bus *bus); | 88 | void (*iommu_bus_setup)(struct pci_bus *bus); |
@@ -95,7 +97,7 @@ struct machdep_calls { | |||
95 | void (*show_percpuinfo)(struct seq_file *m, int i); | 97 | void (*show_percpuinfo)(struct seq_file *m, int i); |
96 | 98 | ||
97 | void (*init_IRQ)(void); | 99 | void (*init_IRQ)(void); |
98 | int (*get_irq)(struct pt_regs *); | 100 | unsigned int (*get_irq)(struct pt_regs *); |
99 | #ifdef CONFIG_KEXEC | 101 | #ifdef CONFIG_KEXEC |
100 | void (*kexec_cpu_down)(int crash_shutdown, int secondary); | 102 | void (*kexec_cpu_down)(int crash_shutdown, int secondary); |
101 | #endif | 103 | #endif |
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h index 3a5ebe229af5..c3fc7a28e3cd 100644 --- a/include/asm-powerpc/mmu.h +++ b/include/asm-powerpc/mmu.h | |||
@@ -238,7 +238,6 @@ extern int hash_huge_page(struct mm_struct *mm, unsigned long access, | |||
238 | unsigned long ea, unsigned long vsid, int local, | 238 | unsigned long ea, unsigned long vsid, int local, |
239 | unsigned long trap); | 239 | unsigned long trap); |
240 | 240 | ||
241 | extern void htab_finish_init(void); | ||
242 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | 241 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, |
243 | unsigned long pstart, unsigned long mode, | 242 | unsigned long pstart, unsigned long mode, |
244 | int psize); | 243 | int psize); |
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h index 8c6b1a6d944f..083ac917bd29 100644 --- a/include/asm-powerpc/mmu_context.h +++ b/include/asm-powerpc/mmu_context.h | |||
@@ -25,8 +25,13 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, | |||
25 | { | 25 | { |
26 | } | 26 | } |
27 | 27 | ||
28 | /* | ||
29 | * The proto-VSID space has 2^35 - 1 segments available for user mappings. | ||
30 | * Each segment contains 2^28 bytes. Each context maps 2^44 bytes, | ||
31 | * so we can support 2^19-1 contexts (19 == 35 + 28 - 44). | ||
32 | */ | ||
28 | #define NO_CONTEXT 0 | 33 | #define NO_CONTEXT 0 |
29 | #define MAX_CONTEXT (0x100000-1) | 34 | #define MAX_CONTEXT ((1UL << 19) - 1) |
30 | 35 | ||
31 | extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); | 36 | extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); |
32 | extern void destroy_context(struct mm_struct *mm); | 37 | extern void destroy_context(struct mm_struct *mm); |
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h index d0a6718d188b..f260382739fa 100644 --- a/include/asm-powerpc/mpc86xx.h +++ b/include/asm-powerpc/mpc86xx.h | |||
@@ -15,15 +15,10 @@ | |||
15 | #ifndef __ASM_POWERPC_MPC86xx_H__ | 15 | #ifndef __ASM_POWERPC_MPC86xx_H__ |
16 | #define __ASM_POWERPC_MPC86xx_H__ | 16 | #define __ASM_POWERPC_MPC86xx_H__ |
17 | 17 | ||
18 | #include <linux/config.h> | ||
19 | #include <asm/mmu.h> | 18 | #include <asm/mmu.h> |
20 | 19 | ||
21 | #ifdef CONFIG_PPC_86xx | 20 | #ifdef CONFIG_PPC_86xx |
22 | 21 | ||
23 | #ifdef CONFIG_MPC8641_HPCN | ||
24 | #include <platforms/86xx/mpc8641_hpcn.h> | ||
25 | #endif | ||
26 | |||
27 | #define _IO_BASE isa_io_base | 22 | #define _IO_BASE isa_io_base |
28 | #define _ISA_MEM_BASE isa_mem_base | 23 | #define _ISA_MEM_BASE isa_mem_base |
29 | #ifdef CONFIG_PCI | 24 | #ifdef CONFIG_PCI |
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index f0d22ac34b96..eb241c99c457 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h | |||
@@ -114,9 +114,6 @@ | |||
114 | #define MPIC_VEC_TIMER_1 248 | 114 | #define MPIC_VEC_TIMER_1 248 |
115 | #define MPIC_VEC_TIMER_0 247 | 115 | #define MPIC_VEC_TIMER_0 247 |
116 | 116 | ||
117 | /* Type definition of the cascade handler */ | ||
118 | typedef int (*mpic_cascade_t)(struct pt_regs *regs, void *data); | ||
119 | |||
120 | #ifdef CONFIG_MPIC_BROKEN_U3 | 117 | #ifdef CONFIG_MPIC_BROKEN_U3 |
121 | /* Fixup table entry */ | 118 | /* Fixup table entry */ |
122 | struct mpic_irq_fixup | 119 | struct mpic_irq_fixup |
@@ -132,10 +129,19 @@ struct mpic_irq_fixup | |||
132 | /* The instance data of a given MPIC */ | 129 | /* The instance data of a given MPIC */ |
133 | struct mpic | 130 | struct mpic |
134 | { | 131 | { |
132 | /* The device node of the interrupt controller */ | ||
133 | struct device_node *of_node; | ||
134 | |||
135 | /* The remapper for this MPIC */ | ||
136 | struct irq_host *irqhost; | ||
137 | |||
135 | /* The "linux" controller struct */ | 138 | /* The "linux" controller struct */ |
136 | hw_irq_controller hc_irq; | 139 | struct irq_chip hc_irq; |
140 | #ifdef CONFIG_MPIC_BROKEN_U3 | ||
141 | struct irq_chip hc_ht_irq; | ||
142 | #endif | ||
137 | #ifdef CONFIG_SMP | 143 | #ifdef CONFIG_SMP |
138 | hw_irq_controller hc_ipi; | 144 | struct irq_chip hc_ipi; |
139 | #endif | 145 | #endif |
140 | const char *name; | 146 | const char *name; |
141 | /* Flags */ | 147 | /* Flags */ |
@@ -144,20 +150,12 @@ struct mpic | |||
144 | unsigned int isu_size; | 150 | unsigned int isu_size; |
145 | unsigned int isu_shift; | 151 | unsigned int isu_shift; |
146 | unsigned int isu_mask; | 152 | unsigned int isu_mask; |
147 | /* Offset of irq vector numbers */ | ||
148 | unsigned int irq_offset; | ||
149 | unsigned int irq_count; | 153 | unsigned int irq_count; |
150 | /* Offset of ipi vector numbers */ | ||
151 | unsigned int ipi_offset; | ||
152 | /* Number of sources */ | 154 | /* Number of sources */ |
153 | unsigned int num_sources; | 155 | unsigned int num_sources; |
154 | /* Number of CPUs */ | 156 | /* Number of CPUs */ |
155 | unsigned int num_cpus; | 157 | unsigned int num_cpus; |
156 | /* cascade handler */ | 158 | /* default senses array */ |
157 | mpic_cascade_t cascade; | ||
158 | void *cascade_data; | ||
159 | unsigned int cascade_vec; | ||
160 | /* senses array */ | ||
161 | unsigned char *senses; | 159 | unsigned char *senses; |
162 | unsigned int senses_count; | 160 | unsigned int senses_count; |
163 | 161 | ||
@@ -213,14 +211,11 @@ struct mpic | |||
213 | * The values in the array start at the first source of the MPIC, | 211 | * The values in the array start at the first source of the MPIC, |
214 | * that is senses[0] correspond to linux irq "irq_offset". | 212 | * that is senses[0] correspond to linux irq "irq_offset". |
215 | */ | 213 | */ |
216 | extern struct mpic *mpic_alloc(unsigned long phys_addr, | 214 | extern struct mpic *mpic_alloc(struct device_node *node, |
215 | unsigned long phys_addr, | ||
217 | unsigned int flags, | 216 | unsigned int flags, |
218 | unsigned int isu_size, | 217 | unsigned int isu_size, |
219 | unsigned int irq_offset, | ||
220 | unsigned int irq_count, | 218 | unsigned int irq_count, |
221 | unsigned int ipi_offset, | ||
222 | unsigned char *senses, | ||
223 | unsigned int senses_num, | ||
224 | const char *name); | 219 | const char *name); |
225 | 220 | ||
226 | /* Assign ISUs, to call before mpic_init() | 221 | /* Assign ISUs, to call before mpic_init() |
@@ -232,22 +227,27 @@ extern struct mpic *mpic_alloc(unsigned long phys_addr, | |||
232 | extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, | 227 | extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, |
233 | unsigned long phys_addr); | 228 | unsigned long phys_addr); |
234 | 229 | ||
230 | /* Set default sense codes | ||
231 | * | ||
232 | * @mpic: controller | ||
233 | * @senses: array of sense codes | ||
234 | * @count: size of above array | ||
235 | * | ||
236 | * Optionally provide an array (indexed on hardware interrupt numbers | ||
237 | * for this MPIC) of default sense codes for the chip. Those are linux | ||
238 | * sense codes IRQ_TYPE_* | ||
239 | * | ||
240 | * The driver gets ownership of the pointer, don't dispose of it or | ||
241 | * anything like that. __init only. | ||
242 | */ | ||
243 | extern void mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count); | ||
244 | |||
245 | |||
235 | /* Initialize the controller. After this has been called, none of the above | 246 | /* Initialize the controller. After this has been called, none of the above |
236 | * should be called again for this mpic | 247 | * should be called again for this mpic |
237 | */ | 248 | */ |
238 | extern void mpic_init(struct mpic *mpic); | 249 | extern void mpic_init(struct mpic *mpic); |
239 | 250 | ||
240 | /* Setup a cascade. Currently, only one cascade is supported this | ||
241 | * way, though you can always do a normal request_irq() and add | ||
242 | * other cascades this way. You should call this _after_ having | ||
243 | * added all the ISUs | ||
244 | * | ||
245 | * @irq_no: "linux" irq number of the cascade (that is offset'ed vector) | ||
246 | * @handler: cascade handler function | ||
247 | */ | ||
248 | extern void mpic_setup_cascade(unsigned int irq_no, mpic_cascade_t hanlder, | ||
249 | void *data); | ||
250 | |||
251 | /* | 251 | /* |
252 | * All of the following functions must only be used after the | 252 | * All of the following functions must only be used after the |
253 | * ISUs have been assigned and the controller fully initialized | 253 | * ISUs have been assigned and the controller fully initialized |
@@ -284,9 +284,9 @@ extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask); | |||
284 | void smp_mpic_message_pass(int target, int msg); | 284 | void smp_mpic_message_pass(int target, int msg); |
285 | 285 | ||
286 | /* Fetch interrupt from a given mpic */ | 286 | /* Fetch interrupt from a given mpic */ |
287 | extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); | 287 | extern unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); |
288 | /* This one gets to the primary mpic */ | 288 | /* This one gets to the primary mpic */ |
289 | extern int mpic_get_irq(struct pt_regs *regs); | 289 | extern unsigned int mpic_get_irq(struct pt_regs *regs); |
290 | 290 | ||
291 | /* Set the EPIC clock ratio */ | 291 | /* Set the EPIC clock ratio */ |
292 | void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); | 292 | void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); |
@@ -294,8 +294,5 @@ void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); | |||
294 | /* Enable/Disable EPIC serial interrupt mode */ | 294 | /* Enable/Disable EPIC serial interrupt mode */ |
295 | void mpic_set_serial_int(struct mpic *mpic, int enable); | 295 | void mpic_set_serial_int(struct mpic *mpic, int enable); |
296 | 296 | ||
297 | /* global mpic for pSeries */ | ||
298 | extern struct mpic *pSeries_mpic; | ||
299 | |||
300 | #endif /* __KERNEL__ */ | 297 | #endif /* __KERNEL__ */ |
301 | #endif /* _ASM_POWERPC_MPIC_H */ | 298 | #endif /* _ASM_POWERPC_MPIC_H */ |
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h index 6249a7c39639..c5c0b0b3cd52 100644 --- a/include/asm-powerpc/of_device.h +++ b/include/asm-powerpc/of_device.h | |||
@@ -9,7 +9,7 @@ | |||
9 | /* | 9 | /* |
10 | * The of_platform_bus_type is a bus type used by drivers that do not | 10 | * The of_platform_bus_type is a bus type used by drivers that do not |
11 | * attach to a macio or similar bus but still use OF probing | 11 | * attach to a macio or similar bus but still use OF probing |
12 | * mecanism | 12 | * mechanism |
13 | */ | 13 | */ |
14 | extern struct bus_type of_platform_bus_type; | 14 | extern struct bus_type of_platform_bus_type; |
15 | 15 | ||
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h index 5d2c9e6c4be2..46afd29b904e 100644 --- a/include/asm-powerpc/pci.h +++ b/include/asm-powerpc/pci.h | |||
@@ -242,7 +242,7 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file, | |||
242 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER | 242 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER |
243 | extern void pci_resource_to_user(const struct pci_dev *dev, int bar, | 243 | extern void pci_resource_to_user(const struct pci_dev *dev, int bar, |
244 | const struct resource *rsrc, | 244 | const struct resource *rsrc, |
245 | u64 *start, u64 *end); | 245 | resource_size_t *start, resource_size_t *end); |
246 | #endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */ | 246 | #endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */ |
247 | 247 | ||
248 | #endif /* __KERNEL__ */ | 248 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h index faa1fc703053..2f2e3024fa61 100644 --- a/include/asm-powerpc/percpu.h +++ b/include/asm-powerpc/percpu.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #define __per_cpu_offset(cpu) (paca[cpu].data_offset) | 15 | #define __per_cpu_offset(cpu) (paca[cpu].data_offset) |
16 | #define __my_cpu_offset() get_paca()->data_offset | 16 | #define __my_cpu_offset() get_paca()->data_offset |
17 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
17 | 18 | ||
18 | /* Separate out the type, so (int[3], foo) works. */ | 19 | /* Separate out the type, so (int[3], foo) works. */ |
19 | #define DEFINE_PER_CPU(type, name) \ | 20 | #define DEFINE_PER_CPU(type, name) \ |
diff --git a/include/asm-powerpc/pmac_pfunc.h b/include/asm-powerpc/pmac_pfunc.h index cef61304ffc2..1330d6a58c57 100644 --- a/include/asm-powerpc/pmac_pfunc.h +++ b/include/asm-powerpc/pmac_pfunc.h | |||
@@ -205,7 +205,7 @@ extern void pmf_do_irq(struct pmf_function *func); | |||
205 | * | 205 | * |
206 | * The args array contains as many arguments as is required by the function, | 206 | * The args array contains as many arguments as is required by the function, |
207 | * this is dependent on the function you are calling, unfortunately Apple | 207 | * this is dependent on the function you are calling, unfortunately Apple |
208 | * mecanism provides no way to encode that so you have to get it right at | 208 | * mechanism provides no way to encode that so you have to get it right at |
209 | * the call site. Some functions require no args, in which case, you can | 209 | * the call site. Some functions require no args, in which case, you can |
210 | * pass NULL. | 210 | * pass NULL. |
211 | * | 211 | * |
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 010d186d095b..b095a285c84b 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -64,11 +64,6 @@ struct boot_param_header | |||
64 | typedef u32 phandle; | 64 | typedef u32 phandle; |
65 | typedef u32 ihandle; | 65 | typedef u32 ihandle; |
66 | 66 | ||
67 | struct interrupt_info { | ||
68 | int line; | ||
69 | int sense; /* +ve/-ve logic, edge or level, etc. */ | ||
70 | }; | ||
71 | |||
72 | struct property { | 67 | struct property { |
73 | char *name; | 68 | char *name; |
74 | int length; | 69 | int length; |
@@ -81,8 +76,6 @@ struct device_node { | |||
81 | char *type; | 76 | char *type; |
82 | phandle node; | 77 | phandle node; |
83 | phandle linux_phandle; | 78 | phandle linux_phandle; |
84 | int n_intrs; | ||
85 | struct interrupt_info *intrs; | ||
86 | char *full_name; | 79 | char *full_name; |
87 | 80 | ||
88 | struct property *properties; | 81 | struct property *properties; |
@@ -167,8 +160,8 @@ extern void unflatten_device_tree(void); | |||
167 | extern void early_init_devtree(void *); | 160 | extern void early_init_devtree(void *); |
168 | extern int device_is_compatible(struct device_node *device, const char *); | 161 | extern int device_is_compatible(struct device_node *device, const char *); |
169 | extern int machine_is_compatible(const char *compat); | 162 | extern int machine_is_compatible(const char *compat); |
170 | extern unsigned char *get_property(struct device_node *node, const char *name, | 163 | extern void *get_property(struct device_node *node, const char *name, |
171 | int *lenp); | 164 | int *lenp); |
172 | extern void print_properties(struct device_node *node); | 165 | extern void print_properties(struct device_node *node); |
173 | extern int prom_n_addr_cells(struct device_node* np); | 166 | extern int prom_n_addr_cells(struct device_node* np); |
174 | extern int prom_n_size_cells(struct device_node* np); | 167 | extern int prom_n_size_cells(struct device_node* np); |
@@ -204,6 +197,15 @@ extern int release_OF_resource(struct device_node* node, int index); | |||
204 | */ | 197 | */ |
205 | 198 | ||
206 | 199 | ||
200 | /* Helper to read a big number */ | ||
201 | static inline u64 of_read_number(u32 *cell, int size) | ||
202 | { | ||
203 | u64 r = 0; | ||
204 | while (size--) | ||
205 | r = (r << 32) | *(cell++); | ||
206 | return r; | ||
207 | } | ||
208 | |||
207 | /* Translate an OF address block into a CPU physical address | 209 | /* Translate an OF address block into a CPU physical address |
208 | */ | 210 | */ |
209 | #define OF_BAD_ADDR ((u64)-1) | 211 | #define OF_BAD_ADDR ((u64)-1) |
@@ -240,5 +242,83 @@ extern void kdump_move_device_tree(void); | |||
240 | /* CPU OF node matching */ | 242 | /* CPU OF node matching */ |
241 | struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); | 243 | struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); |
242 | 244 | ||
245 | |||
246 | /* | ||
247 | * OF interrupt mapping | ||
248 | */ | ||
249 | |||
250 | /* This structure is returned when an interrupt is mapped. The controller | ||
251 | * field needs to be put() after use | ||
252 | */ | ||
253 | |||
254 | #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ | ||
255 | |||
256 | struct of_irq { | ||
257 | struct device_node *controller; /* Interrupt controller node */ | ||
258 | u32 size; /* Specifier size */ | ||
259 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | ||
260 | }; | ||
261 | |||
262 | /*** | ||
263 | * of_irq_map_init - Initialize the irq remapper | ||
264 | * @flags: flags defining workarounds to enable | ||
265 | * | ||
266 | * Some machines have bugs in the device-tree which require certain workarounds | ||
267 | * to be applied. Call this before any interrupt mapping attempts to enable | ||
268 | * those workarounds. | ||
269 | */ | ||
270 | #define OF_IMAP_OLDWORLD_MAC 0x00000001 | ||
271 | #define OF_IMAP_NO_PHANDLE 0x00000002 | ||
272 | |||
273 | extern void of_irq_map_init(unsigned int flags); | ||
274 | |||
275 | /*** | ||
276 | * of_irq_map_raw - Low level interrupt tree parsing | ||
277 | * @parent: the device interrupt parent | ||
278 | * @intspec: interrupt specifier ("interrupts" property of the device) | ||
279 | * @addr: address specifier (start of "reg" property of the device) | ||
280 | * @out_irq: structure of_irq filled by this function | ||
281 | * | ||
282 | * Returns 0 on success and a negative number on error | ||
283 | * | ||
284 | * This function is a low-level interrupt tree walking function. It | ||
285 | * can be used to do a partial walk with synthetized reg and interrupts | ||
286 | * properties, for example when resolving PCI interrupts when no device | ||
287 | * node exist for the parent. | ||
288 | * | ||
289 | */ | ||
290 | |||
291 | extern int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr, | ||
292 | struct of_irq *out_irq); | ||
293 | |||
294 | |||
295 | /*** | ||
296 | * of_irq_map_one - Resolve an interrupt for a device | ||
297 | * @device: the device whose interrupt is to be resolved | ||
298 | * @index: index of the interrupt to resolve | ||
299 | * @out_irq: structure of_irq filled by this function | ||
300 | * | ||
301 | * This function resolves an interrupt, walking the tree, for a given | ||
302 | * device-tree node. It's the high level pendant to of_irq_map_raw(). | ||
303 | * It also implements the workarounds for OldWolrd Macs. | ||
304 | */ | ||
305 | extern int of_irq_map_one(struct device_node *device, int index, | ||
306 | struct of_irq *out_irq); | ||
307 | |||
308 | /*** | ||
309 | * of_irq_map_pci - Resolve the interrupt for a PCI device | ||
310 | * @pdev: the device whose interrupt is to be resolved | ||
311 | * @out_irq: structure of_irq filled by this function | ||
312 | * | ||
313 | * This function resolves the PCI interrupt for a given PCI device. If a | ||
314 | * device-node exists for a given pci_dev, it will use normal OF tree | ||
315 | * walking. If not, it will implement standard swizzling and walk up the | ||
316 | * PCI tree until an device-node is found, at which point it will finish | ||
317 | * resolving using the OF tree walking. | ||
318 | */ | ||
319 | struct pci_dev; | ||
320 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); | ||
321 | |||
322 | |||
243 | #endif /* __KERNEL__ */ | 323 | #endif /* __KERNEL__ */ |
244 | #endif /* _POWERPC_PROM_H */ | 324 | #endif /* _POWERPC_PROM_H */ |
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index 02e213e3d69f..a33c6acffa61 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -181,6 +181,9 @@ extern int rtas_set_rtc_time(struct rtc_time *rtc_time); | |||
181 | extern unsigned int rtas_busy_delay_time(int status); | 181 | extern unsigned int rtas_busy_delay_time(int status); |
182 | extern unsigned int rtas_busy_delay(int status); | 182 | extern unsigned int rtas_busy_delay(int status); |
183 | 183 | ||
184 | extern int early_init_dt_scan_rtas(unsigned long node, | ||
185 | const char *uname, int depth, void *data); | ||
186 | |||
184 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); | 187 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); |
185 | 188 | ||
186 | /* Error types logged. */ | 189 | /* Error types logged. */ |
diff --git a/include/asm-powerpc/rwsem.h b/include/asm-powerpc/rwsem.h index 2c2fe9647595..e929145e1e46 100644 --- a/include/asm-powerpc/rwsem.h +++ b/include/asm-powerpc/rwsem.h | |||
@@ -28,24 +28,11 @@ struct rw_semaphore { | |||
28 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 28 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
29 | spinlock_t wait_lock; | 29 | spinlock_t wait_lock; |
30 | struct list_head wait_list; | 30 | struct list_head wait_list; |
31 | #if RWSEM_DEBUG | ||
32 | int debug; | ||
33 | #endif | ||
34 | }; | 31 | }; |
35 | 32 | ||
36 | /* | ||
37 | * initialisation | ||
38 | */ | ||
39 | #if RWSEM_DEBUG | ||
40 | #define __RWSEM_DEBUG_INIT , 0 | ||
41 | #else | ||
42 | #define __RWSEM_DEBUG_INIT /* */ | ||
43 | #endif | ||
44 | |||
45 | #define __RWSEM_INITIALIZER(name) \ | 33 | #define __RWSEM_INITIALIZER(name) \ |
46 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | 34 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ |
47 | LIST_HEAD_INIT((name).wait_list) \ | 35 | LIST_HEAD_INIT((name).wait_list) } |
48 | __RWSEM_DEBUG_INIT } | ||
49 | 36 | ||
50 | #define DECLARE_RWSEM(name) \ | 37 | #define DECLARE_RWSEM(name) \ |
51 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 38 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
@@ -60,9 +47,6 @@ static inline void init_rwsem(struct rw_semaphore *sem) | |||
60 | sem->count = RWSEM_UNLOCKED_VALUE; | 47 | sem->count = RWSEM_UNLOCKED_VALUE; |
61 | spin_lock_init(&sem->wait_lock); | 48 | spin_lock_init(&sem->wait_lock); |
62 | INIT_LIST_HEAD(&sem->wait_list); | 49 | INIT_LIST_HEAD(&sem->wait_list); |
63 | #if RWSEM_DEBUG | ||
64 | sem->debug = 0; | ||
65 | #endif | ||
66 | } | 50 | } |
67 | 51 | ||
68 | /* | 52 | /* |
diff --git a/include/asm-powerpc/signal.h b/include/asm-powerpc/signal.h index a4d8f8648541..a8c7babf4950 100644 --- a/include/asm-powerpc/signal.h +++ b/include/asm-powerpc/signal.h | |||
@@ -63,7 +63,6 @@ typedef struct { | |||
63 | * SA_FLAGS values: | 63 | * SA_FLAGS values: |
64 | * | 64 | * |
65 | * SA_ONSTACK is not currently supported, but will allow sigaltstack(2). | 65 | * SA_ONSTACK is not currently supported, but will allow sigaltstack(2). |
66 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
67 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 66 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
68 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 67 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
69 | * SA_RESETHAND clears the handler when the signal is delivered. | 68 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -83,7 +82,6 @@ typedef struct { | |||
83 | 82 | ||
84 | #define SA_NOMASK SA_NODEFER | 83 | #define SA_NOMASK SA_NODEFER |
85 | #define SA_ONESHOT SA_RESETHAND | 84 | #define SA_ONESHOT SA_RESETHAND |
86 | #define SA_INTERRUPT 0x20000000u /* dummy -- ignored */ | ||
87 | 85 | ||
88 | #define SA_RESTORER 0x04000000U | 86 | #define SA_RESTORER 0x04000000U |
89 | 87 | ||
diff --git a/include/asm-powerpc/socket.h b/include/asm-powerpc/socket.h index e4b8177d4acc..c8b1da50e72d 100644 --- a/include/asm-powerpc/socket.h +++ b/include/asm-powerpc/socket.h | |||
@@ -55,5 +55,6 @@ | |||
55 | #define SO_ACCEPTCONN 30 | 55 | #define SO_ACCEPTCONN 30 |
56 | 56 | ||
57 | #define SO_PEERSEC 31 | 57 | #define SO_PEERSEC 31 |
58 | #define SO_PASSSEC 34 | ||
58 | 59 | ||
59 | #endif /* _ASM_POWERPC_SOCKET_H */ | 60 | #endif /* _ASM_POWERPC_SOCKET_H */ |
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 9609d3ee8798..c02d105d8294 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
@@ -117,6 +117,7 @@ struct spu { | |||
117 | struct list_head sched_list; | 117 | struct list_head sched_list; |
118 | int number; | 118 | int number; |
119 | int nid; | 119 | int nid; |
120 | unsigned int irqs[3]; | ||
120 | u32 isrc; | 121 | u32 isrc; |
121 | u32 node; | 122 | u32 node; |
122 | u64 flags; | 123 | u64 flags; |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index d075725bf444..c6569516ba35 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -220,8 +220,8 @@ __xchg_u32(volatile void *p, unsigned long val) | |||
220 | " stwcx. %3,0,%2 \n\ | 220 | " stwcx. %3,0,%2 \n\ |
221 | bne- 1b" | 221 | bne- 1b" |
222 | ISYNC_ON_SMP | 222 | ISYNC_ON_SMP |
223 | : "=&r" (prev), "=m" (*(volatile unsigned int *)p) | 223 | : "=&r" (prev), "+m" (*(volatile unsigned int *)p) |
224 | : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) | 224 | : "r" (p), "r" (val) |
225 | : "cc", "memory"); | 225 | : "cc", "memory"); |
226 | 226 | ||
227 | return prev; | 227 | return prev; |
@@ -240,8 +240,8 @@ __xchg_u64(volatile void *p, unsigned long val) | |||
240 | " stdcx. %3,0,%2 \n\ | 240 | " stdcx. %3,0,%2 \n\ |
241 | bne- 1b" | 241 | bne- 1b" |
242 | ISYNC_ON_SMP | 242 | ISYNC_ON_SMP |
243 | : "=&r" (prev), "=m" (*(volatile unsigned long *)p) | 243 | : "=&r" (prev), "+m" (*(volatile unsigned long *)p) |
244 | : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) | 244 | : "r" (p), "r" (val) |
245 | : "cc", "memory"); | 245 | : "cc", "memory"); |
246 | 246 | ||
247 | return prev; | 247 | return prev; |
@@ -299,8 +299,8 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | |||
299 | ISYNC_ON_SMP | 299 | ISYNC_ON_SMP |
300 | "\n\ | 300 | "\n\ |
301 | 2:" | 301 | 2:" |
302 | : "=&r" (prev), "=m" (*p) | 302 | : "=&r" (prev), "+m" (*p) |
303 | : "r" (p), "r" (old), "r" (new), "m" (*p) | 303 | : "r" (p), "r" (old), "r" (new) |
304 | : "cc", "memory"); | 304 | : "cc", "memory"); |
305 | 305 | ||
306 | return prev; | 306 | return prev; |
@@ -322,8 +322,8 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | |||
322 | ISYNC_ON_SMP | 322 | ISYNC_ON_SMP |
323 | "\n\ | 323 | "\n\ |
324 | 2:" | 324 | 2:" |
325 | : "=&r" (prev), "=m" (*p) | 325 | : "=&r" (prev), "+m" (*p) |
326 | : "r" (p), "r" (old), "r" (new), "m" (*p) | 326 | : "r" (p), "r" (old), "r" (new) |
327 | : "cc", "memory"); | 327 | : "cc", "memory"); |
328 | 328 | ||
329 | return prev; | 329 | return prev; |
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index 4463148c659f..dcde4410348d 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
@@ -18,8 +18,9 @@ | |||
18 | #include <linux/percpu.h> | 18 | #include <linux/percpu.h> |
19 | 19 | ||
20 | #include <asm/processor.h> | 20 | #include <asm/processor.h> |
21 | #ifdef CONFIG_PPC64 | 21 | #ifdef CONFIG_PPC_ISERIES |
22 | #include <asm/paca.h> | 22 | #include <asm/paca.h> |
23 | #include <asm/firmware.h> | ||
23 | #include <asm/iseries/hv_call.h> | 24 | #include <asm/iseries/hv_call.h> |
24 | #endif | 25 | #endif |
25 | 26 | ||
@@ -177,7 +178,8 @@ static inline void set_dec(int val) | |||
177 | #ifdef CONFIG_PPC_ISERIES | 178 | #ifdef CONFIG_PPC_ISERIES |
178 | int cur_dec; | 179 | int cur_dec; |
179 | 180 | ||
180 | if (get_lppaca()->shared_proc) { | 181 | if (firmware_has_feature(FW_FEATURE_ISERIES) && |
182 | get_lppaca()->shared_proc) { | ||
181 | get_lppaca()->virtual_decr = val; | 183 | get_lppaca()->virtual_decr = val; |
182 | cur_dec = get_dec(); | 184 | cur_dec = get_dec(); |
183 | if (cur_dec > val) | 185 | if (cur_dec > val) |
diff --git a/include/asm-powerpc/todc.h b/include/asm-powerpc/todc.h new file mode 100644 index 000000000000..60a8c39b8c11 --- /dev/null +++ b/include/asm-powerpc/todc.h | |||
@@ -0,0 +1,487 @@ | |||
1 | /* | ||
2 | * Definitions for the M48Txx and mc146818 series of Time of day/Real Time | ||
3 | * Clock chips. | ||
4 | * | ||
5 | * Author: Mark A. Greer <mgreer@mvista.com> | ||
6 | * | ||
7 | * 2001 (c) MontaVista, Software, Inc. This file is licensed under | ||
8 | * the terms of the GNU General Public License version 2. This program | ||
9 | * is licensed "as is" without any warranty of any kind, whether express | ||
10 | * or implied. | ||
11 | */ | ||
12 | |||
13 | /* | ||
14 | * Support for the M48T37/M48T59/.../mc146818 Real Time Clock chips. | ||
15 | * Purpose is to make one generic file that handles all of these chips instead | ||
16 | * of every platform implementing the same code over & over again. | ||
17 | */ | ||
18 | |||
19 | #ifndef __PPC_KERNEL_TODC_H | ||
20 | #define __PPC_KERNEL_TODC_H | ||
21 | |||
22 | typedef struct { | ||
23 | uint rtc_type; /* your particular chip */ | ||
24 | |||
25 | /* | ||
26 | * Following are the addresses of the AS0, AS1, and DATA registers | ||
27 | * of these chips. Note that these are board-specific. | ||
28 | */ | ||
29 | unsigned int nvram_as0; | ||
30 | unsigned int nvram_as1; | ||
31 | unsigned int nvram_data; | ||
32 | |||
33 | /* | ||
34 | * Define bits to stop external set of regs from changing so | ||
35 | * the chip can be read/written reliably. | ||
36 | */ | ||
37 | unsigned char enable_read; | ||
38 | unsigned char enable_write; | ||
39 | |||
40 | /* | ||
41 | * Following is the number of AS0 address bits. This is normally | ||
42 | * 8 but some bad hardware routes address lines incorrectly. | ||
43 | */ | ||
44 | int as0_bits; | ||
45 | |||
46 | int nvram_size; /* Size of NVRAM on chip */ | ||
47 | int sw_flags; /* Software control flags */ | ||
48 | |||
49 | /* Following are the register offsets for the particular chip */ | ||
50 | int year; | ||
51 | int month; | ||
52 | int day_of_month; | ||
53 | int day_of_week; | ||
54 | int hours; | ||
55 | int minutes; | ||
56 | int seconds; | ||
57 | int control_b; | ||
58 | int control_a; | ||
59 | int watchdog; | ||
60 | int interrupts; | ||
61 | int alarm_date; | ||
62 | int alarm_hour; | ||
63 | int alarm_minutes; | ||
64 | int alarm_seconds; | ||
65 | int century; | ||
66 | int flags; | ||
67 | |||
68 | /* | ||
69 | * Some RTC chips have their NVRAM buried behind a addr/data pair of | ||
70 | * regs on the first level/clock registers. The following fields | ||
71 | * are the addresses for those addr/data regs. | ||
72 | */ | ||
73 | int nvram_addr_reg; | ||
74 | int nvram_data_reg; | ||
75 | } todc_info_t; | ||
76 | |||
77 | /* | ||
78 | * Define the types of TODC/RTC variants that are supported in | ||
79 | * arch/ppc/kernel/todc_time.c | ||
80 | * Make a new one of these for any chip somehow differs from what's already | ||
81 | * defined. That way, if you ever need to put in code to touch those | ||
82 | * bits/registers in todc_time.c, you can put it inside an | ||
83 | * 'if (todc_info->rtc_type == TODC_TYPE_XXX)' so you won't break | ||
84 | * anyone else. | ||
85 | */ | ||
86 | #define TODC_TYPE_MK48T35 1 | ||
87 | #define TODC_TYPE_MK48T37 2 | ||
88 | #define TODC_TYPE_MK48T59 3 | ||
89 | #define TODC_TYPE_DS1693 4 /* Dallas DS1693 RTC */ | ||
90 | #define TODC_TYPE_DS1743 5 /* Dallas DS1743 RTC */ | ||
91 | #define TODC_TYPE_DS1746 6 /* Dallas DS1746 RTC */ | ||
92 | #define TODC_TYPE_DS1747 7 /* Dallas DS1747 RTC */ | ||
93 | #define TODC_TYPE_DS1501 8 /* Dallas DS1501 RTC */ | ||
94 | #define TODC_TYPE_DS1643 9 /* Dallas DS1643 RTC */ | ||
95 | #define TODC_TYPE_PC97307 10 /* PC97307 internal RTC */ | ||
96 | #define TODC_TYPE_DS1557 11 /* Dallas DS1557 RTC */ | ||
97 | #define TODC_TYPE_DS17285 12 /* Dallas DS17285 RTC */ | ||
98 | #define TODC_TYPE_DS1553 13 /* Dallas DS1553 RTC */ | ||
99 | #define TODC_TYPE_MC146818 100 /* Leave room for m48txx's */ | ||
100 | |||
101 | /* | ||
102 | * Bit to clear/set to enable reads/writes to the chip | ||
103 | */ | ||
104 | #define TODC_MK48TXX_CNTL_A_R 0x40 | ||
105 | #define TODC_MK48TXX_CNTL_A_W 0x80 | ||
106 | #define TODC_MK48TXX_DAY_CB 0x80 | ||
107 | |||
108 | #define TODC_DS1501_CNTL_B_TE 0x80 | ||
109 | |||
110 | /* | ||
111 | * Define flag bits used by todc routines. | ||
112 | */ | ||
113 | #define TODC_FLAG_2_LEVEL_NVRAM 0x00000001 | ||
114 | |||
115 | /* | ||
116 | * Define the values for the various RTC's that should to into the todc_info | ||
117 | * table. | ||
118 | * Note: The XXX_NVRAM_SIZE, XXX_NVRAM_ADDR_REG, and XXX_NVRAM_DATA_REG only | ||
119 | * matter if XXX_SW_FLAGS has TODC_FLAG_2_LEVEL_NVRAM set. | ||
120 | */ | ||
121 | #define TODC_TYPE_MK48T35_NVRAM_SIZE 0x7ff8 | ||
122 | #define TODC_TYPE_MK48T35_SW_FLAGS 0 | ||
123 | #define TODC_TYPE_MK48T35_YEAR 0x7fff | ||
124 | #define TODC_TYPE_MK48T35_MONTH 0x7ffe | ||
125 | #define TODC_TYPE_MK48T35_DOM 0x7ffd /* Day of Month */ | ||
126 | #define TODC_TYPE_MK48T35_DOW 0x7ffc /* Day of Week */ | ||
127 | #define TODC_TYPE_MK48T35_HOURS 0x7ffb | ||
128 | #define TODC_TYPE_MK48T35_MINUTES 0x7ffa | ||
129 | #define TODC_TYPE_MK48T35_SECONDS 0x7ff9 | ||
130 | #define TODC_TYPE_MK48T35_CNTL_B 0x7ff9 | ||
131 | #define TODC_TYPE_MK48T35_CNTL_A 0x7ff8 | ||
132 | #define TODC_TYPE_MK48T35_WATCHDOG 0x0000 | ||
133 | #define TODC_TYPE_MK48T35_INTERRUPTS 0x0000 | ||
134 | #define TODC_TYPE_MK48T35_ALARM_DATE 0x0000 | ||
135 | #define TODC_TYPE_MK48T35_ALARM_HOUR 0x0000 | ||
136 | #define TODC_TYPE_MK48T35_ALARM_MINUTES 0x0000 | ||
137 | #define TODC_TYPE_MK48T35_ALARM_SECONDS 0x0000 | ||
138 | #define TODC_TYPE_MK48T35_CENTURY 0x0000 | ||
139 | #define TODC_TYPE_MK48T35_FLAGS 0x0000 | ||
140 | #define TODC_TYPE_MK48T35_NVRAM_ADDR_REG 0 | ||
141 | #define TODC_TYPE_MK48T35_NVRAM_DATA_REG 0 | ||
142 | |||
143 | #define TODC_TYPE_MK48T37_NVRAM_SIZE 0x7ff0 | ||
144 | #define TODC_TYPE_MK48T37_SW_FLAGS 0 | ||
145 | #define TODC_TYPE_MK48T37_YEAR 0x7fff | ||
146 | #define TODC_TYPE_MK48T37_MONTH 0x7ffe | ||
147 | #define TODC_TYPE_MK48T37_DOM 0x7ffd /* Day of Month */ | ||
148 | #define TODC_TYPE_MK48T37_DOW 0x7ffc /* Day of Week */ | ||
149 | #define TODC_TYPE_MK48T37_HOURS 0x7ffb | ||
150 | #define TODC_TYPE_MK48T37_MINUTES 0x7ffa | ||
151 | #define TODC_TYPE_MK48T37_SECONDS 0x7ff9 | ||
152 | #define TODC_TYPE_MK48T37_CNTL_B 0x7ff9 | ||
153 | #define TODC_TYPE_MK48T37_CNTL_A 0x7ff8 | ||
154 | #define TODC_TYPE_MK48T37_WATCHDOG 0x7ff7 | ||
155 | #define TODC_TYPE_MK48T37_INTERRUPTS 0x7ff6 | ||
156 | #define TODC_TYPE_MK48T37_ALARM_DATE 0x7ff5 | ||
157 | #define TODC_TYPE_MK48T37_ALARM_HOUR 0x7ff4 | ||
158 | #define TODC_TYPE_MK48T37_ALARM_MINUTES 0x7ff3 | ||
159 | #define TODC_TYPE_MK48T37_ALARM_SECONDS 0x7ff2 | ||
160 | #define TODC_TYPE_MK48T37_CENTURY 0x7ff1 | ||
161 | #define TODC_TYPE_MK48T37_FLAGS 0x7ff0 | ||
162 | #define TODC_TYPE_MK48T37_NVRAM_ADDR_REG 0 | ||
163 | #define TODC_TYPE_MK48T37_NVRAM_DATA_REG 0 | ||
164 | |||
165 | #define TODC_TYPE_MK48T59_NVRAM_SIZE 0x1ff0 | ||
166 | #define TODC_TYPE_MK48T59_SW_FLAGS 0 | ||
167 | #define TODC_TYPE_MK48T59_YEAR 0x1fff | ||
168 | #define TODC_TYPE_MK48T59_MONTH 0x1ffe | ||
169 | #define TODC_TYPE_MK48T59_DOM 0x1ffd /* Day of Month */ | ||
170 | #define TODC_TYPE_MK48T59_DOW 0x1ffc /* Day of Week */ | ||
171 | #define TODC_TYPE_MK48T59_HOURS 0x1ffb | ||
172 | #define TODC_TYPE_MK48T59_MINUTES 0x1ffa | ||
173 | #define TODC_TYPE_MK48T59_SECONDS 0x1ff9 | ||
174 | #define TODC_TYPE_MK48T59_CNTL_B 0x1ff9 | ||
175 | #define TODC_TYPE_MK48T59_CNTL_A 0x1ff8 | ||
176 | #define TODC_TYPE_MK48T59_WATCHDOG 0x1fff | ||
177 | #define TODC_TYPE_MK48T59_INTERRUPTS 0x1fff | ||
178 | #define TODC_TYPE_MK48T59_ALARM_DATE 0x1fff | ||
179 | #define TODC_TYPE_MK48T59_ALARM_HOUR 0x1fff | ||
180 | #define TODC_TYPE_MK48T59_ALARM_MINUTES 0x1fff | ||
181 | #define TODC_TYPE_MK48T59_ALARM_SECONDS 0x1fff | ||
182 | #define TODC_TYPE_MK48T59_CENTURY 0x1fff | ||
183 | #define TODC_TYPE_MK48T59_FLAGS 0x1fff | ||
184 | #define TODC_TYPE_MK48T59_NVRAM_ADDR_REG 0 | ||
185 | #define TODC_TYPE_MK48T59_NVRAM_DATA_REG 0 | ||
186 | |||
187 | #define TODC_TYPE_DS1501_NVRAM_SIZE 0x100 | ||
188 | #define TODC_TYPE_DS1501_SW_FLAGS TODC_FLAG_2_LEVEL_NVRAM | ||
189 | #define TODC_TYPE_DS1501_YEAR (TODC_TYPE_DS1501_NVRAM_SIZE + 0x06) | ||
190 | #define TODC_TYPE_DS1501_MONTH (TODC_TYPE_DS1501_NVRAM_SIZE + 0x05) | ||
191 | #define TODC_TYPE_DS1501_DOM (TODC_TYPE_DS1501_NVRAM_SIZE + 0x04) | ||
192 | #define TODC_TYPE_DS1501_DOW (TODC_TYPE_DS1501_NVRAM_SIZE + 0x03) | ||
193 | #define TODC_TYPE_DS1501_HOURS (TODC_TYPE_DS1501_NVRAM_SIZE + 0x02) | ||
194 | #define TODC_TYPE_DS1501_MINUTES (TODC_TYPE_DS1501_NVRAM_SIZE + 0x01) | ||
195 | #define TODC_TYPE_DS1501_SECONDS (TODC_TYPE_DS1501_NVRAM_SIZE + 0x00) | ||
196 | #define TODC_TYPE_DS1501_CNTL_B (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0f) | ||
197 | #define TODC_TYPE_DS1501_CNTL_A (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0f) | ||
198 | #define TODC_TYPE_DS1501_WATCHDOG (TODC_TYPE_DS1501_NVRAM_SIZE + 0xff) | ||
199 | #define TODC_TYPE_DS1501_INTERRUPTS (TODC_TYPE_DS1501_NVRAM_SIZE + 0xff) | ||
200 | #define TODC_TYPE_DS1501_ALARM_DATE (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0b) | ||
201 | #define TODC_TYPE_DS1501_ALARM_HOUR (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0a) | ||
202 | #define TODC_TYPE_DS1501_ALARM_MINUTES (TODC_TYPE_DS1501_NVRAM_SIZE + 0x09) | ||
203 | #define TODC_TYPE_DS1501_ALARM_SECONDS (TODC_TYPE_DS1501_NVRAM_SIZE + 0x08) | ||
204 | #define TODC_TYPE_DS1501_CENTURY (TODC_TYPE_DS1501_NVRAM_SIZE + 0x07) | ||
205 | #define TODC_TYPE_DS1501_FLAGS (TODC_TYPE_DS1501_NVRAM_SIZE + 0xff) | ||
206 | #define TODC_TYPE_DS1501_NVRAM_ADDR_REG 0x10 | ||
207 | #define TODC_TYPE_DS1501_NVRAM_DATA_REG 0x13 | ||
208 | |||
209 | #define TODC_TYPE_DS1553_NVRAM_SIZE 0x1ff0 | ||
210 | #define TODC_TYPE_DS1553_SW_FLAGS 0 | ||
211 | #define TODC_TYPE_DS1553_YEAR 0x1fff | ||
212 | #define TODC_TYPE_DS1553_MONTH 0x1ffe | ||
213 | #define TODC_TYPE_DS1553_DOM 0x1ffd /* Day of Month */ | ||
214 | #define TODC_TYPE_DS1553_DOW 0x1ffc /* Day of Week */ | ||
215 | #define TODC_TYPE_DS1553_HOURS 0x1ffb | ||
216 | #define TODC_TYPE_DS1553_MINUTES 0x1ffa | ||
217 | #define TODC_TYPE_DS1553_SECONDS 0x1ff9 | ||
218 | #define TODC_TYPE_DS1553_CNTL_B 0x1ff9 | ||
219 | #define TODC_TYPE_DS1553_CNTL_A 0x1ff8 /* control_a R/W regs */ | ||
220 | #define TODC_TYPE_DS1553_WATCHDOG 0x1ff7 | ||
221 | #define TODC_TYPE_DS1553_INTERRUPTS 0x1ff6 | ||
222 | #define TODC_TYPE_DS1553_ALARM_DATE 0x1ff5 | ||
223 | #define TODC_TYPE_DS1553_ALARM_HOUR 0x1ff4 | ||
224 | #define TODC_TYPE_DS1553_ALARM_MINUTES 0x1ff3 | ||
225 | #define TODC_TYPE_DS1553_ALARM_SECONDS 0x1ff2 | ||
226 | #define TODC_TYPE_DS1553_CENTURY 0x1ff8 | ||
227 | #define TODC_TYPE_DS1553_FLAGS 0x1ff0 | ||
228 | #define TODC_TYPE_DS1553_NVRAM_ADDR_REG 0 | ||
229 | #define TODC_TYPE_DS1553_NVRAM_DATA_REG 0 | ||
230 | |||
231 | #define TODC_TYPE_DS1557_NVRAM_SIZE 0x7fff0 | ||
232 | #define TODC_TYPE_DS1557_SW_FLAGS 0 | ||
233 | #define TODC_TYPE_DS1557_YEAR 0x7ffff | ||
234 | #define TODC_TYPE_DS1557_MONTH 0x7fffe | ||
235 | #define TODC_TYPE_DS1557_DOM 0x7fffd /* Day of Month */ | ||
236 | #define TODC_TYPE_DS1557_DOW 0x7fffc /* Day of Week */ | ||
237 | #define TODC_TYPE_DS1557_HOURS 0x7fffb | ||
238 | #define TODC_TYPE_DS1557_MINUTES 0x7fffa | ||
239 | #define TODC_TYPE_DS1557_SECONDS 0x7fff9 | ||
240 | #define TODC_TYPE_DS1557_CNTL_B 0x7fff9 | ||
241 | #define TODC_TYPE_DS1557_CNTL_A 0x7fff8 /* control_a R/W regs */ | ||
242 | #define TODC_TYPE_DS1557_WATCHDOG 0x7fff7 | ||
243 | #define TODC_TYPE_DS1557_INTERRUPTS 0x7fff6 | ||
244 | #define TODC_TYPE_DS1557_ALARM_DATE 0x7fff5 | ||
245 | #define TODC_TYPE_DS1557_ALARM_HOUR 0x7fff4 | ||
246 | #define TODC_TYPE_DS1557_ALARM_MINUTES 0x7fff3 | ||
247 | #define TODC_TYPE_DS1557_ALARM_SECONDS 0x7fff2 | ||
248 | #define TODC_TYPE_DS1557_CENTURY 0x7fff8 | ||
249 | #define TODC_TYPE_DS1557_FLAGS 0x7fff0 | ||
250 | #define TODC_TYPE_DS1557_NVRAM_ADDR_REG 0 | ||
251 | #define TODC_TYPE_DS1557_NVRAM_DATA_REG 0 | ||
252 | |||
253 | #define TODC_TYPE_DS1643_NVRAM_SIZE 0x1ff8 | ||
254 | #define TODC_TYPE_DS1643_SW_FLAGS 0 | ||
255 | #define TODC_TYPE_DS1643_YEAR 0x1fff | ||
256 | #define TODC_TYPE_DS1643_MONTH 0x1ffe | ||
257 | #define TODC_TYPE_DS1643_DOM 0x1ffd /* Day of Month */ | ||
258 | #define TODC_TYPE_DS1643_DOW 0x1ffc /* Day of Week */ | ||
259 | #define TODC_TYPE_DS1643_HOURS 0x1ffb | ||
260 | #define TODC_TYPE_DS1643_MINUTES 0x1ffa | ||
261 | #define TODC_TYPE_DS1643_SECONDS 0x1ff9 | ||
262 | #define TODC_TYPE_DS1643_CNTL_B 0x1ff9 | ||
263 | #define TODC_TYPE_DS1643_CNTL_A 0x1ff8 /* control_a R/W regs */ | ||
264 | #define TODC_TYPE_DS1643_WATCHDOG 0x1fff | ||
265 | #define TODC_TYPE_DS1643_INTERRUPTS 0x1fff | ||
266 | #define TODC_TYPE_DS1643_ALARM_DATE 0x1fff | ||
267 | #define TODC_TYPE_DS1643_ALARM_HOUR 0x1fff | ||
268 | #define TODC_TYPE_DS1643_ALARM_MINUTES 0x1fff | ||
269 | #define TODC_TYPE_DS1643_ALARM_SECONDS 0x1fff | ||
270 | #define TODC_TYPE_DS1643_CENTURY 0x1ff8 | ||
271 | #define TODC_TYPE_DS1643_FLAGS 0x1fff | ||
272 | #define TODC_TYPE_DS1643_NVRAM_ADDR_REG 0 | ||
273 | #define TODC_TYPE_DS1643_NVRAM_DATA_REG 0 | ||
274 | |||
275 | #define TODC_TYPE_DS1693_NVRAM_SIZE 0 /* Not handled yet */ | ||
276 | #define TODC_TYPE_DS1693_SW_FLAGS 0 | ||
277 | #define TODC_TYPE_DS1693_YEAR 0x09 | ||
278 | #define TODC_TYPE_DS1693_MONTH 0x08 | ||
279 | #define TODC_TYPE_DS1693_DOM 0x07 /* Day of Month */ | ||
280 | #define TODC_TYPE_DS1693_DOW 0x06 /* Day of Week */ | ||
281 | #define TODC_TYPE_DS1693_HOURS 0x04 | ||
282 | #define TODC_TYPE_DS1693_MINUTES 0x02 | ||
283 | #define TODC_TYPE_DS1693_SECONDS 0x00 | ||
284 | #define TODC_TYPE_DS1693_CNTL_B 0x0b | ||
285 | #define TODC_TYPE_DS1693_CNTL_A 0x0a | ||
286 | #define TODC_TYPE_DS1693_WATCHDOG 0xff | ||
287 | #define TODC_TYPE_DS1693_INTERRUPTS 0xff | ||
288 | #define TODC_TYPE_DS1693_ALARM_DATE 0x49 | ||
289 | #define TODC_TYPE_DS1693_ALARM_HOUR 0x05 | ||
290 | #define TODC_TYPE_DS1693_ALARM_MINUTES 0x03 | ||
291 | #define TODC_TYPE_DS1693_ALARM_SECONDS 0x01 | ||
292 | #define TODC_TYPE_DS1693_CENTURY 0x48 | ||
293 | #define TODC_TYPE_DS1693_FLAGS 0xff | ||
294 | #define TODC_TYPE_DS1693_NVRAM_ADDR_REG 0 | ||
295 | #define TODC_TYPE_DS1693_NVRAM_DATA_REG 0 | ||
296 | |||
297 | #define TODC_TYPE_DS1743_NVRAM_SIZE 0x1ff8 | ||
298 | #define TODC_TYPE_DS1743_SW_FLAGS 0 | ||
299 | #define TODC_TYPE_DS1743_YEAR 0x1fff | ||
300 | #define TODC_TYPE_DS1743_MONTH 0x1ffe | ||
301 | #define TODC_TYPE_DS1743_DOM 0x1ffd /* Day of Month */ | ||
302 | #define TODC_TYPE_DS1743_DOW 0x1ffc /* Day of Week */ | ||
303 | #define TODC_TYPE_DS1743_HOURS 0x1ffb | ||
304 | #define TODC_TYPE_DS1743_MINUTES 0x1ffa | ||
305 | #define TODC_TYPE_DS1743_SECONDS 0x1ff9 | ||
306 | #define TODC_TYPE_DS1743_CNTL_B 0x1ff9 | ||
307 | #define TODC_TYPE_DS1743_CNTL_A 0x1ff8 /* control_a R/W regs */ | ||
308 | #define TODC_TYPE_DS1743_WATCHDOG 0x1fff | ||
309 | #define TODC_TYPE_DS1743_INTERRUPTS 0x1fff | ||
310 | #define TODC_TYPE_DS1743_ALARM_DATE 0x1fff | ||
311 | #define TODC_TYPE_DS1743_ALARM_HOUR 0x1fff | ||
312 | #define TODC_TYPE_DS1743_ALARM_MINUTES 0x1fff | ||
313 | #define TODC_TYPE_DS1743_ALARM_SECONDS 0x1fff | ||
314 | #define TODC_TYPE_DS1743_CENTURY 0x1ff8 | ||
315 | #define TODC_TYPE_DS1743_FLAGS 0x1fff | ||
316 | #define TODC_TYPE_DS1743_NVRAM_ADDR_REG 0 | ||
317 | #define TODC_TYPE_DS1743_NVRAM_DATA_REG 0 | ||
318 | |||
319 | #define TODC_TYPE_DS1746_NVRAM_SIZE 0x1fff8 | ||
320 | #define TODC_TYPE_DS1746_SW_FLAGS 0 | ||
321 | #define TODC_TYPE_DS1746_YEAR 0x1ffff | ||
322 | #define TODC_TYPE_DS1746_MONTH 0x1fffe | ||
323 | #define TODC_TYPE_DS1746_DOM 0x1fffd /* Day of Month */ | ||
324 | #define TODC_TYPE_DS1746_DOW 0x1fffc /* Day of Week */ | ||
325 | #define TODC_TYPE_DS1746_HOURS 0x1fffb | ||
326 | #define TODC_TYPE_DS1746_MINUTES 0x1fffa | ||
327 | #define TODC_TYPE_DS1746_SECONDS 0x1fff9 | ||
328 | #define TODC_TYPE_DS1746_CNTL_B 0x1fff9 | ||
329 | #define TODC_TYPE_DS1746_CNTL_A 0x1fff8 /* control_a R/W regs */ | ||
330 | #define TODC_TYPE_DS1746_WATCHDOG 0x00000 | ||
331 | #define TODC_TYPE_DS1746_INTERRUPTS 0x00000 | ||
332 | #define TODC_TYPE_DS1746_ALARM_DATE 0x00000 | ||
333 | #define TODC_TYPE_DS1746_ALARM_HOUR 0x00000 | ||
334 | #define TODC_TYPE_DS1746_ALARM_MINUTES 0x00000 | ||
335 | #define TODC_TYPE_DS1746_ALARM_SECONDS 0x00000 | ||
336 | #define TODC_TYPE_DS1746_CENTURY 0x00000 | ||
337 | #define TODC_TYPE_DS1746_FLAGS 0x00000 | ||
338 | #define TODC_TYPE_DS1746_NVRAM_ADDR_REG 0 | ||
339 | #define TODC_TYPE_DS1746_NVRAM_DATA_REG 0 | ||
340 | |||
341 | #define TODC_TYPE_DS1747_NVRAM_SIZE 0x7fff8 | ||
342 | #define TODC_TYPE_DS1747_SW_FLAGS 0 | ||
343 | #define TODC_TYPE_DS1747_YEAR 0x7ffff | ||
344 | #define TODC_TYPE_DS1747_MONTH 0x7fffe | ||
345 | #define TODC_TYPE_DS1747_DOM 0x7fffd /* Day of Month */ | ||
346 | #define TODC_TYPE_DS1747_DOW 0x7fffc /* Day of Week */ | ||
347 | #define TODC_TYPE_DS1747_HOURS 0x7fffb | ||
348 | #define TODC_TYPE_DS1747_MINUTES 0x7fffa | ||
349 | #define TODC_TYPE_DS1747_SECONDS 0x7fff9 | ||
350 | #define TODC_TYPE_DS1747_CNTL_B 0x7fff9 | ||
351 | #define TODC_TYPE_DS1747_CNTL_A 0x7fff8 /* control_a R/W regs */ | ||
352 | #define TODC_TYPE_DS1747_WATCHDOG 0x00000 | ||
353 | #define TODC_TYPE_DS1747_INTERRUPTS 0x00000 | ||
354 | #define TODC_TYPE_DS1747_ALARM_DATE 0x00000 | ||
355 | #define TODC_TYPE_DS1747_ALARM_HOUR 0x00000 | ||
356 | #define TODC_TYPE_DS1747_ALARM_MINUTES 0x00000 | ||
357 | #define TODC_TYPE_DS1747_ALARM_SECONDS 0x00000 | ||
358 | #define TODC_TYPE_DS1747_CENTURY 0x00000 | ||
359 | #define TODC_TYPE_DS1747_FLAGS 0x00000 | ||
360 | #define TODC_TYPE_DS1747_NVRAM_ADDR_REG 0 | ||
361 | #define TODC_TYPE_DS1747_NVRAM_DATA_REG 0 | ||
362 | |||
363 | #define TODC_TYPE_DS17285_NVRAM_SIZE (0x1000-0x80) /* 4Kx8 NVRAM (minus RTC regs) */ | ||
364 | #define TODC_TYPE_DS17285_SW_FLAGS TODC_FLAG_2_LEVEL_NVRAM | ||
365 | #define TODC_TYPE_DS17285_SECONDS (TODC_TYPE_DS17285_NVRAM_SIZE + 0x00) | ||
366 | #define TODC_TYPE_DS17285_ALARM_SECONDS (TODC_TYPE_DS17285_NVRAM_SIZE + 0x01) | ||
367 | #define TODC_TYPE_DS17285_MINUTES (TODC_TYPE_DS17285_NVRAM_SIZE + 0x02) | ||
368 | #define TODC_TYPE_DS17285_ALARM_MINUTES (TODC_TYPE_DS17285_NVRAM_SIZE + 0x03) | ||
369 | #define TODC_TYPE_DS17285_HOURS (TODC_TYPE_DS17285_NVRAM_SIZE + 0x04) | ||
370 | #define TODC_TYPE_DS17285_ALARM_HOUR (TODC_TYPE_DS17285_NVRAM_SIZE + 0x05) | ||
371 | #define TODC_TYPE_DS17285_DOW (TODC_TYPE_DS17285_NVRAM_SIZE + 0x06) | ||
372 | #define TODC_TYPE_DS17285_DOM (TODC_TYPE_DS17285_NVRAM_SIZE + 0x07) | ||
373 | #define TODC_TYPE_DS17285_MONTH (TODC_TYPE_DS17285_NVRAM_SIZE + 0x08) | ||
374 | #define TODC_TYPE_DS17285_YEAR (TODC_TYPE_DS17285_NVRAM_SIZE + 0x09) | ||
375 | #define TODC_TYPE_DS17285_CNTL_A (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0A) | ||
376 | #define TODC_TYPE_DS17285_CNTL_B (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0B) | ||
377 | #define TODC_TYPE_DS17285_CNTL_C (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0C) | ||
378 | #define TODC_TYPE_DS17285_CNTL_D (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0D) | ||
379 | #define TODC_TYPE_DS17285_WATCHDOG 0 | ||
380 | #define TODC_TYPE_DS17285_INTERRUPTS 0 | ||
381 | #define TODC_TYPE_DS17285_ALARM_DATE 0 | ||
382 | #define TODC_TYPE_DS17285_CENTURY 0 | ||
383 | #define TODC_TYPE_DS17285_FLAGS 0 | ||
384 | #define TODC_TYPE_DS17285_NVRAM_ADDR_REG 0x50 | ||
385 | #define TODC_TYPE_DS17285_NVRAM_DATA_REG 0x53 | ||
386 | |||
387 | #define TODC_TYPE_MC146818_NVRAM_SIZE 0 /* XXXX */ | ||
388 | #define TODC_TYPE_MC146818_SW_FLAGS 0 | ||
389 | #define TODC_TYPE_MC146818_YEAR 0x09 | ||
390 | #define TODC_TYPE_MC146818_MONTH 0x08 | ||
391 | #define TODC_TYPE_MC146818_DOM 0x07 /* Day of Month */ | ||
392 | #define TODC_TYPE_MC146818_DOW 0x06 /* Day of Week */ | ||
393 | #define TODC_TYPE_MC146818_HOURS 0x04 | ||
394 | #define TODC_TYPE_MC146818_MINUTES 0x02 | ||
395 | #define TODC_TYPE_MC146818_SECONDS 0x00 | ||
396 | #define TODC_TYPE_MC146818_CNTL_B 0x0a | ||
397 | #define TODC_TYPE_MC146818_CNTL_A 0x0b /* control_a R/W regs */ | ||
398 | #define TODC_TYPE_MC146818_WATCHDOG 0 | ||
399 | #define TODC_TYPE_MC146818_INTERRUPTS 0x0c | ||
400 | #define TODC_TYPE_MC146818_ALARM_DATE 0xff | ||
401 | #define TODC_TYPE_MC146818_ALARM_HOUR 0x05 | ||
402 | #define TODC_TYPE_MC146818_ALARM_MINUTES 0x03 | ||
403 | #define TODC_TYPE_MC146818_ALARM_SECONDS 0x01 | ||
404 | #define TODC_TYPE_MC146818_CENTURY 0xff | ||
405 | #define TODC_TYPE_MC146818_FLAGS 0xff | ||
406 | #define TODC_TYPE_MC146818_NVRAM_ADDR_REG 0 | ||
407 | #define TODC_TYPE_MC146818_NVRAM_DATA_REG 0 | ||
408 | |||
409 | #define TODC_TYPE_PC97307_NVRAM_SIZE 0 /* No NVRAM? */ | ||
410 | #define TODC_TYPE_PC97307_SW_FLAGS 0 | ||
411 | #define TODC_TYPE_PC97307_YEAR 0x09 | ||
412 | #define TODC_TYPE_PC97307_MONTH 0x08 | ||
413 | #define TODC_TYPE_PC97307_DOM 0x07 /* Day of Month */ | ||
414 | #define TODC_TYPE_PC97307_DOW 0x06 /* Day of Week */ | ||
415 | #define TODC_TYPE_PC97307_HOURS 0x04 | ||
416 | #define TODC_TYPE_PC97307_MINUTES 0x02 | ||
417 | #define TODC_TYPE_PC97307_SECONDS 0x00 | ||
418 | #define TODC_TYPE_PC97307_CNTL_B 0x0a | ||
419 | #define TODC_TYPE_PC97307_CNTL_A 0x0b /* control_a R/W regs */ | ||
420 | #define TODC_TYPE_PC97307_WATCHDOG 0x0c | ||
421 | #define TODC_TYPE_PC97307_INTERRUPTS 0x0d | ||
422 | #define TODC_TYPE_PC97307_ALARM_DATE 0xff | ||
423 | #define TODC_TYPE_PC97307_ALARM_HOUR 0x05 | ||
424 | #define TODC_TYPE_PC97307_ALARM_MINUTES 0x03 | ||
425 | #define TODC_TYPE_PC97307_ALARM_SECONDS 0x01 | ||
426 | #define TODC_TYPE_PC97307_CENTURY 0xff | ||
427 | #define TODC_TYPE_PC97307_FLAGS 0xff | ||
428 | #define TODC_TYPE_PC97307_NVRAM_ADDR_REG 0 | ||
429 | #define TODC_TYPE_PC97307_NVRAM_DATA_REG 0 | ||
430 | |||
431 | /* | ||
432 | * Define macros to allocate and init the todc_info_t table that will | ||
433 | * be used by the todc_time.c routines. | ||
434 | */ | ||
435 | #define TODC_ALLOC() \ | ||
436 | static todc_info_t todc_info_alloc; \ | ||
437 | todc_info_t *todc_info = &todc_info_alloc; | ||
438 | |||
439 | #define TODC_INIT(clock_type, as0, as1, data, bits) { \ | ||
440 | todc_info->rtc_type = clock_type; \ | ||
441 | \ | ||
442 | todc_info->nvram_as0 = (unsigned int)(as0); \ | ||
443 | todc_info->nvram_as1 = (unsigned int)(as1); \ | ||
444 | todc_info->nvram_data = (unsigned int)(data); \ | ||
445 | \ | ||
446 | todc_info->as0_bits = (bits); \ | ||
447 | \ | ||
448 | todc_info->nvram_size = clock_type ##_NVRAM_SIZE; \ | ||
449 | todc_info->sw_flags = clock_type ##_SW_FLAGS; \ | ||
450 | \ | ||
451 | todc_info->year = clock_type ##_YEAR; \ | ||
452 | todc_info->month = clock_type ##_MONTH; \ | ||
453 | todc_info->day_of_month = clock_type ##_DOM; \ | ||
454 | todc_info->day_of_week = clock_type ##_DOW; \ | ||
455 | todc_info->hours = clock_type ##_HOURS; \ | ||
456 | todc_info->minutes = clock_type ##_MINUTES; \ | ||
457 | todc_info->seconds = clock_type ##_SECONDS; \ | ||
458 | todc_info->control_b = clock_type ##_CNTL_B; \ | ||
459 | todc_info->control_a = clock_type ##_CNTL_A; \ | ||
460 | todc_info->watchdog = clock_type ##_WATCHDOG; \ | ||
461 | todc_info->interrupts = clock_type ##_INTERRUPTS; \ | ||
462 | todc_info->alarm_date = clock_type ##_ALARM_DATE; \ | ||
463 | todc_info->alarm_hour = clock_type ##_ALARM_HOUR; \ | ||
464 | todc_info->alarm_minutes = clock_type ##_ALARM_MINUTES; \ | ||
465 | todc_info->alarm_seconds = clock_type ##_ALARM_SECONDS; \ | ||
466 | todc_info->century = clock_type ##_CENTURY; \ | ||
467 | todc_info->flags = clock_type ##_FLAGS; \ | ||
468 | \ | ||
469 | todc_info->nvram_addr_reg = clock_type ##_NVRAM_ADDR_REG; \ | ||
470 | todc_info->nvram_data_reg = clock_type ##_NVRAM_DATA_REG; \ | ||
471 | } | ||
472 | |||
473 | extern todc_info_t *todc_info; | ||
474 | |||
475 | unsigned char todc_direct_read_val(int addr); | ||
476 | void todc_direct_write_val(int addr, unsigned char val); | ||
477 | unsigned char todc_m48txx_read_val(int addr); | ||
478 | void todc_m48txx_write_val(int addr, unsigned char val); | ||
479 | unsigned char todc_mc146818_read_val(int addr); | ||
480 | void todc_mc146818_write_val(int addr, unsigned char val); | ||
481 | |||
482 | long todc_time_init(void); | ||
483 | void todc_get_rtc_time(struct rtc_time *); | ||
484 | int todc_set_rtc_time(struct rtc_time *); | ||
485 | void todc_calibrate_decr(void); | ||
486 | |||
487 | #endif /* __PPC_KERNEL_TODC_H */ | ||
diff --git a/include/asm-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h new file mode 100644 index 000000000000..c4c278d72f71 --- /dev/null +++ b/include/asm-powerpc/tsi108.h | |||
@@ -0,0 +1,109 @@ | |||
1 | /* | ||
2 | * include/asm-ppc/tsi108.h | ||
3 | * | ||
4 | * common routine and memory layout for Tundra TSI108(Grendel) host bridge | ||
5 | * memory controller. | ||
6 | * | ||
7 | * Author: Jacob Pan (jacob.pan@freescale.com) | ||
8 | * Alex Bounine (alexandreb@tundra.com) | ||
9 | * 2004 (c) Freescale Semiconductor Inc. This file is licensed under | ||
10 | * the terms of the GNU General Public License version 2. This program | ||
11 | * is licensed "as is" without any warranty of any kind, whether express | ||
12 | * or implied. | ||
13 | */ | ||
14 | #ifndef __PPC_KERNEL_TSI108_H | ||
15 | #define __PPC_KERNEL_TSI108_H | ||
16 | |||
17 | #include <asm/pci-bridge.h> | ||
18 | |||
19 | /* Size of entire register space */ | ||
20 | #define TSI108_REG_SIZE (0x10000) | ||
21 | |||
22 | /* Sizes of register spaces for individual blocks */ | ||
23 | #define TSI108_HLP_SIZE 0x1000 | ||
24 | #define TSI108_PCI_SIZE 0x1000 | ||
25 | #define TSI108_CLK_SIZE 0x1000 | ||
26 | #define TSI108_PB_SIZE 0x1000 | ||
27 | #define TSI108_SD_SIZE 0x1000 | ||
28 | #define TSI108_DMA_SIZE 0x1000 | ||
29 | #define TSI108_ETH_SIZE 0x1000 | ||
30 | #define TSI108_I2C_SIZE 0x400 | ||
31 | #define TSI108_MPIC_SIZE 0x400 | ||
32 | #define TSI108_UART0_SIZE 0x200 | ||
33 | #define TSI108_GPIO_SIZE 0x200 | ||
34 | #define TSI108_UART1_SIZE 0x200 | ||
35 | |||
36 | /* Offsets within Tsi108(A) CSR space for individual blocks */ | ||
37 | #define TSI108_HLP_OFFSET 0x0000 | ||
38 | #define TSI108_PCI_OFFSET 0x1000 | ||
39 | #define TSI108_CLK_OFFSET 0x2000 | ||
40 | #define TSI108_PB_OFFSET 0x3000 | ||
41 | #define TSI108_SD_OFFSET 0x4000 | ||
42 | #define TSI108_DMA_OFFSET 0x5000 | ||
43 | #define TSI108_ETH_OFFSET 0x6000 | ||
44 | #define TSI108_I2C_OFFSET 0x7000 | ||
45 | #define TSI108_MPIC_OFFSET 0x7400 | ||
46 | #define TSI108_UART0_OFFSET 0x7800 | ||
47 | #define TSI108_GPIO_OFFSET 0x7A00 | ||
48 | #define TSI108_UART1_OFFSET 0x7C00 | ||
49 | |||
50 | /* Tsi108 registers used by common code components */ | ||
51 | #define TSI108_PCI_CSR (0x004) | ||
52 | #define TSI108_PCI_IRP_CFG_CTL (0x180) | ||
53 | #define TSI108_PCI_IRP_STAT (0x184) | ||
54 | #define TSI108_PCI_IRP_ENABLE (0x188) | ||
55 | #define TSI108_PCI_IRP_INTAD (0x18C) | ||
56 | |||
57 | #define TSI108_PCI_IRP_STAT_P_INT (0x00400000) | ||
58 | #define TSI108_PCI_IRP_ENABLE_P_INT (0x00400000) | ||
59 | |||
60 | #define TSI108_CG_PWRUP_STATUS (0x234) | ||
61 | |||
62 | #define TSI108_PB_ISR (0x00C) | ||
63 | #define TSI108_PB_ERRCS (0x404) | ||
64 | #define TSI108_PB_AERR (0x408) | ||
65 | |||
66 | #define TSI108_PB_ERRCS_ES (1 << 1) | ||
67 | #define TSI108_PB_ISR_PBS_RD_ERR (1 << 8) | ||
68 | |||
69 | #define TSI108_PCI_CFG_BASE_PHYS (0xfb000000) | ||
70 | #define TSI108_PCI_CFG_SIZE (0x01000000) | ||
71 | /* Global variables */ | ||
72 | |||
73 | extern u32 tsi108_pci_cfg_base; | ||
74 | /* Exported functions */ | ||
75 | |||
76 | extern int tsi108_bridge_init(struct pci_controller *hose, uint phys_csr_base); | ||
77 | extern unsigned long tsi108_get_mem_size(void); | ||
78 | extern unsigned long tsi108_get_cpu_clk(void); | ||
79 | extern unsigned long tsi108_get_sdc_clk(void); | ||
80 | extern int tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfn, | ||
81 | int offset, int len, u32 val); | ||
82 | extern int tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, | ||
83 | int offset, int len, u32 * val); | ||
84 | extern void tsi108_clear_pci_error(u32 pci_cfg_base); | ||
85 | |||
86 | extern phys_addr_t get_csrbase(void); | ||
87 | |||
88 | typedef struct { | ||
89 | u32 regs; /* hw registers base address */ | ||
90 | u32 phyregs; /* phy registers base address */ | ||
91 | u16 phy; /* phy address */ | ||
92 | u16 irq_num; /* irq number */ | ||
93 | u8 mac_addr[6]; /* phy mac address */ | ||
94 | } hw_info; | ||
95 | |||
96 | extern u32 get_vir_csrbase(void); | ||
97 | extern u32 tsi108_csr_vir_base; | ||
98 | |||
99 | extern inline u32 tsi108_read_reg(u32 reg_offset) | ||
100 | { | ||
101 | return in_be32((volatile u32 *)(tsi108_csr_vir_base + reg_offset)); | ||
102 | } | ||
103 | |||
104 | extern inline void tsi108_write_reg(u32 reg_offset, u32 val) | ||
105 | { | ||
106 | out_be32((volatile u32 *)(tsi108_csr_vir_base + reg_offset), val); | ||
107 | } | ||
108 | |||
109 | #endif /* __PPC_KERNEL_TSI108_H */ | ||
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h index 19a1517ac43b..55e57844fa78 100644 --- a/include/asm-powerpc/udbg.h +++ b/include/asm-powerpc/udbg.h | |||
@@ -42,7 +42,8 @@ extern void __init udbg_init_debug_lpar(void); | |||
42 | extern void __init udbg_init_pmac_realmode(void); | 42 | extern void __init udbg_init_pmac_realmode(void); |
43 | extern void __init udbg_init_maple_realmode(void); | 43 | extern void __init udbg_init_maple_realmode(void); |
44 | extern void __init udbg_init_iseries(void); | 44 | extern void __init udbg_init_iseries(void); |
45 | extern void __init udbg_init_rtas(void); | 45 | extern void __init udbg_init_rtas_panel(void); |
46 | extern void __init udbg_init_rtas_console(void); | ||
46 | 47 | ||
47 | #endif /* __KERNEL__ */ | 48 | #endif /* __KERNEL__ */ |
48 | #endif /* _ASM_POWERPC_UDBG_H */ | 49 | #endif /* _ASM_POWERPC_UDBG_H */ |
diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h index 2ba191eba448..d3963ca79ad8 100644 --- a/include/asm-ppc/floppy.h +++ b/include/asm-ppc/floppy.h | |||
@@ -96,11 +96,11 @@ static int vdma_get_dma_residue(unsigned int dummy) | |||
96 | static int fd_request_irq(void) | 96 | static int fd_request_irq(void) |
97 | { | 97 | { |
98 | if (can_use_virtual_dma) | 98 | if (can_use_virtual_dma) |
99 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 99 | return request_irq(FLOPPY_IRQ, floppy_hardint, |
100 | "floppy", NULL); | 100 | IRQF_DISABLED, "floppy", NULL); |
101 | else | 101 | else |
102 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, | 102 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
103 | "floppy", NULL); | 103 | IRQF_DISABLED, "floppy", NULL); |
104 | } | 104 | } |
105 | 105 | ||
106 | static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) | 106 | static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) |
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h index 3be5d760ffcd..16dbc7d17450 100644 --- a/include/asm-ppc/ocp.h +++ b/include/asm-ppc/ocp.h | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/list.h> | 28 | #include <linux/list.h> |
29 | #include <linux/devfs_fs_kernel.h> | ||
30 | #include <linux/device.h> | 29 | #include <linux/device.h> |
31 | 30 | ||
32 | #include <asm/mmu.h> | 31 | #include <asm/mmu.h> |
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index 0b19af82507f..fe95c8258cf9 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h | |||
@@ -170,7 +170,7 @@ extern __inline__ int get_order(unsigned long size) | |||
170 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 170 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
171 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 171 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
172 | 172 | ||
173 | /* We do define AT_SYSINFO_EHDR but don't use the gate mecanism */ | 173 | /* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */ |
174 | #define __HAVE_ARCH_GATE_AREA 1 | 174 | #define __HAVE_ARCH_GATE_AREA 1 |
175 | 175 | ||
176 | #include <asm-generic/memory_model.h> | 176 | #include <asm-generic/memory_model.h> |
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 61434edbad7b..11ffaaa5da16 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h | |||
@@ -133,7 +133,7 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file, | |||
133 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER | 133 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER |
134 | extern void pci_resource_to_user(const struct pci_dev *dev, int bar, | 134 | extern void pci_resource_to_user(const struct pci_dev *dev, int bar, |
135 | const struct resource *rsrc, | 135 | const struct resource *rsrc, |
136 | u64 *start, u64 *end); | 136 | resource_size_t *start, resource_size_t *end); |
137 | 137 | ||
138 | 138 | ||
139 | #endif /* __KERNEL__ */ | 139 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-s390/Kbuild b/include/asm-s390/Kbuild new file mode 100644 index 000000000000..ed8955f49e47 --- /dev/null +++ b/include/asm-s390/Kbuild | |||
@@ -0,0 +1,4 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | unifdef-y += cmb.h debug.h | ||
4 | header-y += dasd.h qeth.h tape390.h ucontext.h vtoc.h z90crypt.h | ||
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index 4d2b126ba159..0ddcdba79e4a 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h | |||
@@ -12,6 +12,9 @@ | |||
12 | * Copyright (C) 1992, Linus Torvalds | 12 | * Copyright (C) 1992, Linus Torvalds |
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | |||
15 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
16 | 19 | ||
17 | /* | 20 | /* |
@@ -50,19 +53,6 @@ | |||
50 | * with operation of the form "set_bit(bitnr, flags)". | 53 | * with operation of the form "set_bit(bitnr, flags)". |
51 | */ | 54 | */ |
52 | 55 | ||
53 | /* set ALIGN_CS to 1 if the SMP safe bit operations should | ||
54 | * align the address to 4 byte boundary. It seems to work | ||
55 | * without the alignment. | ||
56 | */ | ||
57 | #ifdef __KERNEL__ | ||
58 | #define ALIGN_CS 0 | ||
59 | #else | ||
60 | #define ALIGN_CS 1 | ||
61 | #ifndef CONFIG_SMP | ||
62 | #error "bitops won't work without CONFIG_SMP" | ||
63 | #endif | ||
64 | #endif | ||
65 | |||
66 | /* bitmap tables from arch/S390/kernel/bitmap.S */ | 56 | /* bitmap tables from arch/S390/kernel/bitmap.S */ |
67 | extern const char _oi_bitmap[]; | 57 | extern const char _oi_bitmap[]; |
68 | extern const char _ni_bitmap[]; | 58 | extern const char _ni_bitmap[]; |
@@ -121,10 +111,6 @@ static inline void set_bit_cs(unsigned long nr, volatile unsigned long *ptr) | |||
121 | unsigned long addr, old, new, mask; | 111 | unsigned long addr, old, new, mask; |
122 | 112 | ||
123 | addr = (unsigned long) ptr; | 113 | addr = (unsigned long) ptr; |
124 | #if ALIGN_CS == 1 | ||
125 | nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ | ||
126 | addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ | ||
127 | #endif | ||
128 | /* calculate address for CS */ | 114 | /* calculate address for CS */ |
129 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; | 115 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; |
130 | /* make OR mask */ | 116 | /* make OR mask */ |
@@ -141,10 +127,6 @@ static inline void clear_bit_cs(unsigned long nr, volatile unsigned long *ptr) | |||
141 | unsigned long addr, old, new, mask; | 127 | unsigned long addr, old, new, mask; |
142 | 128 | ||
143 | addr = (unsigned long) ptr; | 129 | addr = (unsigned long) ptr; |
144 | #if ALIGN_CS == 1 | ||
145 | nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ | ||
146 | addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ | ||
147 | #endif | ||
148 | /* calculate address for CS */ | 130 | /* calculate address for CS */ |
149 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; | 131 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; |
150 | /* make AND mask */ | 132 | /* make AND mask */ |
@@ -161,10 +143,6 @@ static inline void change_bit_cs(unsigned long nr, volatile unsigned long *ptr) | |||
161 | unsigned long addr, old, new, mask; | 143 | unsigned long addr, old, new, mask; |
162 | 144 | ||
163 | addr = (unsigned long) ptr; | 145 | addr = (unsigned long) ptr; |
164 | #if ALIGN_CS == 1 | ||
165 | nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ | ||
166 | addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ | ||
167 | #endif | ||
168 | /* calculate address for CS */ | 146 | /* calculate address for CS */ |
169 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; | 147 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; |
170 | /* make XOR mask */ | 148 | /* make XOR mask */ |
@@ -182,10 +160,6 @@ test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr) | |||
182 | unsigned long addr, old, new, mask; | 160 | unsigned long addr, old, new, mask; |
183 | 161 | ||
184 | addr = (unsigned long) ptr; | 162 | addr = (unsigned long) ptr; |
185 | #if ALIGN_CS == 1 | ||
186 | nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ | ||
187 | addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ | ||
188 | #endif | ||
189 | /* calculate address for CS */ | 163 | /* calculate address for CS */ |
190 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; | 164 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; |
191 | /* make OR/test mask */ | 165 | /* make OR/test mask */ |
@@ -205,10 +179,6 @@ test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr) | |||
205 | unsigned long addr, old, new, mask; | 179 | unsigned long addr, old, new, mask; |
206 | 180 | ||
207 | addr = (unsigned long) ptr; | 181 | addr = (unsigned long) ptr; |
208 | #if ALIGN_CS == 1 | ||
209 | nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ | ||
210 | addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ | ||
211 | #endif | ||
212 | /* calculate address for CS */ | 182 | /* calculate address for CS */ |
213 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; | 183 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; |
214 | /* make AND/test mask */ | 184 | /* make AND/test mask */ |
@@ -228,10 +198,6 @@ test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr) | |||
228 | unsigned long addr, old, new, mask; | 198 | unsigned long addr, old, new, mask; |
229 | 199 | ||
230 | addr = (unsigned long) ptr; | 200 | addr = (unsigned long) ptr; |
231 | #if ALIGN_CS == 1 | ||
232 | nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ | ||
233 | addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ | ||
234 | #endif | ||
235 | /* calculate address for CS */ | 201 | /* calculate address for CS */ |
236 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; | 202 | addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; |
237 | /* make XOR/test mask */ | 203 | /* make XOR/test mask */ |
@@ -834,8 +800,6 @@ static inline int sched_find_first_bit(unsigned long *b) | |||
834 | 800 | ||
835 | #include <asm-generic/bitops/hweight.h> | 801 | #include <asm-generic/bitops/hweight.h> |
836 | 802 | ||
837 | #ifdef __KERNEL__ | ||
838 | |||
839 | /* | 803 | /* |
840 | * ATTENTION: intel byte ordering convention for ext2 and minix !! | 804 | * ATTENTION: intel byte ordering convention for ext2 and minix !! |
841 | * bit 0 is the LSB of addr; bit 31 is the MSB of addr; | 805 | * bit 0 is the LSB of addr; bit 31 is the MSB of addr; |
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h index 7ddaa05b98d8..876898363944 100644 --- a/include/asm-s390/bug.h +++ b/include/asm-s390/bug.h | |||
@@ -5,9 +5,18 @@ | |||
5 | 5 | ||
6 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
7 | 7 | ||
8 | static inline __attribute__((noreturn)) void __do_illegal_op(void) | ||
9 | { | ||
10 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) | ||
11 | __builtin_trap(); | ||
12 | #else | ||
13 | asm volatile(".long 0"); | ||
14 | #endif | ||
15 | } | ||
16 | |||
8 | #define BUG() do { \ | 17 | #define BUG() do { \ |
9 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | 18 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ |
10 | __builtin_trap(); \ | 19 | __do_illegal_op(); \ |
11 | } while (0) | 20 | } while (0) |
12 | 21 | ||
13 | #define HAVE_ARCH_BUG | 22 | #define HAVE_ARCH_BUG |
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h index 12456cb2f882..58c70acffc73 100644 --- a/include/asm-s390/ccwdev.h +++ b/include/asm-s390/ccwdev.h | |||
@@ -63,7 +63,7 @@ ccw_device_id_match(const struct ccw_device_id *array, | |||
63 | return id; | 63 | return id; |
64 | } | 64 | } |
65 | 65 | ||
66 | return 0; | 66 | return NULL; |
67 | } | 67 | } |
68 | 68 | ||
69 | /* The struct ccw device is our replacement for the globally accessible | 69 | /* The struct ccw device is our replacement for the globally accessible |
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h index 089cf567c317..28fdd6e2b8ba 100644 --- a/include/asm-s390/cio.h +++ b/include/asm-s390/cio.h | |||
@@ -276,6 +276,10 @@ extern void wait_cons_dev(void); | |||
276 | 276 | ||
277 | extern void clear_all_subchannels(void); | 277 | extern void clear_all_subchannels(void); |
278 | 278 | ||
279 | extern void cio_reset_channel_paths(void); | ||
280 | |||
281 | extern void css_schedule_reprobe(void); | ||
282 | |||
279 | #endif | 283 | #endif |
280 | 284 | ||
281 | #endif | 285 | #endif |
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h index 2d09950a9c11..241756f80df3 100644 --- a/include/asm-s390/cmb.h +++ b/include/asm-s390/cmb.h | |||
@@ -44,10 +44,6 @@ struct cmbdata { | |||
44 | #define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32) | 44 | #define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32) |
45 | /* enable channel measurement */ | 45 | /* enable channel measurement */ |
46 | #define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33) | 46 | #define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33) |
47 | /* reset channel measurement block */ | ||
48 | #define BIODASDRESETCMB _IO(DASD_IOCTL_LETTER,34) | ||
49 | /* read channel measurement data */ | ||
50 | #define BIODASDREADCMB _IOWR(DASD_IOCTL_LETTER,32,__u64) | ||
51 | /* read channel measurement data */ | 47 | /* read channel measurement data */ |
52 | #define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) | 48 | #define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) |
53 | 49 | ||
diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h index 1630c26e8f45..c042f9578081 100644 --- a/include/asm-s390/dasd.h +++ b/include/asm-s390/dasd.h | |||
@@ -68,10 +68,12 @@ typedef struct dasd_information2_t { | |||
68 | * 0x00: default features | 68 | * 0x00: default features |
69 | * 0x01: readonly (ro) | 69 | * 0x01: readonly (ro) |
70 | * 0x02: use diag discipline (diag) | 70 | * 0x02: use diag discipline (diag) |
71 | * 0x04: set the device initially online (internal use only) | ||
71 | */ | 72 | */ |
72 | #define DASD_FEATURE_DEFAULT 0 | 73 | #define DASD_FEATURE_DEFAULT 0x00 |
73 | #define DASD_FEATURE_READONLY 1 | 74 | #define DASD_FEATURE_READONLY 0x01 |
74 | #define DASD_FEATURE_USEDIAG 2 | 75 | #define DASD_FEATURE_USEDIAG 0x02 |
76 | #define DASD_FEATURE_INITIAL_ONLINE 0x04 | ||
75 | 77 | ||
76 | #define DASD_PARTN_BITS 2 | 78 | #define DASD_PARTN_BITS 2 |
77 | 79 | ||
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h index 1802775568b9..ffedf14f89f6 100644 --- a/include/asm-s390/futex.h +++ b/include/asm-s390/futex.h | |||
@@ -98,9 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | |||
98 | 98 | ||
99 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | 99 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) |
100 | return -EFAULT; | 100 | return -EFAULT; |
101 | asm volatile(" cs %1,%4,0(%5)\n" | 101 | asm volatile(" sacf 256\n" |
102 | " cs %1,%4,0(%5)\n" | ||
102 | "0: lr %0,%1\n" | 103 | "0: lr %0,%1\n" |
103 | "1:\n" | 104 | "1: sacf 0\n" |
104 | #ifndef __s390x__ | 105 | #ifndef __s390x__ |
105 | ".section __ex_table,\"a\"\n" | 106 | ".section __ex_table,\"a\"\n" |
106 | " .align 4\n" | 107 | " .align 4\n" |
diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h new file mode 100644 index 000000000000..3b566a5b3cc7 --- /dev/null +++ b/include/asm-s390/irqflags.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * include/asm-s390/irqflags.h | ||
3 | * | ||
4 | * Copyright (C) IBM Corp. 2006 | ||
5 | * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_IRQFLAGS_H | ||
9 | #define __ASM_IRQFLAGS_H | ||
10 | |||
11 | #ifdef __KERNEL__ | ||
12 | |||
13 | /* interrupt control.. */ | ||
14 | #define raw_local_irq_enable() ({ \ | ||
15 | unsigned long __dummy; \ | ||
16 | __asm__ __volatile__ ( \ | ||
17 | "stosm 0(%1),0x03" \ | ||
18 | : "=m" (__dummy) : "a" (&__dummy) : "memory" ); \ | ||
19 | }) | ||
20 | |||
21 | #define raw_local_irq_disable() ({ \ | ||
22 | unsigned long __flags; \ | ||
23 | __asm__ __volatile__ ( \ | ||
24 | "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \ | ||
25 | __flags; \ | ||
26 | }) | ||
27 | |||
28 | #define raw_local_save_flags(x) \ | ||
29 | do { \ | ||
30 | typecheck(unsigned long, x); \ | ||
31 | __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ); \ | ||
32 | } while (0) | ||
33 | |||
34 | #define raw_local_irq_restore(x) \ | ||
35 | do { \ | ||
36 | typecheck(unsigned long, x); \ | ||
37 | __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory"); \ | ||
38 | } while (0) | ||
39 | |||
40 | #define raw_irqs_disabled() \ | ||
41 | ({ \ | ||
42 | unsigned long flags; \ | ||
43 | raw_local_save_flags(flags); \ | ||
44 | !((flags >> __FLAG_SHIFT) & 3); \ | ||
45 | }) | ||
46 | |||
47 | static inline int raw_irqs_disabled_flags(unsigned long flags) | ||
48 | { | ||
49 | return !((flags >> __FLAG_SHIFT) & 3); | ||
50 | } | ||
51 | |||
52 | /* For spinlocks etc */ | ||
53 | #define raw_local_irq_save(x) ((x) = raw_local_irq_disable()) | ||
54 | |||
55 | #endif /* __KERNEL__ */ | ||
56 | #endif /* __ASM_IRQFLAGS_H */ | ||
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h index d9a8cca9b653..28b3517e787c 100644 --- a/include/asm-s390/percpu.h +++ b/include/asm-s390/percpu.h | |||
@@ -42,6 +42,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
42 | #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) | 42 | #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) |
43 | #define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) | 43 | #define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) |
44 | #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) | 44 | #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) |
45 | #define per_cpu_offset(x) (__per_cpu_offset[x]) | ||
45 | 46 | ||
46 | /* A macro to avoid #include hell... */ | 47 | /* A macro to avoid #include hell... */ |
47 | #define percpu_modcopy(pcpudst, src, size) \ | 48 | #define percpu_modcopy(pcpudst, src, size) \ |
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index 3002fda89d33..a78e853e0dd5 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h | |||
@@ -142,7 +142,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | |||
142 | pte_t *pte = pte_alloc_one_kernel(mm, vmaddr); | 142 | pte_t *pte = pte_alloc_one_kernel(mm, vmaddr); |
143 | if (pte) | 143 | if (pte) |
144 | return virt_to_page(pte); | 144 | return virt_to_page(pte); |
145 | return 0; | 145 | return NULL; |
146 | } | 146 | } |
147 | 147 | ||
148 | static inline void pte_free_kernel(pte_t *pte) | 148 | static inline void pte_free_kernel(pte_t *pte) |
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index 859b5e969826..24312387fa24 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -657,13 +657,6 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) | |||
657 | __pte; \ | 657 | __pte; \ |
658 | }) | 658 | }) |
659 | 659 | ||
660 | #define SetPageUptodate(_page) \ | ||
661 | do { \ | ||
662 | struct page *__page = (_page); \ | ||
663 | if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ | ||
664 | page_test_and_clear_dirty(_page); \ | ||
665 | } while (0) | ||
666 | |||
667 | #ifdef __s390x__ | 660 | #ifdef __s390x__ |
668 | 661 | ||
669 | #define pfn_pmd(pfn, pgprot) \ | 662 | #define pfn_pmd(pfn, pgprot) \ |
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index c5cbc4bd8414..5b71d3731723 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -199,15 +199,13 @@ unsigned long get_wchan(struct task_struct *p); | |||
199 | /* | 199 | /* |
200 | * Give up the time slice of the virtual PU. | 200 | * Give up the time slice of the virtual PU. |
201 | */ | 201 | */ |
202 | #ifndef __s390x__ | 202 | static inline void cpu_relax(void) |
203 | # define cpu_relax() asm volatile ("diag 0,0,68" : : : "memory") | 203 | { |
204 | #else /* __s390x__ */ | 204 | if (MACHINE_HAS_DIAG44) |
205 | # define cpu_relax() \ | 205 | asm volatile ("diag 0,0,68" : : : "memory"); |
206 | do { \ | 206 | else |
207 | if (MACHINE_HAS_DIAG44) \ | 207 | barrier(); |
208 | asm volatile ("diag 0,0,68" : : : "memory"); \ | 208 | } |
209 | } while (0) | ||
210 | #endif /* __s390x__ */ | ||
211 | 209 | ||
212 | /* | 210 | /* |
213 | * Set PSW to specified value. | 211 | * Set PSW to specified value. |
diff --git a/include/asm-s390/rwsem.h b/include/asm-s390/rwsem.h index 0422a085dd56..13ec16965150 100644 --- a/include/asm-s390/rwsem.h +++ b/include/asm-s390/rwsem.h | |||
@@ -61,6 +61,9 @@ struct rw_semaphore { | |||
61 | signed long count; | 61 | signed long count; |
62 | spinlock_t wait_lock; | 62 | spinlock_t wait_lock; |
63 | struct list_head wait_list; | 63 | struct list_head wait_list; |
64 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
65 | struct lockdep_map dep_map; | ||
66 | #endif | ||
64 | }; | 67 | }; |
65 | 68 | ||
66 | #ifndef __s390x__ | 69 | #ifndef __s390x__ |
@@ -80,8 +83,16 @@ struct rw_semaphore { | |||
80 | /* | 83 | /* |
81 | * initialisation | 84 | * initialisation |
82 | */ | 85 | */ |
86 | |||
87 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
88 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } | ||
89 | #else | ||
90 | # define __RWSEM_DEP_MAP_INIT(lockname) | ||
91 | #endif | ||
92 | |||
83 | #define __RWSEM_INITIALIZER(name) \ | 93 | #define __RWSEM_INITIALIZER(name) \ |
84 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) } | 94 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \ |
95 | __RWSEM_DEP_MAP_INIT(name) } | ||
85 | 96 | ||
86 | #define DECLARE_RWSEM(name) \ | 97 | #define DECLARE_RWSEM(name) \ |
87 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 98 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
@@ -93,6 +104,17 @@ static inline void init_rwsem(struct rw_semaphore *sem) | |||
93 | INIT_LIST_HEAD(&sem->wait_list); | 104 | INIT_LIST_HEAD(&sem->wait_list); |
94 | } | 105 | } |
95 | 106 | ||
107 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, | ||
108 | struct lock_class_key *key); | ||
109 | |||
110 | #define init_rwsem(sem) \ | ||
111 | do { \ | ||
112 | static struct lock_class_key __key; \ | ||
113 | \ | ||
114 | __init_rwsem((sem), #sem, &__key); \ | ||
115 | } while (0) | ||
116 | |||
117 | |||
96 | /* | 118 | /* |
97 | * lock for reading | 119 | * lock for reading |
98 | */ | 120 | */ |
@@ -155,7 +177,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) | |||
155 | /* | 177 | /* |
156 | * lock for writing | 178 | * lock for writing |
157 | */ | 179 | */ |
158 | static inline void __down_write(struct rw_semaphore *sem) | 180 | static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) |
159 | { | 181 | { |
160 | signed long old, new, tmp; | 182 | signed long old, new, tmp; |
161 | 183 | ||
@@ -181,6 +203,11 @@ static inline void __down_write(struct rw_semaphore *sem) | |||
181 | rwsem_down_write_failed(sem); | 203 | rwsem_down_write_failed(sem); |
182 | } | 204 | } |
183 | 205 | ||
206 | static inline void __down_write(struct rw_semaphore *sem) | ||
207 | { | ||
208 | __down_write_nested(sem, 0); | ||
209 | } | ||
210 | |||
184 | /* | 211 | /* |
185 | * trylock for writing -- returns 1 if successful, 0 if contention | 212 | * trylock for writing -- returns 1 if successful, 0 if contention |
186 | */ | 213 | */ |
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h index 702cf436698c..32cdc69f39f4 100644 --- a/include/asm-s390/semaphore.h +++ b/include/asm-s390/semaphore.h | |||
@@ -37,7 +37,8 @@ struct semaphore { | |||
37 | 37 | ||
38 | static inline void sema_init (struct semaphore *sem, int val) | 38 | static inline void sema_init (struct semaphore *sem, int val) |
39 | { | 39 | { |
40 | *sem = (struct semaphore) __SEMAPHORE_INITIALIZER((*sem),val); | 40 | atomic_set(&sem->count, val); |
41 | init_waitqueue_head(&sem->wait); | ||
41 | } | 42 | } |
42 | 43 | ||
43 | static inline void init_MUTEX (struct semaphore *sem) | 44 | static inline void init_MUTEX (struct semaphore *sem) |
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h index da3fd4a7bb32..19e31979309a 100644 --- a/include/asm-s390/setup.h +++ b/include/asm-s390/setup.h | |||
@@ -40,15 +40,16 @@ extern unsigned long machine_flags; | |||
40 | #define MACHINE_IS_VM (machine_flags & 1) | 40 | #define MACHINE_IS_VM (machine_flags & 1) |
41 | #define MACHINE_IS_P390 (machine_flags & 4) | 41 | #define MACHINE_IS_P390 (machine_flags & 4) |
42 | #define MACHINE_HAS_MVPG (machine_flags & 16) | 42 | #define MACHINE_HAS_MVPG (machine_flags & 16) |
43 | #define MACHINE_HAS_DIAG44 (machine_flags & 32) | ||
44 | #define MACHINE_HAS_IDTE (machine_flags & 128) | 43 | #define MACHINE_HAS_IDTE (machine_flags & 128) |
45 | 44 | ||
46 | #ifndef __s390x__ | 45 | #ifndef __s390x__ |
47 | #define MACHINE_HAS_IEEE (machine_flags & 2) | 46 | #define MACHINE_HAS_IEEE (machine_flags & 2) |
48 | #define MACHINE_HAS_CSP (machine_flags & 8) | 47 | #define MACHINE_HAS_CSP (machine_flags & 8) |
48 | #define MACHINE_HAS_DIAG44 (1) | ||
49 | #else /* __s390x__ */ | 49 | #else /* __s390x__ */ |
50 | #define MACHINE_HAS_IEEE (1) | 50 | #define MACHINE_HAS_IEEE (1) |
51 | #define MACHINE_HAS_CSP (1) | 51 | #define MACHINE_HAS_CSP (1) |
52 | #define MACHINE_HAS_DIAG44 (machine_flags & 32) | ||
52 | #endif /* __s390x__ */ | 53 | #endif /* __s390x__ */ |
53 | 54 | ||
54 | 55 | ||
diff --git a/include/asm-s390/signal.h b/include/asm-s390/signal.h index 7084626de215..f6cfddb278cb 100644 --- a/include/asm-s390/signal.h +++ b/include/asm-s390/signal.h | |||
@@ -84,7 +84,6 @@ typedef unsigned long sigset_t; | |||
84 | * SA_FLAGS values: | 84 | * SA_FLAGS values: |
85 | * | 85 | * |
86 | * SA_ONSTACK indicates that a registered stack_t will be used. | 86 | * SA_ONSTACK indicates that a registered stack_t will be used. |
87 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
88 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 87 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
89 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 88 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
90 | * SA_RESETHAND clears the handler when the signal is delivered. | 89 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -104,7 +103,6 @@ typedef unsigned long sigset_t; | |||
104 | 103 | ||
105 | #define SA_NOMASK SA_NODEFER | 104 | #define SA_NOMASK SA_NODEFER |
106 | #define SA_ONESHOT SA_RESETHAND | 105 | #define SA_ONESHOT SA_RESETHAND |
107 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
108 | 106 | ||
109 | #define SA_RESTORER 0x04000000 | 107 | #define SA_RESTORER 0x04000000 |
110 | 108 | ||
diff --git a/include/asm-s390/socket.h b/include/asm-s390/socket.h index 15a5298c8744..1778a49a74c5 100644 --- a/include/asm-s390/socket.h +++ b/include/asm-s390/socket.h | |||
@@ -56,5 +56,6 @@ | |||
56 | #define SO_ACCEPTCONN 30 | 56 | #define SO_ACCEPTCONN 30 |
57 | 57 | ||
58 | #define SO_PEERSEC 31 | 58 | #define SO_PEERSEC 31 |
59 | #define SO_PASSSEC 34 | ||
59 | 60 | ||
60 | #endif /* _ASM_SOCKET_H */ | 61 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 71a0732cd518..9ab186ffde23 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h | |||
@@ -301,34 +301,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
301 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 301 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
302 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | 302 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) |
303 | 303 | ||
304 | /* interrupt control.. */ | ||
305 | #define local_irq_enable() ({ \ | ||
306 | unsigned long __dummy; \ | ||
307 | __asm__ __volatile__ ( \ | ||
308 | "stosm 0(%1),0x03" \ | ||
309 | : "=m" (__dummy) : "a" (&__dummy) : "memory" ); \ | ||
310 | }) | ||
311 | |||
312 | #define local_irq_disable() ({ \ | ||
313 | unsigned long __flags; \ | ||
314 | __asm__ __volatile__ ( \ | ||
315 | "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \ | ||
316 | __flags; \ | ||
317 | }) | ||
318 | |||
319 | #define local_save_flags(x) \ | ||
320 | __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ) | ||
321 | |||
322 | #define local_irq_restore(x) \ | ||
323 | __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory") | ||
324 | |||
325 | #define irqs_disabled() \ | ||
326 | ({ \ | ||
327 | unsigned long flags; \ | ||
328 | local_save_flags(flags); \ | ||
329 | !((flags >> __FLAG_SHIFT) & 3); \ | ||
330 | }) | ||
331 | |||
332 | #ifdef __s390x__ | 304 | #ifdef __s390x__ |
333 | 305 | ||
334 | #define __ctl_load(array, low, high) ({ \ | 306 | #define __ctl_load(array, low, high) ({ \ |
@@ -442,8 +414,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
442 | }) | 414 | }) |
443 | #endif /* __s390x__ */ | 415 | #endif /* __s390x__ */ |
444 | 416 | ||
445 | /* For spinlocks etc */ | 417 | #include <linux/irqflags.h> |
446 | #define local_irq_save(x) ((x) = local_irq_disable()) | ||
447 | 418 | ||
448 | /* | 419 | /* |
449 | * Use to set psw mask except for the first byte which | 420 | * Use to set psw mask except for the first byte which |
@@ -482,4 +453,3 @@ extern void (*_machine_power_off)(void); | |||
482 | #endif /* __KERNEL__ */ | 453 | #endif /* __KERNEL__ */ |
483 | 454 | ||
484 | #endif | 455 | #endif |
485 | |||
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h index 8e0c7ed73d03..0a518915bf90 100644 --- a/include/asm-s390/thread_info.h +++ b/include/asm-s390/thread_info.h | |||
@@ -63,6 +63,7 @@ struct thread_info { | |||
63 | .exec_domain = &default_exec_domain, \ | 63 | .exec_domain = &default_exec_domain, \ |
64 | .flags = 0, \ | 64 | .flags = 0, \ |
65 | .cpu = 0, \ | 65 | .cpu = 0, \ |
66 | .preempt_count = 1, \ | ||
66 | .restart_block = { \ | 67 | .restart_block = { \ |
67 | .fn = do_no_restart_syscall, \ | 68 | .fn = do_no_restart_syscall, \ |
68 | }, \ | 69 | }, \ |
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index e21443d3ea1d..aa7a243862e1 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -394,11 +394,9 @@ | |||
394 | 394 | ||
395 | #ifdef __KERNEL__ | 395 | #ifdef __KERNEL__ |
396 | 396 | ||
397 | /* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */ | ||
398 | |||
399 | #define __syscall_return(type, res) \ | 397 | #define __syscall_return(type, res) \ |
400 | do { \ | 398 | do { \ |
401 | if ((unsigned long)(res) >= (unsigned long)(-125)) { \ | 399 | if ((unsigned long)(res) >= (unsigned long)(-4095)) {\ |
402 | errno = -(res); \ | 400 | errno = -(res); \ |
403 | res = -1; \ | 401 | res = -1; \ |
404 | } \ | 402 | } \ |
diff --git a/include/asm-sh/Kbuild b/include/asm-sh/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-sh/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h index 307d9ce9f9ed..dc1ad464fa32 100644 --- a/include/asm-sh/floppy.h +++ b/include/asm-sh/floppy.h | |||
@@ -146,12 +146,11 @@ static int vdma_get_dma_residue(unsigned int dummy) | |||
146 | static int fd_request_irq(void) | 146 | static int fd_request_irq(void) |
147 | { | 147 | { |
148 | if(can_use_virtual_dma) | 148 | if(can_use_virtual_dma) |
149 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 149 | return request_irq(FLOPPY_IRQ, floppy_hardint, |
150 | "floppy", NULL); | 150 | IRQF_DISABLED, "floppy", NULL); |
151 | else | 151 | else |
152 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, | 152 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
153 | "floppy", NULL); | 153 | IRQF_DISABLED, "floppy", NULL); |
154 | |||
155 | } | 154 | } |
156 | 155 | ||
157 | static unsigned long dma_mem_alloc(unsigned long size) | 156 | static unsigned long dma_mem_alloc(unsigned long size) |
diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h index 1d934fb2c581..fed26616967a 100644 --- a/include/asm-sh/hw_irq.h +++ b/include/asm-sh/hw_irq.h | |||
@@ -1,9 +1,4 @@ | |||
1 | #ifndef __ASM_SH_HW_IRQ_H | 1 | #ifndef __ASM_SH_HW_IRQ_H |
2 | #define __ASM_SH_HW_IRQ_H | 2 | #define __ASM_SH_HW_IRQ_H |
3 | 3 | ||
4 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) | ||
5 | { | ||
6 | /* Nothing to do */ | ||
7 | } | ||
8 | |||
9 | #endif /* __ASM_SH_HW_IRQ_H */ | 4 | #endif /* __ASM_SH_HW_IRQ_H */ |
diff --git a/include/asm-sh/mpc1211/keyboard.h b/include/asm-sh/mpc1211/keyboard.h index 5f0b9088c796..71ef4cf4242d 100644 --- a/include/asm-sh/mpc1211/keyboard.h +++ b/include/asm-sh/mpc1211/keyboard.h | |||
@@ -57,7 +57,7 @@ extern unsigned char pckbd_sysrq_xlate[128]; | |||
57 | #define AUX_IRQ 12 | 57 | #define AUX_IRQ 12 |
58 | 58 | ||
59 | #define aux_request_irq(hand, dev_id) \ | 59 | #define aux_request_irq(hand, dev_id) \ |
60 | request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS2 Mouse", dev_id) | 60 | request_irq(AUX_IRQ, hand, IRQF_SHARED, "PS2 Mouse", dev_id) |
61 | 61 | ||
62 | #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id) | 62 | #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id) |
63 | 63 | ||
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index fa5bd2d8803e..eeb0f48bb99e 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define __ASM_SH_PROCESSOR_H | 9 | #define __ASM_SH_PROCESSOR_H |
10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
11 | 11 | ||
12 | #include <linux/compiler.h> | ||
12 | #include <asm/page.h> | 13 | #include <asm/page.h> |
13 | #include <asm/types.h> | 14 | #include <asm/types.h> |
14 | #include <asm/cache.h> | 15 | #include <asm/cache.h> |
@@ -263,7 +264,7 @@ extern unsigned long get_wchan(struct task_struct *p); | |||
263 | #define KSTK_ESP(tsk) ((tsk)->thread.sp) | 264 | #define KSTK_ESP(tsk) ((tsk)->thread.sp) |
264 | 265 | ||
265 | #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") | 266 | #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") |
266 | #define cpu_relax() do { } while (0) | 267 | #define cpu_relax() barrier() |
267 | 268 | ||
268 | #endif /* __KERNEL__ */ | 269 | #endif /* __KERNEL__ */ |
269 | #endif /* __ASM_SH_PROCESSOR_H */ | 270 | #endif /* __ASM_SH_PROCESSOR_H */ |
diff --git a/include/asm-sh/rwsem.h b/include/asm-sh/rwsem.h index 0262d3d1e5e0..9d2aea5e8488 100644 --- a/include/asm-sh/rwsem.h +++ b/include/asm-sh/rwsem.h | |||
@@ -25,24 +25,11 @@ struct rw_semaphore { | |||
25 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 25 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
26 | spinlock_t wait_lock; | 26 | spinlock_t wait_lock; |
27 | struct list_head wait_list; | 27 | struct list_head wait_list; |
28 | #if RWSEM_DEBUG | ||
29 | int debug; | ||
30 | #endif | ||
31 | }; | 28 | }; |
32 | 29 | ||
33 | /* | ||
34 | * initialisation | ||
35 | */ | ||
36 | #if RWSEM_DEBUG | ||
37 | #define __RWSEM_DEBUG_INIT , 0 | ||
38 | #else | ||
39 | #define __RWSEM_DEBUG_INIT /* */ | ||
40 | #endif | ||
41 | |||
42 | #define __RWSEM_INITIALIZER(name) \ | 30 | #define __RWSEM_INITIALIZER(name) \ |
43 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | 31 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ |
44 | LIST_HEAD_INIT((name).wait_list) \ | 32 | LIST_HEAD_INIT((name).wait_list) } |
45 | __RWSEM_DEBUG_INIT } | ||
46 | 33 | ||
47 | #define DECLARE_RWSEM(name) \ | 34 | #define DECLARE_RWSEM(name) \ |
48 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 35 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
@@ -57,9 +44,6 @@ static inline void init_rwsem(struct rw_semaphore *sem) | |||
57 | sem->count = RWSEM_UNLOCKED_VALUE; | 44 | sem->count = RWSEM_UNLOCKED_VALUE; |
58 | spin_lock_init(&sem->wait_lock); | 45 | spin_lock_init(&sem->wait_lock); |
59 | INIT_LIST_HEAD(&sem->wait_list); | 46 | INIT_LIST_HEAD(&sem->wait_list); |
60 | #if RWSEM_DEBUG | ||
61 | sem->debug = 0; | ||
62 | #endif | ||
63 | } | 47 | } |
64 | 48 | ||
65 | /* | 49 | /* |
diff --git a/include/asm-sh/signal.h b/include/asm-sh/signal.h index d6e8eb0e65c7..5c5c1e852089 100644 --- a/include/asm-sh/signal.h +++ b/include/asm-sh/signal.h | |||
@@ -75,7 +75,6 @@ typedef unsigned long sigset_t; | |||
75 | * SA_FLAGS values: | 75 | * SA_FLAGS values: |
76 | * | 76 | * |
77 | * SA_ONSTACK indicates that a registered stack_t will be used. | 77 | * SA_ONSTACK indicates that a registered stack_t will be used. |
78 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
79 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 78 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
80 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
81 | * SA_RESETHAND clears the handler when the signal is delivered. | 80 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -95,7 +94,6 @@ typedef unsigned long sigset_t; | |||
95 | 94 | ||
96 | #define SA_NOMASK SA_NODEFER | 95 | #define SA_NOMASK SA_NODEFER |
97 | #define SA_ONESHOT SA_RESETHAND | 96 | #define SA_ONESHOT SA_RESETHAND |
98 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
99 | 97 | ||
100 | #define SA_RESTORER 0x04000000 | 98 | #define SA_RESTORER 0x04000000 |
101 | 99 | ||
diff --git a/include/asm-sh/socket.h b/include/asm-sh/socket.h index 553904ff9336..ca70362eb563 100644 --- a/include/asm-sh/socket.h +++ b/include/asm-sh/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* __ASM_SH_SOCKET_H */ | 53 | #endif /* __ASM_SH_SOCKET_H */ |
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index b752e5cbb830..ce2e60664a86 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define switch_to(prev, next, last) do { \ | 14 | #define switch_to(prev, next, last) do { \ |
15 | task_t *__last; \ | 15 | struct task_struct *__last; \ |
16 | register unsigned long *__ts1 __asm__ ("r1") = &prev->thread.sp; \ | 16 | register unsigned long *__ts1 __asm__ ("r1") = &prev->thread.sp; \ |
17 | register unsigned long *__ts2 __asm__ ("r2") = &prev->thread.pc; \ | 17 | register unsigned long *__ts2 __asm__ ("r2") = &prev->thread.pc; \ |
18 | register unsigned long *__ts4 __asm__ ("r4") = (unsigned long *)prev; \ | 18 | register unsigned long *__ts4 __asm__ ("r4") = (unsigned long *)prev; \ |
diff --git a/include/asm-sh64/Kbuild b/include/asm-sh64/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-sh64/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-sh64/hw_irq.h b/include/asm-sh64/hw_irq.h index ae718d1f2d6c..ebb39089b0ac 100644 --- a/include/asm-sh64/hw_irq.h +++ b/include/asm-sh64/hw_irq.h | |||
@@ -11,6 +11,5 @@ | |||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | 11 | * Copyright (C) 2000, 2001 Paolo Alberelli |
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | static __inline__ void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) { /* Nothing to do */ } | ||
15 | 14 | ||
16 | #endif /* __ASM_SH64_HW_IRQ_H */ | 15 | #endif /* __ASM_SH64_HW_IRQ_H */ |
diff --git a/include/asm-sh64/keyboard.h b/include/asm-sh64/keyboard.h index 733e2bbe7b8c..1fab96d792bf 100644 --- a/include/asm-sh64/keyboard.h +++ b/include/asm-sh64/keyboard.h | |||
@@ -65,7 +65,7 @@ extern unsigned char pckbd_sysrq_xlate[128]; | |||
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #define aux_request_irq(hand, dev_id) \ | 67 | #define aux_request_irq(hand, dev_id) \ |
68 | request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS2 Mouse", dev_id) | 68 | request_irq(AUX_IRQ, hand, IRQF_SHARED, "PS2 Mouse", dev_id) |
69 | 69 | ||
70 | #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id) | 70 | #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id) |
71 | 71 | ||
diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h index 1bf252dad824..eb2bee4b47b9 100644 --- a/include/asm-sh64/processor.h +++ b/include/asm-sh64/processor.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/cache.h> | 22 | #include <asm/cache.h> |
23 | #include <asm/registers.h> | 23 | #include <asm/registers.h> |
24 | #include <linux/threads.h> | 24 | #include <linux/threads.h> |
25 | #include <linux/compiler.h> | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Default implementation of macro that returns current | 28 | * Default implementation of macro that returns current |
@@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p); | |||
279 | #define KSTK_EIP(tsk) ((tsk)->thread.pc) | 280 | #define KSTK_EIP(tsk) ((tsk)->thread.pc) |
280 | #define KSTK_ESP(tsk) ((tsk)->thread.sp) | 281 | #define KSTK_ESP(tsk) ((tsk)->thread.sp) |
281 | 282 | ||
282 | #define cpu_relax() do { } while (0) | 283 | #define cpu_relax() barrier() |
283 | 284 | ||
284 | #endif /* __ASSEMBLY__ */ | 285 | #endif /* __ASSEMBLY__ */ |
285 | #endif /* __ASM_SH64_PROCESSOR_H */ | 286 | #endif /* __ASM_SH64_PROCESSOR_H */ |
diff --git a/include/asm-sh64/signal.h b/include/asm-sh64/signal.h index 2400dc688a65..a5a28203cb3b 100644 --- a/include/asm-sh64/signal.h +++ b/include/asm-sh64/signal.h | |||
@@ -74,7 +74,6 @@ typedef struct { | |||
74 | * SA_FLAGS values: | 74 | * SA_FLAGS values: |
75 | * | 75 | * |
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | 76 | * SA_ONSTACK indicates that a registered stack_t will be used. |
77 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 77 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
80 | * SA_RESETHAND clears the handler when the signal is delivered. | 79 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -94,7 +93,6 @@ typedef struct { | |||
94 | 93 | ||
95 | #define SA_NOMASK SA_NODEFER | 94 | #define SA_NOMASK SA_NODEFER |
96 | #define SA_ONESHOT SA_RESETHAND | 95 | #define SA_ONESHOT SA_RESETHAND |
97 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
98 | 96 | ||
99 | #define SA_RESTORER 0x04000000 | 97 | #define SA_RESTORER 0x04000000 |
100 | 98 | ||
diff --git a/include/asm-sparc/Kbuild b/include/asm-sparc/Kbuild new file mode 100644 index 000000000000..e2a57fd7abfa --- /dev/null +++ b/include/asm-sparc/Kbuild | |||
@@ -0,0 +1,6 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | unifdef-y += fbio.h perfctr.h psr.h | ||
4 | header-y += apc.h asi.h auxio.h bpp.h head.h ipc.h jsflash.h \ | ||
5 | openpromio.h pbm.h pconf.h pgtsun4.h reg.h traps.h \ | ||
6 | turbosparc.h vfc_ioctls.h winmacro.h | ||
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h index 7a941b800b6b..c53b332c850a 100644 --- a/include/asm-sparc/floppy.h +++ b/include/asm-sparc/floppy.h | |||
@@ -271,7 +271,8 @@ static int sun_fd_request_irq(void) | |||
271 | 271 | ||
272 | if(!once) { | 272 | if(!once) { |
273 | once = 1; | 273 | once = 1; |
274 | error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, SA_INTERRUPT, "floppy"); | 274 | error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, |
275 | IRQF_DISABLED, "floppy"); | ||
275 | return ((error == 0) ? 0 : -1); | 276 | return ((error == 0) ? 0 : -1); |
276 | } else return 0; | 277 | } else return 0; |
277 | } | 278 | } |
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h index 4816d102f918..80ea31f6e17f 100644 --- a/include/asm-sparc/of_device.h +++ b/include/asm-sparc/of_device.h | |||
@@ -4,10 +4,12 @@ | |||
4 | 4 | ||
5 | #include <linux/device.h> | 5 | #include <linux/device.h> |
6 | #include <linux/mod_devicetable.h> | 6 | #include <linux/mod_devicetable.h> |
7 | #include <asm/openprom.h> | ||
7 | #include <asm/prom.h> | 8 | #include <asm/prom.h> |
8 | 9 | ||
9 | extern struct bus_type ebus_bus_type; | 10 | extern struct bus_type ebus_bus_type; |
10 | extern struct bus_type sbus_bus_type; | 11 | extern struct bus_type sbus_bus_type; |
12 | extern struct bus_type of_bus_type; | ||
11 | 13 | ||
12 | /* | 14 | /* |
13 | * The of_device is a kind of "base class" that is a superset of | 15 | * The of_device is a kind of "base class" that is a superset of |
@@ -16,11 +18,25 @@ extern struct bus_type sbus_bus_type; | |||
16 | */ | 18 | */ |
17 | struct of_device | 19 | struct of_device |
18 | { | 20 | { |
19 | struct device_node *node; /* OF device node */ | 21 | struct device_node *node; |
20 | struct device dev; /* Generic device interface */ | 22 | struct device dev; |
23 | struct resource resource[PROMREG_MAX]; | ||
24 | unsigned int irqs[PROMINTR_MAX]; | ||
25 | int num_irqs; | ||
26 | |||
27 | void *sysdata; | ||
28 | |||
29 | int slot; | ||
30 | int portid; | ||
31 | int clock_freq; | ||
21 | }; | 32 | }; |
22 | #define to_of_device(d) container_of(d, struct of_device, dev) | 33 | #define to_of_device(d) container_of(d, struct of_device, dev) |
23 | 34 | ||
35 | extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); | ||
36 | extern void of_iounmap(void __iomem *base, unsigned long size); | ||
37 | |||
38 | extern struct of_device *of_find_device_by_node(struct device_node *); | ||
39 | |||
24 | extern const struct of_device_id *of_match_device( | 40 | extern const struct of_device_id *of_match_device( |
25 | const struct of_device_id *matches, const struct of_device *dev); | 41 | const struct of_device_id *matches, const struct of_device *dev); |
26 | 42 | ||
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h index f9cf44c07164..86c13dccea3d 100644 --- a/include/asm-sparc/prom.h +++ b/include/asm-sparc/prom.h | |||
@@ -25,11 +25,6 @@ | |||
25 | typedef u32 phandle; | 25 | typedef u32 phandle; |
26 | typedef u32 ihandle; | 26 | typedef u32 ihandle; |
27 | 27 | ||
28 | struct interrupt_info { | ||
29 | int line; | ||
30 | int sense; /* +ve/-ve logic, edge or level, etc. */ | ||
31 | }; | ||
32 | |||
33 | struct property { | 28 | struct property { |
34 | char *name; | 29 | char *name; |
35 | int length; | 30 | int length; |
@@ -43,9 +38,6 @@ struct device_node { | |||
43 | char *name; | 38 | char *name; |
44 | char *type; | 39 | char *type; |
45 | phandle node; | 40 | phandle node; |
46 | phandle linux_phandle; | ||
47 | int n_intrs; | ||
48 | struct interrupt_info *intrs; | ||
49 | char *path_component_name; | 41 | char *path_component_name; |
50 | char *full_name; | 42 | char *full_name; |
51 | 43 | ||
@@ -69,6 +61,8 @@ struct device_node { | |||
69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | 61 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) |
70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | 62 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) |
71 | 63 | ||
64 | #define OF_BAD_ADDR ((u64)-1) | ||
65 | |||
72 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | 66 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) |
73 | { | 67 | { |
74 | dn->pde = de; | 68 | dn->pde = de; |
@@ -101,6 +95,8 @@ extern int of_set_property(struct device_node *node, const char *name, void *val | |||
101 | extern int of_getintprop_default(struct device_node *np, | 95 | extern int of_getintprop_default(struct device_node *np, |
102 | const char *name, | 96 | const char *name, |
103 | int def); | 97 | int def); |
98 | extern int of_n_addr_cells(struct device_node *np); | ||
99 | extern int of_n_size_cells(struct device_node *np); | ||
104 | 100 | ||
105 | extern void prom_build_devicetree(void); | 101 | extern void prom_build_devicetree(void); |
106 | 102 | ||
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h index aa9960ad0ca9..0ae5084c427b 100644 --- a/include/asm-sparc/signal.h +++ b/include/asm-sparc/signal.h | |||
@@ -132,16 +132,13 @@ struct sigstack { | |||
132 | * usage of signal stacks by using the (now obsolete) sa_restorer field in | 132 | * usage of signal stacks by using the (now obsolete) sa_restorer field in |
133 | * the sigaction structure as a stack pointer. This is now possible due to | 133 | * the sigaction structure as a stack pointer. This is now possible due to |
134 | * the changes in signal handling. LBT 010493. | 134 | * the changes in signal handling. LBT 010493. |
135 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
136 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 135 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
137 | * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. | ||
138 | */ | 136 | */ |
139 | #define SA_NOCLDSTOP _SV_IGNCHILD | 137 | #define SA_NOCLDSTOP _SV_IGNCHILD |
140 | #define SA_STACK _SV_SSTACK | 138 | #define SA_STACK _SV_SSTACK |
141 | #define SA_ONSTACK _SV_SSTACK | 139 | #define SA_ONSTACK _SV_SSTACK |
142 | #define SA_RESTART _SV_INTR | 140 | #define SA_RESTART _SV_INTR |
143 | #define SA_ONESHOT _SV_RESET | 141 | #define SA_ONESHOT _SV_RESET |
144 | #define SA_INTERRUPT 0x10u | ||
145 | #define SA_NOMASK 0x20u | 142 | #define SA_NOMASK 0x20u |
146 | #define SA_NOCLDWAIT 0x100u | 143 | #define SA_NOCLDWAIT 0x100u |
147 | #define SA_SIGINFO 0x200u | 144 | #define SA_SIGINFO 0x200u |
diff --git a/include/asm-sparc/socket.h b/include/asm-sparc/socket.h index 4e0ce3a35ea9..f6c4e5baf3f7 100644 --- a/include/asm-sparc/socket.h +++ b/include/asm-sparc/socket.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define SCM_TIMESTAMP SO_TIMESTAMP | 48 | #define SCM_TIMESTAMP SO_TIMESTAMP |
49 | 49 | ||
50 | #define SO_PEERSEC 0x001e | 50 | #define SO_PEERSEC 0x001e |
51 | #define SO_PASSSEC 0x001f | ||
51 | 52 | ||
52 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 53 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
53 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 54 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild new file mode 100644 index 000000000000..9284c3cb27ec --- /dev/null +++ b/include/asm-sparc64/Kbuild | |||
@@ -0,0 +1,10 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | ALTARCH := sparc | ||
4 | ARCHDEF := defined __sparc__ && defined __arch64__ | ||
5 | ALTARCHDEF := defined __sparc__ && !defined __arch64__ | ||
6 | |||
7 | unifdef-y += fbio.h perfctr.h | ||
8 | header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h \ | ||
9 | ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h \ | ||
10 | pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h | ||
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index 0f5b89c9323b..27c46fbeebd6 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -160,6 +160,20 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
160 | BUG(); | 160 | BUG(); |
161 | } | 161 | } |
162 | 162 | ||
163 | static inline void | ||
164 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
165 | enum dma_data_direction direction) | ||
166 | { | ||
167 | BUG(); | ||
168 | } | ||
169 | |||
170 | static inline void | ||
171 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
172 | enum dma_data_direction direction) | ||
173 | { | ||
174 | BUG(); | ||
175 | } | ||
176 | |||
163 | #endif /* PCI */ | 177 | #endif /* PCI */ |
164 | 178 | ||
165 | 179 | ||
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index b591d0e8d8f0..abf150038019 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h | |||
@@ -267,7 +267,7 @@ static int sun_fd_request_irq(void) | |||
267 | once = 1; | 267 | once = 1; |
268 | 268 | ||
269 | error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, | 269 | error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, |
270 | SA_INTERRUPT, "floppy", NULL); | 270 | IRQF_DISABLED, "floppy", NULL); |
271 | 271 | ||
272 | return ((error == 0) ? 0 : -1); | 272 | return ((error == 0) ? 0 : -1); |
273 | } | 273 | } |
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h index 024088ef9d27..a62c7b997d66 100644 --- a/include/asm-sparc64/of_device.h +++ b/include/asm-sparc64/of_device.h | |||
@@ -4,11 +4,13 @@ | |||
4 | 4 | ||
5 | #include <linux/device.h> | 5 | #include <linux/device.h> |
6 | #include <linux/mod_devicetable.h> | 6 | #include <linux/mod_devicetable.h> |
7 | #include <asm/openprom.h> | ||
7 | #include <asm/prom.h> | 8 | #include <asm/prom.h> |
8 | 9 | ||
9 | extern struct bus_type isa_bus_type; | 10 | extern struct bus_type isa_bus_type; |
10 | extern struct bus_type ebus_bus_type; | 11 | extern struct bus_type ebus_bus_type; |
11 | extern struct bus_type sbus_bus_type; | 12 | extern struct bus_type sbus_bus_type; |
13 | extern struct bus_type of_bus_type; | ||
12 | 14 | ||
13 | /* | 15 | /* |
14 | * The of_device is a kind of "base class" that is a superset of | 16 | * The of_device is a kind of "base class" that is a superset of |
@@ -17,11 +19,25 @@ extern struct bus_type sbus_bus_type; | |||
17 | */ | 19 | */ |
18 | struct of_device | 20 | struct of_device |
19 | { | 21 | { |
20 | struct device_node *node; /* OF device node */ | 22 | struct device_node *node; |
21 | struct device dev; /* Generic device interface */ | 23 | struct device dev; |
24 | struct resource resource[PROMREG_MAX]; | ||
25 | unsigned int irqs[PROMINTR_MAX]; | ||
26 | int num_irqs; | ||
27 | |||
28 | void *sysdata; | ||
29 | |||
30 | int slot; | ||
31 | int portid; | ||
32 | int clock_freq; | ||
22 | }; | 33 | }; |
23 | #define to_of_device(d) container_of(d, struct of_device, dev) | 34 | #define to_of_device(d) container_of(d, struct of_device, dev) |
24 | 35 | ||
36 | extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); | ||
37 | extern void of_iounmap(void __iomem *base, unsigned long size); | ||
38 | |||
39 | extern struct of_device *of_find_device_by_node(struct device_node *); | ||
40 | |||
25 | extern const struct of_device_id *of_match_device( | 41 | extern const struct of_device_id *of_match_device( |
26 | const struct of_device_id *matches, const struct of_device *dev); | 42 | const struct of_device_id *matches, const struct of_device *dev); |
27 | 43 | ||
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index cebe80b1da6c..dcfa7629358c 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/prom.h> | 18 | #include <asm/prom.h> |
19 | #include <asm/of_device.h> | ||
19 | #include <asm/iommu.h> | 20 | #include <asm/iommu.h> |
20 | 21 | ||
21 | /* The abstraction used here is that there are PCI controllers, | 22 | /* The abstraction used here is that there are PCI controllers, |
@@ -209,7 +210,6 @@ struct pci_controller_info { | |||
209 | 210 | ||
210 | /* Operations which are controller specific. */ | 211 | /* Operations which are controller specific. */ |
211 | void (*scan_bus)(struct pci_controller_info *); | 212 | void (*scan_bus)(struct pci_controller_info *); |
212 | unsigned int (*irq_build)(struct pci_pbm_info *, struct pci_dev *, unsigned int); | ||
213 | void (*base_address_update)(struct pci_dev *, int); | 213 | void (*base_address_update)(struct pci_dev *, int); |
214 | void (*resource_adjust)(struct pci_dev *, struct resource *, struct resource *); | 214 | void (*resource_adjust)(struct pci_dev *, struct resource *, struct resource *); |
215 | 215 | ||
@@ -217,8 +217,6 @@ struct pci_controller_info { | |||
217 | struct pci_ops *pci_ops; | 217 | struct pci_ops *pci_ops; |
218 | unsigned int pci_first_busno; | 218 | unsigned int pci_first_busno; |
219 | unsigned int pci_last_busno; | 219 | unsigned int pci_last_busno; |
220 | |||
221 | void *starfire_cookie; | ||
222 | }; | 220 | }; |
223 | 221 | ||
224 | /* PCI devices which are not bridges have this placed in their pci_dev | 222 | /* PCI devices which are not bridges have this placed in their pci_dev |
@@ -228,6 +226,7 @@ struct pci_controller_info { | |||
228 | struct pcidev_cookie { | 226 | struct pcidev_cookie { |
229 | struct pci_pbm_info *pbm; | 227 | struct pci_pbm_info *pbm; |
230 | struct device_node *prom_node; | 228 | struct device_node *prom_node; |
229 | struct of_device *op; | ||
231 | struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; | 230 | struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; |
232 | int num_prom_regs; | 231 | int num_prom_regs; |
233 | struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; | 232 | struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; |
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h index a6ece06b83db..ced8cbde046d 100644 --- a/include/asm-sparc64/percpu.h +++ b/include/asm-sparc64/percpu.h | |||
@@ -11,6 +11,7 @@ extern unsigned long __per_cpu_base; | |||
11 | extern unsigned long __per_cpu_shift; | 11 | extern unsigned long __per_cpu_shift; |
12 | #define __per_cpu_offset(__cpu) \ | 12 | #define __per_cpu_offset(__cpu) \ |
13 | (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) | 13 | (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) |
14 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
14 | 15 | ||
15 | /* Separate out the type, so (int[3], foo) works. */ | 16 | /* Separate out the type, so (int[3], foo) works. */ |
16 | #define DEFINE_PER_CPU(type, name) \ | 17 | #define DEFINE_PER_CPU(type, name) \ |
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h index 265614d497c4..99671ed6625d 100644 --- a/include/asm-sparc64/prom.h +++ b/include/asm-sparc64/prom.h | |||
@@ -25,11 +25,6 @@ | |||
25 | typedef u32 phandle; | 25 | typedef u32 phandle; |
26 | typedef u32 ihandle; | 26 | typedef u32 ihandle; |
27 | 27 | ||
28 | struct interrupt_info { | ||
29 | int line; | ||
30 | int sense; /* +ve/-ve logic, edge or level, etc. */ | ||
31 | }; | ||
32 | |||
33 | struct property { | 28 | struct property { |
34 | char *name; | 29 | char *name; |
35 | int length; | 30 | int length; |
@@ -39,13 +34,11 @@ struct property { | |||
39 | unsigned int unique_id; | 34 | unsigned int unique_id; |
40 | }; | 35 | }; |
41 | 36 | ||
37 | struct of_irq_controller; | ||
42 | struct device_node { | 38 | struct device_node { |
43 | char *name; | 39 | char *name; |
44 | char *type; | 40 | char *type; |
45 | phandle node; | 41 | phandle node; |
46 | phandle linux_phandle; | ||
47 | int n_intrs; | ||
48 | struct interrupt_info *intrs; | ||
49 | char *path_component_name; | 42 | char *path_component_name; |
50 | char *full_name; | 43 | char *full_name; |
51 | 44 | ||
@@ -61,6 +54,13 @@ struct device_node { | |||
61 | unsigned long _flags; | 54 | unsigned long _flags; |
62 | void *data; | 55 | void *data; |
63 | unsigned int unique_id; | 56 | unsigned int unique_id; |
57 | |||
58 | struct of_irq_controller *irq_trans; | ||
59 | }; | ||
60 | |||
61 | struct of_irq_controller { | ||
62 | unsigned int (*irq_build)(struct device_node *, unsigned int, void *); | ||
63 | void *data; | ||
64 | }; | 64 | }; |
65 | 65 | ||
66 | /* flag descriptions */ | 66 | /* flag descriptions */ |
@@ -69,6 +69,8 @@ struct device_node { | |||
69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | 69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) |
70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | 70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) |
71 | 71 | ||
72 | #define OF_BAD_ADDR ((u64)-1) | ||
73 | |||
72 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | 74 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) |
73 | { | 75 | { |
74 | dn->pde = de; | 76 | dn->pde = de; |
@@ -101,6 +103,8 @@ extern int of_set_property(struct device_node *node, const char *name, void *val | |||
101 | extern int of_getintprop_default(struct device_node *np, | 103 | extern int of_getintprop_default(struct device_node *np, |
102 | const char *name, | 104 | const char *name, |
103 | int def); | 105 | int def); |
106 | extern int of_n_addr_cells(struct device_node *np); | ||
107 | extern int of_n_size_cells(struct device_node *np); | ||
104 | 108 | ||
105 | extern void prom_build_devicetree(void); | 109 | extern void prom_build_devicetree(void); |
106 | 110 | ||
diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h index 56ee985e4605..7efd49d31bb8 100644 --- a/include/asm-sparc64/sbus.h +++ b/include/asm-sparc64/sbus.h | |||
@@ -80,7 +80,6 @@ struct sbus_bus { | |||
80 | int num_sbus_ranges; | 80 | int num_sbus_ranges; |
81 | 81 | ||
82 | int portid; | 82 | int portid; |
83 | void *starfire_cookie; | ||
84 | }; | 83 | }; |
85 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) | 84 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) |
86 | 85 | ||
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h index fdc42a14d4e6..9968871103bc 100644 --- a/include/asm-sparc64/signal.h +++ b/include/asm-sparc64/signal.h | |||
@@ -133,16 +133,13 @@ struct sigstack { | |||
133 | * usage of signal stacks by using the (now obsolete) sa_restorer field in | 133 | * usage of signal stacks by using the (now obsolete) sa_restorer field in |
134 | * the sigaction structure as a stack pointer. This is now possible due to | 134 | * the sigaction structure as a stack pointer. This is now possible due to |
135 | * the changes in signal handling. LBT 010493. | 135 | * the changes in signal handling. LBT 010493. |
136 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
137 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 136 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
138 | * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. | ||
139 | */ | 137 | */ |
140 | #define SA_NOCLDSTOP _SV_IGNCHILD | 138 | #define SA_NOCLDSTOP _SV_IGNCHILD |
141 | #define SA_STACK _SV_SSTACK | 139 | #define SA_STACK _SV_SSTACK |
142 | #define SA_ONSTACK _SV_SSTACK | 140 | #define SA_ONSTACK _SV_SSTACK |
143 | #define SA_RESTART _SV_INTR | 141 | #define SA_RESTART _SV_INTR |
144 | #define SA_ONESHOT _SV_RESET | 142 | #define SA_ONESHOT _SV_RESET |
145 | #define SA_INTERRUPT 0x10u | ||
146 | #define SA_NOMASK 0x20u | 143 | #define SA_NOMASK 0x20u |
147 | #define SA_NOCLDWAIT 0x100u | 144 | #define SA_NOCLDWAIT 0x100u |
148 | #define SA_SIGINFO 0x200u | 145 | #define SA_SIGINFO 0x200u |
diff --git a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h index 59987dad3359..754d46a50af3 100644 --- a/include/asm-sparc64/socket.h +++ b/include/asm-sparc64/socket.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define SCM_TIMESTAMP SO_TIMESTAMP | 48 | #define SCM_TIMESTAMP SO_TIMESTAMP |
49 | 49 | ||
50 | #define SO_PEERSEC 0x001e | 50 | #define SO_PEERSEC 0x001e |
51 | #define SO_PASSSEC 0x001f | ||
51 | 52 | ||
52 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 53 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
53 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 54 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
diff --git a/include/asm-sparc64/starfire.h b/include/asm-sparc64/starfire.h index b606cb2b32a8..48b50b5e35b0 100644 --- a/include/asm-sparc64/starfire.h +++ b/include/asm-sparc64/starfire.h | |||
@@ -14,7 +14,7 @@ extern int this_is_starfire; | |||
14 | extern void check_if_starfire(void); | 14 | extern void check_if_starfire(void); |
15 | extern void starfire_cpu_setup(void); | 15 | extern void starfire_cpu_setup(void); |
16 | extern int starfire_hard_smp_processor_id(void); | 16 | extern int starfire_hard_smp_processor_id(void); |
17 | extern void *starfire_hookup(int); | 17 | extern void starfire_hookup(int); |
18 | extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); | 18 | extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); |
19 | 19 | ||
20 | #endif | 20 | #endif |
diff --git a/include/asm-sparc64/vdev.h b/include/asm-sparc64/vdev.h deleted file mode 100644 index 25637c57675d..000000000000 --- a/include/asm-sparc64/vdev.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* vdev.h: SUN4V virtual device interfaces and defines. | ||
2 | * | ||
3 | * Copyright (C) 2006 David S. Miller <davem@davemloft.net> | ||
4 | */ | ||
5 | |||
6 | #ifndef _SPARC64_VDEV_H | ||
7 | #define _SPARC64_VDEV_H | ||
8 | |||
9 | #include <linux/types.h> | ||
10 | #include <asm/prom.h> | ||
11 | |||
12 | extern u32 sun4v_vdev_devhandle; | ||
13 | extern struct device_node *sun4v_vdev_root; | ||
14 | |||
15 | extern unsigned int sun4v_vdev_device_interrupt(struct device_node *dev_node); | ||
16 | |||
17 | #endif /* !(_SPARC64_VDEV_H) */ | ||
diff --git a/include/asm-um/Kbuild b/include/asm-um/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-um/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-um/hw_irq.h b/include/asm-um/hw_irq.h index 4ee38c0b6a64..1cf84cf5f21a 100644 --- a/include/asm-um/hw_irq.h +++ b/include/asm-um/hw_irq.h | |||
@@ -4,7 +4,4 @@ | |||
4 | #include "asm/irq.h" | 4 | #include "asm/irq.h" |
5 | #include "asm/archparam.h" | 5 | #include "asm/archparam.h" |
6 | 6 | ||
7 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) | ||
8 | {} | ||
9 | |||
10 | #endif | 7 | #endif |
diff --git a/include/asm-um/io.h b/include/asm-um/io.h index 1934d9340e2c..44e8b8c772ae 100644 --- a/include/asm-um/io.h +++ b/include/asm-um/io.h | |||
@@ -45,8 +45,13 @@ static inline void writel(unsigned int b, volatile void __iomem *addr) | |||
45 | { | 45 | { |
46 | *(volatile unsigned int __force *) addr = b; | 46 | *(volatile unsigned int __force *) addr = b; |
47 | } | 47 | } |
48 | static inline void writeq(unsigned int b, volatile void __iomem *addr) | ||
49 | { | ||
50 | *(volatile unsigned long long __force *) addr = b; | ||
51 | } | ||
48 | #define __raw_writeb writeb | 52 | #define __raw_writeb writeb |
49 | #define __raw_writew writew | 53 | #define __raw_writew writew |
50 | #define __raw_writel writel | 54 | #define __raw_writel writel |
55 | #define __raw_writeq writeq | ||
51 | 56 | ||
52 | #endif | 57 | #endif |
diff --git a/include/asm-um/kmap_types.h b/include/asm-um/kmap_types.h index 0b22ad776e76..6c03acdb4405 100644 --- a/include/asm-um/kmap_types.h +++ b/include/asm-um/kmap_types.h | |||
@@ -6,6 +6,24 @@ | |||
6 | #ifndef __UM_KMAP_TYPES_H | 6 | #ifndef __UM_KMAP_TYPES_H |
7 | #define __UM_KMAP_TYPES_H | 7 | #define __UM_KMAP_TYPES_H |
8 | 8 | ||
9 | #include "asm/arch/kmap_types.h" | 9 | /* No more #include "asm/arch/kmap_types.h" ! */ |
10 | |||
11 | enum km_type { | ||
12 | KM_BOUNCE_READ, | ||
13 | KM_SKB_SUNRPC_DATA, | ||
14 | KM_SKB_DATA_SOFTIRQ, | ||
15 | KM_USER0, | ||
16 | KM_USER1, | ||
17 | KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */ | ||
18 | KM_BIO_SRC_IRQ, | ||
19 | KM_BIO_DST_IRQ, | ||
20 | KM_PTE0, | ||
21 | KM_PTE1, | ||
22 | KM_IRQ0, | ||
23 | KM_IRQ1, | ||
24 | KM_SOFTIRQ0, | ||
25 | KM_SOFTIRQ1, | ||
26 | KM_TYPE_NR | ||
27 | }; | ||
10 | 28 | ||
11 | #endif | 29 | #endif |
diff --git a/include/asm-v850/Kbuild b/include/asm-v850/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-v850/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-v850/hw_irq.h b/include/asm-v850/hw_irq.h index a8aab4342712..043e94bb6bd8 100644 --- a/include/asm-v850/hw_irq.h +++ b/include/asm-v850/hw_irq.h | |||
@@ -1,8 +1,4 @@ | |||
1 | #ifndef __V850_HW_IRQ_H__ | 1 | #ifndef __V850_HW_IRQ_H__ |
2 | #define __V850_HW_IRQ_H__ | 2 | #define __V850_HW_IRQ_H__ |
3 | 3 | ||
4 | static inline void hw_resend_irq (struct hw_interrupt_type *h, unsigned int i) | ||
5 | { | ||
6 | } | ||
7 | |||
8 | #endif /* __V850_HW_IRQ_H__ */ | 4 | #endif /* __V850_HW_IRQ_H__ */ |
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h index 6965b66ccaed..979e3467f9af 100644 --- a/include/asm-v850/processor.h +++ b/include/asm-v850/processor.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/thread_info.h> | 18 | #include <linux/thread_info.h> |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #include <linux/compiler.h> | ||
21 | #include <asm/ptrace.h> | 22 | #include <asm/ptrace.h> |
22 | #include <asm/entry.h> | 23 | #include <asm/entry.h> |
23 | 24 | ||
@@ -106,7 +107,7 @@ unsigned long get_wchan (struct task_struct *p); | |||
106 | #define KSTK_ESP(task) task_sp (task) | 107 | #define KSTK_ESP(task) task_sp (task) |
107 | 108 | ||
108 | 109 | ||
109 | #define cpu_relax() ((void)0) | 110 | #define cpu_relax() barrier() |
110 | 111 | ||
111 | 112 | ||
112 | #else /* __ASSEMBLY__ */ | 113 | #else /* __ASSEMBLY__ */ |
diff --git a/include/asm-v850/signal.h b/include/asm-v850/signal.h index cb52caa69925..a38df0834bbf 100644 --- a/include/asm-v850/signal.h +++ b/include/asm-v850/signal.h | |||
@@ -77,7 +77,6 @@ typedef unsigned long sigset_t; | |||
77 | * SA_FLAGS values: | 77 | * SA_FLAGS values: |
78 | * | 78 | * |
79 | * SA_ONSTACK indicates that a registered stack_t will be used. | 79 | * SA_ONSTACK indicates that a registered stack_t will be used. |
80 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
81 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 80 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
82 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 81 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
83 | * SA_RESETHAND clears the handler when the signal is delivered. | 82 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -97,7 +96,6 @@ typedef unsigned long sigset_t; | |||
97 | 96 | ||
98 | #define SA_NOMASK SA_NODEFER | 97 | #define SA_NOMASK SA_NODEFER |
99 | #define SA_ONESHOT SA_RESETHAND | 98 | #define SA_ONESHOT SA_RESETHAND |
100 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
101 | 99 | ||
102 | #define SA_RESTORER 0x04000000 | 100 | #define SA_RESTORER 0x04000000 |
103 | 101 | ||
diff --git a/include/asm-v850/socket.h b/include/asm-v850/socket.h index 0240d366a0a4..0dfe55ac2ef2 100644 --- a/include/asm-v850/socket.h +++ b/include/asm-v850/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* __V850_SOCKET_H__ */ | 53 | #endif /* __V850_SOCKET_H__ */ |
diff --git a/include/asm-x86_64/Kbuild b/include/asm-x86_64/Kbuild new file mode 100644 index 000000000000..dc4d101e8a16 --- /dev/null +++ b/include/asm-x86_64/Kbuild | |||
@@ -0,0 +1,11 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | ALTARCH := i386 | ||
4 | ARCHDEF := defined __x86_64__ | ||
5 | ALTARCHDEF := defined __i386__ | ||
6 | |||
7 | header-y += boot.h bootsetup.h cpufeature.h debugreg.h ldt.h \ | ||
8 | msr.h prctl.h setup.h sigcontext32.h ucontext.h \ | ||
9 | vsyscall32.h | ||
10 | |||
11 | unifdef-y += mce.h mtrr.h vsyscall.h | ||
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h index 387c8f66af7d..aa67bfd1b3ce 100644 --- a/include/asm-x86_64/alternative.h +++ b/include/asm-x86_64/alternative.h | |||
@@ -17,11 +17,20 @@ struct alt_instr { | |||
17 | extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); | 17 | extern void apply_alternatives(struct alt_instr *start, struct alt_instr *end); |
18 | 18 | ||
19 | struct module; | 19 | struct module; |
20 | |||
21 | #ifdef CONFIG_SMP | ||
20 | extern void alternatives_smp_module_add(struct module *mod, char *name, | 22 | extern void alternatives_smp_module_add(struct module *mod, char *name, |
21 | void *locks, void *locks_end, | 23 | void *locks, void *locks_end, |
22 | void *text, void *text_end); | 24 | void *text, void *text_end); |
23 | extern void alternatives_smp_module_del(struct module *mod); | 25 | extern void alternatives_smp_module_del(struct module *mod); |
24 | extern void alternatives_smp_switch(int smp); | 26 | extern void alternatives_smp_switch(int smp); |
27 | #else | ||
28 | static inline void alternatives_smp_module_add(struct module *mod, char *name, | ||
29 | void *locks, void *locks_end, | ||
30 | void *text, void *text_end) {} | ||
31 | static inline void alternatives_smp_module_del(struct module *mod) {} | ||
32 | static inline void alternatives_smp_switch(int smp) {} | ||
33 | #endif | ||
25 | 34 | ||
26 | #endif | 35 | #endif |
27 | 36 | ||
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h index 6e1654f30986..fbfb50136edb 100644 --- a/include/asm-x86_64/calgary.h +++ b/include/asm-x86_64/calgary.h | |||
@@ -1,8 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * Derived from include/asm-powerpc/iommu.h | 2 | * Derived from include/asm-powerpc/iommu.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation | 4 | * Copyright (C) IBM Corporation, 2006 |
5 | * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation | 5 | * |
6 | * Author: Jon Mason <jdmason@us.ibm.com> | ||
7 | * Author: Muli Ben-Yehuda <muli@il.ibm.com> | ||
6 | * | 8 | * |
7 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h index 006291e89b4a..32ff5d132714 100644 --- a/include/asm-x86_64/floppy.h +++ b/include/asm-x86_64/floppy.h | |||
@@ -144,11 +144,11 @@ static int vdma_get_dma_residue(unsigned int dummy) | |||
144 | static int fd_request_irq(void) | 144 | static int fd_request_irq(void) |
145 | { | 145 | { |
146 | if(can_use_virtual_dma) | 146 | if(can_use_virtual_dma) |
147 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 147 | return request_irq(FLOPPY_IRQ, floppy_hardint, |
148 | "floppy", NULL); | 148 | IRQF_DISABLED, "floppy", NULL); |
149 | else | 149 | else |
150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, | 150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
151 | "floppy", NULL); | 151 | IRQF_DISABLED, "floppy", NULL); |
152 | } | 152 | } |
153 | 153 | ||
154 | static unsigned long dma_mem_alloc(unsigned long size) | 154 | static unsigned long dma_mem_alloc(unsigned long size) |
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index 931877462788..48a4a5364e85 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h | |||
@@ -127,15 +127,6 @@ __asm__( \ | |||
127 | "push $~(" #nr ") ; " \ | 127 | "push $~(" #nr ") ; " \ |
128 | "jmp common_interrupt"); | 128 | "jmp common_interrupt"); |
129 | 129 | ||
130 | #if defined(CONFIG_X86_IO_APIC) | ||
131 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) { | ||
132 | if (IO_APIC_IRQ(i)) | ||
133 | send_IPI_self(IO_APIC_VECTOR(i)); | ||
134 | } | ||
135 | #else | ||
136 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
137 | #endif | ||
138 | |||
139 | #define platform_legacy_irq(irq) ((irq) < 16) | 130 | #define platform_legacy_irq(irq) ((irq) < 16) |
140 | 131 | ||
141 | #endif | 132 | #endif |
diff --git a/include/asm-x86_64/irqflags.h b/include/asm-x86_64/irqflags.h new file mode 100644 index 000000000000..cce6937e87c0 --- /dev/null +++ b/include/asm-x86_64/irqflags.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * include/asm-x86_64/irqflags.h | ||
3 | * | ||
4 | * IRQ flags handling | ||
5 | * | ||
6 | * This file gets included from lowlevel asm headers too, to provide | ||
7 | * wrapped versions of the local_irq_*() APIs, based on the | ||
8 | * raw_local_irq_*() functions from the lowlevel headers. | ||
9 | */ | ||
10 | #ifndef _ASM_IRQFLAGS_H | ||
11 | #define _ASM_IRQFLAGS_H | ||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | /* | ||
15 | * Interrupt control: | ||
16 | */ | ||
17 | |||
18 | static inline unsigned long __raw_local_save_flags(void) | ||
19 | { | ||
20 | unsigned long flags; | ||
21 | |||
22 | __asm__ __volatile__( | ||
23 | "# __raw_save_flags\n\t" | ||
24 | "pushfq ; popq %q0" | ||
25 | : "=g" (flags) | ||
26 | : /* no input */ | ||
27 | : "memory" | ||
28 | ); | ||
29 | |||
30 | return flags; | ||
31 | } | ||
32 | |||
33 | #define raw_local_save_flags(flags) \ | ||
34 | do { (flags) = __raw_local_save_flags(); } while (0) | ||
35 | |||
36 | static inline void raw_local_irq_restore(unsigned long flags) | ||
37 | { | ||
38 | __asm__ __volatile__( | ||
39 | "pushq %0 ; popfq" | ||
40 | : /* no output */ | ||
41 | :"g" (flags) | ||
42 | :"memory", "cc" | ||
43 | ); | ||
44 | } | ||
45 | |||
46 | #ifdef CONFIG_X86_VSMP | ||
47 | |||
48 | /* | ||
49 | * Interrupt control for the VSMP architecture: | ||
50 | */ | ||
51 | |||
52 | static inline void raw_local_irq_disable(void) | ||
53 | { | ||
54 | unsigned long flags = __raw_local_save_flags(); | ||
55 | |||
56 | raw_local_irq_restore((flags & ~(1 << 9)) | (1 << 18)); | ||
57 | } | ||
58 | |||
59 | static inline void raw_local_irq_enable(void) | ||
60 | { | ||
61 | unsigned long flags = __raw_local_save_flags(); | ||
62 | |||
63 | raw_local_irq_restore((flags | (1 << 9)) & ~(1 << 18)); | ||
64 | } | ||
65 | |||
66 | static inline int raw_irqs_disabled_flags(unsigned long flags) | ||
67 | { | ||
68 | return !(flags & (1<<9)) || (flags & (1 << 18)); | ||
69 | } | ||
70 | |||
71 | #else /* CONFIG_X86_VSMP */ | ||
72 | |||
73 | static inline void raw_local_irq_disable(void) | ||
74 | { | ||
75 | __asm__ __volatile__("cli" : : : "memory"); | ||
76 | } | ||
77 | |||
78 | static inline void raw_local_irq_enable(void) | ||
79 | { | ||
80 | __asm__ __volatile__("sti" : : : "memory"); | ||
81 | } | ||
82 | |||
83 | static inline int raw_irqs_disabled_flags(unsigned long flags) | ||
84 | { | ||
85 | return !(flags & (1 << 9)); | ||
86 | } | ||
87 | |||
88 | #endif | ||
89 | |||
90 | /* | ||
91 | * For spinlocks, etc.: | ||
92 | */ | ||
93 | |||
94 | static inline unsigned long __raw_local_irq_save(void) | ||
95 | { | ||
96 | unsigned long flags = __raw_local_save_flags(); | ||
97 | |||
98 | raw_local_irq_disable(); | ||
99 | |||
100 | return flags; | ||
101 | } | ||
102 | |||
103 | #define raw_local_irq_save(flags) \ | ||
104 | do { (flags) = __raw_local_irq_save(); } while (0) | ||
105 | |||
106 | static inline int raw_irqs_disabled(void) | ||
107 | { | ||
108 | unsigned long flags = __raw_local_save_flags(); | ||
109 | |||
110 | return raw_irqs_disabled_flags(flags); | ||
111 | } | ||
112 | |||
113 | /* | ||
114 | * Used in the idle loop; sti takes one instruction cycle | ||
115 | * to complete: | ||
116 | */ | ||
117 | static inline void raw_safe_halt(void) | ||
118 | { | ||
119 | __asm__ __volatile__("sti; hlt" : : : "memory"); | ||
120 | } | ||
121 | |||
122 | /* | ||
123 | * Used when interrupts are already enabled or to | ||
124 | * shutdown the processor: | ||
125 | */ | ||
126 | static inline void halt(void) | ||
127 | { | ||
128 | __asm__ __volatile__("hlt": : :"memory"); | ||
129 | } | ||
130 | |||
131 | #else /* __ASSEMBLY__: */ | ||
132 | # ifdef CONFIG_TRACE_IRQFLAGS | ||
133 | # define TRACE_IRQS_ON call trace_hardirqs_on_thunk | ||
134 | # define TRACE_IRQS_OFF call trace_hardirqs_off_thunk | ||
135 | # else | ||
136 | # define TRACE_IRQS_ON | ||
137 | # define TRACE_IRQS_OFF | ||
138 | # endif | ||
139 | #endif | ||
140 | |||
141 | #endif | ||
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h index cd52c7f33bca..2b0c088e2957 100644 --- a/include/asm-x86_64/kdebug.h +++ b/include/asm-x86_64/kdebug.h | |||
@@ -49,7 +49,7 @@ static inline int notify_die(enum die_val val, const char *str, | |||
49 | return atomic_notifier_call_chain(&die_chain, val, &args); | 49 | return atomic_notifier_call_chain(&die_chain, val, &args); |
50 | } | 50 | } |
51 | 51 | ||
52 | extern int printk_address(unsigned long address); | 52 | extern void printk_address(unsigned long address); |
53 | extern void die(const char *,struct pt_regs *,long); | 53 | extern void die(const char *,struct pt_regs *,long); |
54 | extern void __die(const char *,struct pt_regs *,long); | 54 | extern void __die(const char *,struct pt_regs *,long); |
55 | extern void show_registers(struct pt_regs *regs); | 55 | extern void show_registers(struct pt_regs *regs); |
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 549eb929b2c0..08dd9f9dda81 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) | 14 | #define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) |
15 | #define __my_cpu_offset() read_pda(data_offset) | 15 | #define __my_cpu_offset() read_pda(data_offset) |
16 | 16 | ||
17 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
18 | |||
17 | /* Separate out the type, so (int[3], foo) works. */ | 19 | /* Separate out the type, so (int[3], foo) works. */ |
18 | #define DEFINE_PER_CPU(type, name) \ | 20 | #define DEFINE_PER_CPU(type, name) \ |
19 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name | 21 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name |
diff --git a/include/asm-x86_64/signal.h b/include/asm-x86_64/signal.h index f8d55798535a..cef7a7d51b7e 100644 --- a/include/asm-x86_64/signal.h +++ b/include/asm-x86_64/signal.h | |||
@@ -83,7 +83,6 @@ typedef unsigned long sigset_t; | |||
83 | * SA_FLAGS values: | 83 | * SA_FLAGS values: |
84 | * | 84 | * |
85 | * SA_ONSTACK indicates that a registered stack_t will be used. | 85 | * SA_ONSTACK indicates that a registered stack_t will be used. |
86 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
87 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 86 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
88 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 87 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
89 | * SA_RESETHAND clears the handler when the signal is delivered. | 88 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -103,7 +102,6 @@ typedef unsigned long sigset_t; | |||
103 | 102 | ||
104 | #define SA_NOMASK SA_NODEFER | 103 | #define SA_NOMASK SA_NODEFER |
105 | #define SA_ONESHOT SA_RESETHAND | 104 | #define SA_ONESHOT SA_RESETHAND |
106 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
107 | 105 | ||
108 | #define SA_RESTORER 0x04000000 | 106 | #define SA_RESTORER 0x04000000 |
109 | 107 | ||
diff --git a/include/asm-x86_64/socket.h b/include/asm-x86_64/socket.h index f2cdbeae5d5b..b46702607933 100644 --- a/include/asm-x86_64/socket.h +++ b/include/asm-x86_64/socket.h | |||
@@ -48,5 +48,6 @@ | |||
48 | #define SO_ACCEPTCONN 30 | 48 | #define SO_ACCEPTCONN 30 |
49 | 49 | ||
50 | #define SO_PEERSEC 31 | 50 | #define SO_PEERSEC 31 |
51 | #define SO_PASSSEC 34 | ||
51 | 52 | ||
52 | #endif /* _ASM_SOCKET_H */ | 53 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index 68e559f3631c..f67f2873a922 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -244,43 +244,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
244 | 244 | ||
245 | #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) | 245 | #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) |
246 | 246 | ||
247 | /* interrupt control.. */ | 247 | #include <linux/irqflags.h> |
248 | #define local_save_flags(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# save_flags \n\t pushfq ; popq %q0":"=g" (x): /* no input */ :"memory"); } while (0) | ||
249 | #define local_irq_restore(x) __asm__ __volatile__("# restore_flags \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc") | ||
250 | |||
251 | #ifdef CONFIG_X86_VSMP | ||
252 | /* Interrupt control for VSMP architecture */ | ||
253 | #define local_irq_disable() do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags & ~(1 << 9)) | (1 << 18)); } while (0) | ||
254 | #define local_irq_enable() do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags | (1 << 9)) & ~(1 << 18)); } while (0) | ||
255 | |||
256 | #define irqs_disabled() \ | ||
257 | ({ \ | ||
258 | unsigned long flags; \ | ||
259 | local_save_flags(flags); \ | ||
260 | (flags & (1<<18)) || !(flags & (1<<9)); \ | ||
261 | }) | ||
262 | |||
263 | /* For spinlocks etc */ | ||
264 | #define local_irq_save(x) do { local_save_flags(x); local_irq_restore((x & ~(1 << 9)) | (1 << 18)); } while (0) | ||
265 | #else /* CONFIG_X86_VSMP */ | ||
266 | #define local_irq_disable() __asm__ __volatile__("cli": : :"memory") | ||
267 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") | ||
268 | |||
269 | #define irqs_disabled() \ | ||
270 | ({ \ | ||
271 | unsigned long flags; \ | ||
272 | local_save_flags(flags); \ | ||
273 | !(flags & (1<<9)); \ | ||
274 | }) | ||
275 | |||
276 | /* For spinlocks etc */ | ||
277 | #define local_irq_save(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0) | ||
278 | #endif | ||
279 | |||
280 | /* used in the idle loop; sti takes one instruction cycle to complete */ | ||
281 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") | ||
282 | /* used when interrupts are already enabled or to shutdown the processor */ | ||
283 | #define halt() __asm__ __volatile__("hlt": : :"memory") | ||
284 | 248 | ||
285 | void cpu_idle_wait(void); | 249 | void cpu_idle_wait(void); |
286 | 250 | ||
diff --git a/include/asm-x86_64/tce.h b/include/asm-x86_64/tce.h index ee51d31528d6..53e9a68b3336 100644 --- a/include/asm-x86_64/tce.h +++ b/include/asm-x86_64/tce.h | |||
@@ -1,9 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation | ||
3 | * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation | ||
4 | * | ||
5 | * This file is derived from asm-powerpc/tce.h. | 2 | * This file is derived from asm-powerpc/tce.h. |
6 | * | 3 | * |
4 | * Copyright (C) IBM Corporation, 2006 | ||
5 | * | ||
6 | * Author: Muli Ben-Yehuda <muli@il.ibm.com> | ||
7 | * Author: Jon Mason <jdmason@us.ibm.com> | ||
8 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or | 11 | * the Free Software Foundation; either version 2 of the License, or |
diff --git a/include/asm-xtensa/Kbuild b/include/asm-xtensa/Kbuild new file mode 100644 index 000000000000..c68e1680da01 --- /dev/null +++ b/include/asm-xtensa/Kbuild | |||
@@ -0,0 +1 @@ | |||
include include/asm-generic/Kbuild.asm | |||
diff --git a/include/asm-xtensa/hw_irq.h b/include/asm-xtensa/hw_irq.h index ccf436249eaa..3ddbea759b2b 100644 --- a/include/asm-xtensa/hw_irq.h +++ b/include/asm-xtensa/hw_irq.h | |||
@@ -11,8 +11,4 @@ | |||
11 | #ifndef _XTENSA_HW_IRQ_H | 11 | #ifndef _XTENSA_HW_IRQ_H |
12 | #define _XTENSA_HW_IRQ_H | 12 | #define _XTENSA_HW_IRQ_H |
13 | 13 | ||
14 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) | ||
15 | { | ||
16 | } | ||
17 | |||
18 | #endif | 14 | #endif |
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h index d1d72ad36f08..8b96e77c9d82 100644 --- a/include/asm-xtensa/processor.h +++ b/include/asm-xtensa/processor.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <xtensa/config/tie.h> | 20 | #include <xtensa/config/tie.h> |
21 | #include <xtensa/config/system.h> | 21 | #include <xtensa/config/system.h> |
22 | 22 | ||
23 | #include <linux/compiler.h> | ||
23 | #include <asm/ptrace.h> | 24 | #include <asm/ptrace.h> |
24 | #include <asm/types.h> | 25 | #include <asm/types.h> |
25 | #include <asm/coprocessor.h> | 26 | #include <asm/coprocessor.h> |
@@ -191,7 +192,7 @@ extern unsigned long get_wchan(struct task_struct *p); | |||
191 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) | 192 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) |
192 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) | 193 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) |
193 | 194 | ||
194 | #define cpu_relax() do { } while (0) | 195 | #define cpu_relax() barrier() |
195 | 196 | ||
196 | /* Special register access. */ | 197 | /* Special register access. */ |
197 | 198 | ||
diff --git a/include/asm-xtensa/rwsem.h b/include/asm-xtensa/rwsem.h index abcd86dc5ab9..0aad3a587551 100644 --- a/include/asm-xtensa/rwsem.h +++ b/include/asm-xtensa/rwsem.h | |||
@@ -31,24 +31,11 @@ struct rw_semaphore { | |||
31 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 31 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
32 | spinlock_t wait_lock; | 32 | spinlock_t wait_lock; |
33 | struct list_head wait_list; | 33 | struct list_head wait_list; |
34 | #if RWSEM_DEBUG | ||
35 | int debug; | ||
36 | #endif | ||
37 | }; | 34 | }; |
38 | 35 | ||
39 | /* | ||
40 | * initialisation | ||
41 | */ | ||
42 | #if RWSEM_DEBUG | ||
43 | #define __RWSEM_DEBUG_INIT , 0 | ||
44 | #else | ||
45 | #define __RWSEM_DEBUG_INIT /* */ | ||
46 | #endif | ||
47 | |||
48 | #define __RWSEM_INITIALIZER(name) \ | 36 | #define __RWSEM_INITIALIZER(name) \ |
49 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | 37 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ |
50 | LIST_HEAD_INIT((name).wait_list) \ | 38 | LIST_HEAD_INIT((name).wait_list) } |
51 | __RWSEM_DEBUG_INIT } | ||
52 | 39 | ||
53 | #define DECLARE_RWSEM(name) \ | 40 | #define DECLARE_RWSEM(name) \ |
54 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 41 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
@@ -63,9 +50,6 @@ static inline void init_rwsem(struct rw_semaphore *sem) | |||
63 | sem->count = RWSEM_UNLOCKED_VALUE; | 50 | sem->count = RWSEM_UNLOCKED_VALUE; |
64 | spin_lock_init(&sem->wait_lock); | 51 | spin_lock_init(&sem->wait_lock); |
65 | INIT_LIST_HEAD(&sem->wait_list); | 52 | INIT_LIST_HEAD(&sem->wait_list); |
66 | #if RWSEM_DEBUG | ||
67 | sem->debug = 0; | ||
68 | #endif | ||
69 | } | 53 | } |
70 | 54 | ||
71 | /* | 55 | /* |
diff --git a/include/asm-xtensa/signal.h b/include/asm-xtensa/signal.h index a99c9aec64ec..633ba73bc4d2 100644 --- a/include/asm-xtensa/signal.h +++ b/include/asm-xtensa/signal.h | |||
@@ -75,7 +75,6 @@ typedef struct { | |||
75 | * SA_FLAGS values: | 75 | * SA_FLAGS values: |
76 | * | 76 | * |
77 | * SA_ONSTACK indicates that a registered stack_t will be used. | 77 | * SA_ONSTACK indicates that a registered stack_t will be used. |
78 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
79 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 78 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
80 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | 79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. |
81 | * SA_RESETHAND clears the handler when the signal is delivered. | 80 | * SA_RESETHAND clears the handler when the signal is delivered. |
@@ -95,7 +94,6 @@ typedef struct { | |||
95 | 94 | ||
96 | #define SA_NOMASK SA_NODEFER | 95 | #define SA_NOMASK SA_NODEFER |
97 | #define SA_ONESHOT SA_RESETHAND | 96 | #define SA_ONESHOT SA_RESETHAND |
98 | #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ | ||
99 | 97 | ||
100 | #define SA_RESTORER 0x04000000 | 98 | #define SA_RESTORER 0x04000000 |
101 | 99 | ||
@@ -109,19 +107,6 @@ typedef struct { | |||
109 | #define SIGSTKSZ 8192 | 107 | #define SIGSTKSZ 8192 |
110 | 108 | ||
111 | #ifndef __ASSEMBLY__ | 109 | #ifndef __ASSEMBLY__ |
112 | #ifdef __KERNEL__ | ||
113 | |||
114 | /* | ||
115 | * These values of sa_flags are used only by the kernel as part of the | ||
116 | * irq handling routines. | ||
117 | * | ||
118 | * SA_INTERRUPT is also used by the irq handling routines. | ||
119 | * SA_SHIRQ is for shared interrupt support on PCI and EISA. | ||
120 | */ | ||
121 | #define SA_SAMPLE_RANDOM SA_RESTART | ||
122 | #define SA_SHIRQ 0x04000000 | ||
123 | #define SA_PROBEIRQ 0x08000000 | ||
124 | #endif | ||
125 | 110 | ||
126 | #define SIG_BLOCK 0 /* for blocking signals */ | 111 | #define SIG_BLOCK 0 /* for blocking signals */ |
127 | #define SIG_UNBLOCK 1 /* for unblocking signals */ | 112 | #define SIG_UNBLOCK 1 /* for unblocking signals */ |
diff --git a/include/asm-xtensa/socket.h b/include/asm-xtensa/socket.h index 00f83f3a6d72..971d231be60e 100644 --- a/include/asm-xtensa/socket.h +++ b/include/asm-xtensa/socket.h | |||
@@ -59,5 +59,6 @@ | |||
59 | 59 | ||
60 | #define SO_ACCEPTCONN 30 | 60 | #define SO_ACCEPTCONN 30 |
61 | #define SO_PEERSEC 31 | 61 | #define SO_PEERSEC 31 |
62 | #define SO_PASSSEC 34 | ||
62 | 63 | ||
63 | #endif /* _XTENSA_SOCKET_H */ | 64 | #endif /* _XTENSA_SOCKET_H */ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild new file mode 100644 index 000000000000..2b8a7d68fae3 --- /dev/null +++ b/include/linux/Kbuild | |||
@@ -0,0 +1,63 @@ | |||
1 | header-y := byteorder/ dvb/ hdlc/ isdn/ nfsd/ raid/ sunrpc/ tc_act/ \ | ||
2 | netfilter/ netfilter_arp/ netfilter_bridge/ netfilter_ipv4/ \ | ||
3 | netfilter_ipv6/ | ||
4 | |||
5 | header-y += affs_fs.h affs_hardblocks.h aio_abi.h a.out.h arcfb.h \ | ||
6 | atmapi.h atmbr2684.h atmclip.h atm_eni.h atm_he.h \ | ||
7 | atm_idt77105.h atmioc.h atmlec.h atmmpc.h atm_nicstar.h \ | ||
8 | atmppp.h atmsap.h atmsvc.h atm_zatm.h auto_fs4.h auxvec.h \ | ||
9 | awe_voice.h ax25.h b1lli.h baycom.h bfs_fs.h blkpg.h \ | ||
10 | bpqether.h cdk.h chio.h coda_psdev.h coff.h comstats.h \ | ||
11 | consolemap.h cycx_cfm.h dm-ioctl.h dn.h dqblk_v1.h \ | ||
12 | dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf-fdpic.h elf.h elf-em.h \ | ||
13 | fadvise.h fd.h fdreg.h ftape-header-segment.h ftape-vendors.h \ | ||
14 | fuse.h futex.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h \ | ||
15 | hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h \ | ||
16 | if_arcnet.h if_arp.h if_bonding.h if_cablemodem.h if_fc.h \ | ||
17 | if_fddi.h if.h if_hippi.h if_infiniband.h if_packet.h \ | ||
18 | if_plip.h if_ppp.h if_slip.h if_strip.h if_tunnel.h in6.h \ | ||
19 | in_route.h ioctl.h ip.h ipmi_msgdefs.h ip_mp_alg.h ipsec.h \ | ||
20 | ipx.h irda.h isdn_divertif.h iso_fs.h ite_gpio.h ixjuser.h \ | ||
21 | jffs2.h keyctl.h limits.h major.h matroxfb.h meye.h minix_fs.h \ | ||
22 | mmtimer.h mqueue.h mtio.h ncp_no.h netfilter_arp.h netrom.h \ | ||
23 | nfs2.h nfs4_mount.h nfs_mount.h openprom_fs.h param.h \ | ||
24 | pci_ids.h pci_regs.h personality.h pfkeyv2.h pg.h pkt_cls.h \ | ||
25 | pkt_sched.h posix_types.h ppdev.h prctl.h ps2esdi.h qic117.h \ | ||
26 | qnxtypes.h quotaio_v1.h quotaio_v2.h radeonfb.h raw.h \ | ||
27 | resource.h rose.h sctp.h smbno.h snmp.h sockios.h som.h \ | ||
28 | sound.h stddef.h synclink.h telephony.h termios.h ticable.h \ | ||
29 | times.h tiocl.h tipc.h toshiba.h ultrasound.h un.h utime.h \ | ||
30 | utsname.h video_decoder.h video_encoder.h videotext.h vt.h \ | ||
31 | wavefront.h wireless.h xattr.h x25.h zorro_ids.h | ||
32 | |||
33 | unifdef-y += acct.h adb.h adfs_fs.h agpgart.h apm_bios.h atalk.h \ | ||
34 | atmarp.h atmdev.h atm.h atm_tcp.h audit.h auto_fs.h binfmts.h \ | ||
35 | capability.h capi.h cciss_ioctl.h cdrom.h cm4000_cs.h \ | ||
36 | cn_proc.h coda.h connector.h cramfs_fs.h cuda.h cyclades.h \ | ||
37 | dccp.h dirent.h divert.h elfcore.h errno.h errqueue.h \ | ||
38 | ethtool.h eventpoll.h ext2_fs.h ext3_fs.h fb.h fcntl.h \ | ||
39 | filter.h flat.h fs.h ftape.h gameport.h generic_serial.h \ | ||
40 | genhd.h hayesesp.h hdlcdrv.h hdlc.h hdreg.h hiddev.h hpet.h \ | ||
41 | i2c.h i2o-dev.h icmpv6.h if_bridge.h if_ec.h \ | ||
42 | if_eql.h if_ether.h if_frad.h if_ltalk.h if_pppox.h \ | ||
43 | if_shaper.h if_tr.h if_tun.h if_vlan.h if_wanpipe.h igmp.h \ | ||
44 | inet_diag.h in.h inotify.h input.h ipc.h ipmi.h ipv6.h \ | ||
45 | ipv6_route.h isdn.h isdnif.h isdn_ppp.h isicom.h jbd.h \ | ||
46 | joystick.h kdev_t.h kd.h kernelcapi.h kernel.h keyboard.h \ | ||
47 | llc.h loop.h lp.h mempolicy.h mii.h mman.h mroute.h msdos_fs.h \ | ||
48 | msg.h nbd.h ncp_fs.h ncp.h ncp_mount.h netdevice.h \ | ||
49 | netfilter_bridge.h netfilter_decnet.h netfilter.h \ | ||
50 | netfilter_ipv4.h netfilter_ipv6.h netfilter_logging.h net.h \ | ||
51 | netlink.h nfs3.h nfs4.h nfsacl.h nfs_fs.h nfs.h nfs_idmap.h \ | ||
52 | n_r3964.h nubus.h nvram.h parport.h patchkey.h pci.h pktcdvd.h \ | ||
53 | pmu.h poll.h ppp_defs.h ppp-comp.h ptrace.h qnx4_fs.h quota.h \ | ||
54 | random.h reboot.h reiserfs_fs.h reiserfs_xattr.h romfs_fs.h \ | ||
55 | route.h rtc.h rtnetlink.h scc.h sched.h sdla.h \ | ||
56 | selinux_netlink.h sem.h serial_core.h serial.h serio.h shm.h \ | ||
57 | signal.h smb_fs.h smb.h smb_mount.h socket.h sonet.h sonypi.h \ | ||
58 | soundcard.h stat.h sysctl.h tcp.h time.h timex.h tty.h types.h \ | ||
59 | udf_fs_i.h udp.h uinput.h uio.h unistd.h usb_ch9.h \ | ||
60 | usbdevice_fs.h user.h videodev2.h videodev.h wait.h \ | ||
61 | wanrouter.h watchdog.h xfrm.h zftape.h | ||
62 | |||
63 | objhdr-y := version.h | ||
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index c35833824e11..2ed2fd855133 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h | |||
@@ -259,7 +259,7 @@ struct ac97_codec { | |||
259 | int type; | 259 | int type; |
260 | u32 model; | 260 | u32 model; |
261 | 261 | ||
262 | int modem:1; | 262 | unsigned int modem:1; |
263 | 263 | ||
264 | struct ac97_ops *codec_ops; | 264 | struct ac97_ops *codec_ops; |
265 | 265 | ||
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 1eb238affb12..41788a31c438 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #define LINUX_ATMDEV_H | 7 | #define LINUX_ATMDEV_H |
8 | 8 | ||
9 | 9 | ||
10 | #include <linux/device.h> | ||
10 | #include <linux/atmapi.h> | 11 | #include <linux/atmapi.h> |
11 | #include <linux/atm.h> | 12 | #include <linux/atm.h> |
12 | #include <linux/atmioc.h> | 13 | #include <linux/atmioc.h> |
@@ -358,6 +359,7 @@ struct atm_dev { | |||
358 | struct proc_dir_entry *proc_entry; /* proc entry */ | 359 | struct proc_dir_entry *proc_entry; /* proc entry */ |
359 | char *proc_name; /* proc entry name */ | 360 | char *proc_name; /* proc entry name */ |
360 | #endif | 361 | #endif |
362 | struct class_device class_dev; /* sysfs class device */ | ||
361 | struct list_head dev_list; /* linkage */ | 363 | struct list_head dev_list; /* linkage */ |
362 | }; | 364 | }; |
363 | 365 | ||
@@ -459,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
459 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); | 461 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); |
460 | if (dev->ops->dev_close) | 462 | if (dev->ops->dev_close) |
461 | dev->ops->dev_close(dev); | 463 | dev->ops->dev_close(dev); |
462 | kfree(dev); | 464 | class_device_put(&dev->class_dev); |
463 | } | 465 | } |
464 | } | 466 | } |
465 | 467 | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index e051ff9c5b50..b27d7debc5a1 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -122,10 +122,17 @@ | |||
122 | /* Rule structure sizes -- if these change, different AUDIT_ADD and | 122 | /* Rule structure sizes -- if these change, different AUDIT_ADD and |
123 | * AUDIT_LIST commands must be implemented. */ | 123 | * AUDIT_LIST commands must be implemented. */ |
124 | #define AUDIT_MAX_FIELDS 64 | 124 | #define AUDIT_MAX_FIELDS 64 |
125 | #define AUDIT_MAX_KEY_LEN 32 | ||
125 | #define AUDIT_BITMASK_SIZE 64 | 126 | #define AUDIT_BITMASK_SIZE 64 |
126 | #define AUDIT_WORD(nr) ((__u32)((nr)/32)) | 127 | #define AUDIT_WORD(nr) ((__u32)((nr)/32)) |
127 | #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) | 128 | #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) |
128 | 129 | ||
130 | #define AUDIT_SYSCALL_CLASSES 16 | ||
131 | #define AUDIT_CLASS_DIR_WRITE 0 | ||
132 | #define AUDIT_CLASS_DIR_WRITE_32 1 | ||
133 | #define AUDIT_CLASS_CHATTR 2 | ||
134 | #define AUDIT_CLASS_CHATTR_32 3 | ||
135 | |||
129 | /* This bitmask is used to validate user input. It represents all bits that | 136 | /* This bitmask is used to validate user input. It represents all bits that |
130 | * are currently used in an audit field constant understood by the kernel. | 137 | * are currently used in an audit field constant understood by the kernel. |
131 | * If you are adding a new #define AUDIT_<whatever>, please ensure that | 138 | * If you are adding a new #define AUDIT_<whatever>, please ensure that |
@@ -150,12 +157,17 @@ | |||
150 | #define AUDIT_PERS 10 | 157 | #define AUDIT_PERS 10 |
151 | #define AUDIT_ARCH 11 | 158 | #define AUDIT_ARCH 11 |
152 | #define AUDIT_MSGTYPE 12 | 159 | #define AUDIT_MSGTYPE 12 |
153 | #define AUDIT_SE_USER 13 /* security label user */ | 160 | #define AUDIT_SUBJ_USER 13 /* security label user */ |
154 | #define AUDIT_SE_ROLE 14 /* security label role */ | 161 | #define AUDIT_SUBJ_ROLE 14 /* security label role */ |
155 | #define AUDIT_SE_TYPE 15 /* security label type */ | 162 | #define AUDIT_SUBJ_TYPE 15 /* security label type */ |
156 | #define AUDIT_SE_SEN 16 /* security label sensitivity label */ | 163 | #define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */ |
157 | #define AUDIT_SE_CLR 17 /* security label clearance label */ | 164 | #define AUDIT_SUBJ_CLR 17 /* security label clearance label */ |
158 | #define AUDIT_PPID 18 | 165 | #define AUDIT_PPID 18 |
166 | #define AUDIT_OBJ_USER 19 | ||
167 | #define AUDIT_OBJ_ROLE 20 | ||
168 | #define AUDIT_OBJ_TYPE 21 | ||
169 | #define AUDIT_OBJ_LEV_LOW 22 | ||
170 | #define AUDIT_OBJ_LEV_HIGH 23 | ||
159 | 171 | ||
160 | /* These are ONLY useful when checking | 172 | /* These are ONLY useful when checking |
161 | * at syscall exit time (AUDIT_AT_EXIT). */ | 173 | * at syscall exit time (AUDIT_AT_EXIT). */ |
@@ -171,6 +183,8 @@ | |||
171 | #define AUDIT_ARG2 (AUDIT_ARG0+2) | 183 | #define AUDIT_ARG2 (AUDIT_ARG0+2) |
172 | #define AUDIT_ARG3 (AUDIT_ARG0+3) | 184 | #define AUDIT_ARG3 (AUDIT_ARG0+3) |
173 | 185 | ||
186 | #define AUDIT_FILTERKEY 210 | ||
187 | |||
174 | #define AUDIT_NEGATE 0x80000000 | 188 | #define AUDIT_NEGATE 0x80000000 |
175 | 189 | ||
176 | /* These are the supported operators. | 190 | /* These are the supported operators. |
@@ -299,6 +313,7 @@ struct mqstat; | |||
299 | #define AUDITSC_SUCCESS 1 | 313 | #define AUDITSC_SUCCESS 1 |
300 | #define AUDITSC_FAILURE 2 | 314 | #define AUDITSC_FAILURE 2 |
301 | #define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS ) | 315 | #define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS ) |
316 | extern int __init audit_register_class(int class, unsigned *list); | ||
302 | #ifdef CONFIG_AUDITSYSCALL | 317 | #ifdef CONFIG_AUDITSYSCALL |
303 | /* These are defined in auditsc.c */ | 318 | /* These are defined in auditsc.c */ |
304 | /* Public API */ | 319 | /* Public API */ |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index a7e8cef73d15..7520cc1ff9e2 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -11,7 +11,7 @@ enum blktrace_cat { | |||
11 | BLK_TC_READ = 1 << 0, /* reads */ | 11 | BLK_TC_READ = 1 << 0, /* reads */ |
12 | BLK_TC_WRITE = 1 << 1, /* writes */ | 12 | BLK_TC_WRITE = 1 << 1, /* writes */ |
13 | BLK_TC_BARRIER = 1 << 2, /* barrier */ | 13 | BLK_TC_BARRIER = 1 << 2, /* barrier */ |
14 | BLK_TC_SYNC = 1 << 3, /* barrier */ | 14 | BLK_TC_SYNC = 1 << 3, /* sync IO */ |
15 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ | 15 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ |
16 | BLK_TC_REQUEUE = 1 << 5, /* requeueing */ | 16 | BLK_TC_REQUEUE = 1 << 5, /* requeueing */ |
17 | BLK_TC_ISSUE = 1 << 6, /* issue */ | 17 | BLK_TC_ISSUE = 1 << 6, /* issue */ |
@@ -19,6 +19,7 @@ enum blktrace_cat { | |||
19 | BLK_TC_FS = 1 << 8, /* fs requests */ | 19 | BLK_TC_FS = 1 << 8, /* fs requests */ |
20 | BLK_TC_PC = 1 << 9, /* pc requests */ | 20 | BLK_TC_PC = 1 << 9, /* pc requests */ |
21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | 21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ |
22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | ||
22 | 23 | ||
23 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 24 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
24 | }; | 25 | }; |
@@ -147,7 +148,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
147 | u32 what) | 148 | u32 what) |
148 | { | 149 | { |
149 | struct blk_trace *bt = q->blk_trace; | 150 | struct blk_trace *bt = q->blk_trace; |
150 | int rw = rq->flags & 0x07; | 151 | int rw = rq->flags & 0x03; |
151 | 152 | ||
152 | if (likely(!bt)) | 153 | if (likely(!bt)) |
153 | return; | 154 | return; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 22866fa2d960..1021f508d82c 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -91,7 +91,7 @@ static inline void *alloc_remap(int nid, unsigned long size) | |||
91 | } | 91 | } |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | extern unsigned long nr_kernel_pages; | 94 | extern unsigned long __meminitdata nr_kernel_pages; |
95 | extern unsigned long nr_all_pages; | 95 | extern unsigned long nr_all_pages; |
96 | 96 | ||
97 | extern void *__init alloc_large_system_hash(const char *tablename, | 97 | extern void *__init alloc_large_system_hash(const char *tablename, |
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild new file mode 100644 index 000000000000..84a57d4fb212 --- /dev/null +++ b/include/linux/byteorder/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | unifdef-y += generic.h swabb.h swab.h | ||
2 | header-y += big_endian.h little_endian.h pdp_endian.h | ||
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index 7b5c5df5cb69..be512cc98791 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
@@ -27,8 +27,8 @@ extern struct inode_operations coda_dir_inode_operations; | |||
27 | extern struct inode_operations coda_file_inode_operations; | 27 | extern struct inode_operations coda_file_inode_operations; |
28 | extern struct inode_operations coda_ioctl_inode_operations; | 28 | extern struct inode_operations coda_ioctl_inode_operations; |
29 | 29 | ||
30 | extern struct address_space_operations coda_file_aops; | 30 | extern const struct address_space_operations coda_file_aops; |
31 | extern struct address_space_operations coda_symlink_aops; | 31 | extern const struct address_space_operations coda_symlink_aops; |
32 | 32 | ||
33 | extern const struct file_operations coda_dir_operations; | 33 | extern const struct file_operations coda_dir_operations; |
34 | extern const struct file_operations coda_file_operations; | 34 | extern const struct file_operations coda_file_operations; |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 917d62e41480..269d000bb2a3 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -567,11 +567,6 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER) | |||
567 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST) | 567 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST) |
568 | COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST) | 568 | COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST) |
569 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT) | 569 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT) |
570 | /* DEVFS */ | ||
571 | COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV) | ||
572 | COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK) | ||
573 | COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE) | ||
574 | COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK) | ||
575 | /* Raw devices */ | 570 | /* Raw devices */ |
576 | COMPATIBLE_IOCTL(RAW_SETBIND) | 571 | COMPATIBLE_IOCTL(RAW_SETBIND) |
577 | COMPATIBLE_IOCTL(RAW_GETBIND) | 572 | COMPATIBLE_IOCTL(RAW_GETBIND) |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 90663ad217f9..268c5a4a2bd4 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -18,9 +18,24 @@ struct completion { | |||
18 | #define COMPLETION_INITIALIZER(work) \ | 18 | #define COMPLETION_INITIALIZER(work) \ |
19 | { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } | 19 | { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } |
20 | 20 | ||
21 | #define COMPLETION_INITIALIZER_ONSTACK(work) \ | ||
22 | ({ init_completion(&work); work; }) | ||
23 | |||
21 | #define DECLARE_COMPLETION(work) \ | 24 | #define DECLARE_COMPLETION(work) \ |
22 | struct completion work = COMPLETION_INITIALIZER(work) | 25 | struct completion work = COMPLETION_INITIALIZER(work) |
23 | 26 | ||
27 | /* | ||
28 | * Lockdep needs to run a non-constant initializer for on-stack | ||
29 | * completions - so we use the _ONSTACK() variant for those that | ||
30 | * are on the kernel stack: | ||
31 | */ | ||
32 | #ifdef CONFIG_LOCKDEP | ||
33 | # define DECLARE_COMPLETION_ONSTACK(work) \ | ||
34 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) | ||
35 | #else | ||
36 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) | ||
37 | #endif | ||
38 | |||
24 | static inline void init_completion(struct completion *x) | 39 | static inline void init_completion(struct completion *x) |
25 | { | 40 | { |
26 | x->done = 0; | 41 | x->done = 0; |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index f8e5587a0f92..25423f79bf9f 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -9,6 +9,7 @@ | |||
9 | * to achieve effects such as fast scrolling by changing the origin. | 9 | * to achieve effects such as fast scrolling by changing the origin. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/wait.h> | ||
12 | #include <linux/vt.h> | 13 | #include <linux/vt.h> |
13 | 14 | ||
14 | struct vt_struct; | 15 | struct vt_struct; |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index a3caf6866bae..44a11f1ccaf2 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -87,9 +87,9 @@ int cpu_down(unsigned int cpu); | |||
87 | #define lock_cpu_hotplug() do { } while (0) | 87 | #define lock_cpu_hotplug() do { } while (0) |
88 | #define unlock_cpu_hotplug() do { } while (0) | 88 | #define unlock_cpu_hotplug() do { } while (0) |
89 | #define lock_cpu_hotplug_interruptible() 0 | 89 | #define lock_cpu_hotplug_interruptible() 0 |
90 | #define hotcpu_notifier(fn, pri) | 90 | #define hotcpu_notifier(fn, pri) do { } while (0) |
91 | #define register_hotcpu_notifier(nb) | 91 | #define register_hotcpu_notifier(nb) do { } while (0) |
92 | #define unregister_hotcpu_notifier(nb) | 92 | #define unregister_hotcpu_notifier(nb) do { } while (0) |
93 | 93 | ||
94 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ | 94 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ |
95 | static inline int cpu_is_offline(int cpu) { return 0; } | 95 | static inline int cpu_is_offline(int cpu) { return 0; } |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 466fbe9e4899..35e137636b0b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -100,8 +100,10 @@ struct cpufreq_policy { | |||
100 | #define CPUFREQ_INCOMPATIBLE (1) | 100 | #define CPUFREQ_INCOMPATIBLE (1) |
101 | #define CPUFREQ_NOTIFY (2) | 101 | #define CPUFREQ_NOTIFY (2) |
102 | 102 | ||
103 | #define CPUFREQ_SHARED_TYPE_ALL (0) /* All dependent CPUs should set freq */ | 103 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ |
104 | #define CPUFREQ_SHARED_TYPE_ANY (1) /* Freq can be set from any dependent CPU */ | 104 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ |
105 | #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ | ||
106 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ | ||
105 | 107 | ||
106 | /******************** cpufreq transition notifiers *******************/ | 108 | /******************** cpufreq transition notifiers *******************/ |
107 | 109 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 0dd1610a94a9..471781ffeab1 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -114,6 +114,18 @@ struct dentry { | |||
114 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ | 114 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ |
115 | }; | 115 | }; |
116 | 116 | ||
117 | /* | ||
118 | * dentry->d_lock spinlock nesting subclasses: | ||
119 | * | ||
120 | * 0: normal | ||
121 | * 1: nested | ||
122 | */ | ||
123 | enum dentry_d_lock_class | ||
124 | { | ||
125 | DENTRY_D_LOCK_NORMAL, /* implicitly used by plain spin_lock() APIs. */ | ||
126 | DENTRY_D_LOCK_NESTED | ||
127 | }; | ||
128 | |||
117 | struct dentry_operations { | 129 | struct dentry_operations { |
118 | int (*d_revalidate)(struct dentry *, struct nameidata *); | 130 | int (*d_revalidate)(struct dentry *, struct nameidata *); |
119 | int (*d_hash) (struct dentry *, struct qstr *); | 131 | int (*d_hash) (struct dentry *, struct qstr *); |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h new file mode 100644 index 000000000000..6a7047851e48 --- /dev/null +++ b/include/linux/debug_locks.h | |||
@@ -0,0 +1,69 @@ | |||
1 | #ifndef __LINUX_DEBUG_LOCKING_H | ||
2 | #define __LINUX_DEBUG_LOCKING_H | ||
3 | |||
4 | extern int debug_locks; | ||
5 | extern int debug_locks_silent; | ||
6 | |||
7 | /* | ||
8 | * Generic 'turn off all lock debugging' function: | ||
9 | */ | ||
10 | extern int debug_locks_off(void); | ||
11 | |||
12 | /* | ||
13 | * In the debug case we carry the caller's instruction pointer into | ||
14 | * other functions, but we dont want the function argument overhead | ||
15 | * in the nondebug case - hence these macros: | ||
16 | */ | ||
17 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | ||
18 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | ||
19 | |||
20 | #define DEBUG_LOCKS_WARN_ON(c) \ | ||
21 | ({ \ | ||
22 | int __ret = 0; \ | ||
23 | \ | ||
24 | if (unlikely(c)) { \ | ||
25 | if (debug_locks_off()) \ | ||
26 | WARN_ON(1); \ | ||
27 | __ret = 1; \ | ||
28 | } \ | ||
29 | __ret; \ | ||
30 | }) | ||
31 | |||
32 | #ifdef CONFIG_SMP | ||
33 | # define SMP_DEBUG_LOCKS_WARN_ON(c) DEBUG_LOCKS_WARN_ON(c) | ||
34 | #else | ||
35 | # define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0) | ||
36 | #endif | ||
37 | |||
38 | #ifdef CONFIG_DEBUG_LOCKING_API_SELFTESTS | ||
39 | extern void locking_selftest(void); | ||
40 | #else | ||
41 | # define locking_selftest() do { } while (0) | ||
42 | #endif | ||
43 | |||
44 | #ifdef CONFIG_LOCKDEP | ||
45 | extern void debug_show_all_locks(void); | ||
46 | extern void debug_show_held_locks(struct task_struct *task); | ||
47 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); | ||
48 | extern void debug_check_no_locks_held(struct task_struct *task); | ||
49 | #else | ||
50 | static inline void debug_show_all_locks(void) | ||
51 | { | ||
52 | } | ||
53 | |||
54 | static inline void debug_show_held_locks(struct task_struct *task) | ||
55 | { | ||
56 | } | ||
57 | |||
58 | static inline void | ||
59 | debug_check_no_locks_freed(const void *from, unsigned long len) | ||
60 | { | ||
61 | } | ||
62 | |||
63 | static inline void | ||
64 | debug_check_no_locks_held(struct task_struct *task) | ||
65 | { | ||
66 | } | ||
67 | #endif | ||
68 | |||
69 | #endif | ||
diff --git a/include/linux/devfs_fs.h b/include/linux/devfs_fs.h deleted file mode 100644 index de236f431877..000000000000 --- a/include/linux/devfs_fs.h +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | #ifndef _LINUX_DEVFS_FS_H | ||
2 | #define _LINUX_DEVFS_FS_H | ||
3 | |||
4 | #include <linux/ioctl.h> | ||
5 | |||
6 | #define DEVFSD_PROTOCOL_REVISION_KERNEL 5 | ||
7 | |||
8 | #define DEVFSD_IOCTL_BASE 'd' | ||
9 | |||
10 | /* These are the various ioctls */ | ||
11 | #define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int) | ||
12 | #define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int) | ||
13 | #define DEVFSDIOC_RELEASE_EVENT_QUEUE _IOW(DEVFSD_IOCTL_BASE, 3, int) | ||
14 | #define DEVFSDIOC_SET_DEBUG_MASK _IOW(DEVFSD_IOCTL_BASE, 4, int) | ||
15 | |||
16 | #define DEVFSD_NOTIFY_REGISTERED 0 | ||
17 | #define DEVFSD_NOTIFY_UNREGISTERED 1 | ||
18 | #define DEVFSD_NOTIFY_ASYNC_OPEN 2 | ||
19 | #define DEVFSD_NOTIFY_CLOSE 3 | ||
20 | #define DEVFSD_NOTIFY_LOOKUP 4 | ||
21 | #define DEVFSD_NOTIFY_CHANGE 5 | ||
22 | #define DEVFSD_NOTIFY_CREATE 6 | ||
23 | #define DEVFSD_NOTIFY_DELETE 7 | ||
24 | |||
25 | #define DEVFS_PATHLEN 1024 /* Never change this otherwise the | ||
26 | binary interface will change */ | ||
27 | |||
28 | struct devfsd_notify_struct { /* Use native C types to ensure same types in kernel and user space */ | ||
29 | unsigned int type; /* DEVFSD_NOTIFY_* value */ | ||
30 | unsigned int mode; /* Mode of the inode or device entry */ | ||
31 | unsigned int major; /* Major number of device entry */ | ||
32 | unsigned int minor; /* Minor number of device entry */ | ||
33 | unsigned int uid; /* Uid of process, inode or device entry */ | ||
34 | unsigned int gid; /* Gid of process, inode or device entry */ | ||
35 | unsigned int overrun_count; /* Number of lost events */ | ||
36 | unsigned int namelen; /* Number of characters not including '\0' */ | ||
37 | /* The device name MUST come last */ | ||
38 | char devname[DEVFS_PATHLEN]; /* This will be '\0' terminated */ | ||
39 | }; | ||
40 | |||
41 | #endif /* _LINUX_DEVFS_FS_H */ | ||
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h deleted file mode 100644 index 0d74a6f22abc..000000000000 --- a/include/linux/devfs_fs_kernel.h +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | #ifndef _LINUX_DEVFS_FS_KERNEL_H | ||
2 | #define _LINUX_DEVFS_FS_KERNEL_H | ||
3 | |||
4 | #include <linux/fs.h> | ||
5 | #include <linux/spinlock.h> | ||
6 | #include <linux/types.h> | ||
7 | |||
8 | #include <asm/semaphore.h> | ||
9 | |||
10 | #define DEVFS_SUPER_MAGIC 0x1373 | ||
11 | |||
12 | #ifdef CONFIG_DEVFS_FS | ||
13 | extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
14 | __attribute__ ((format(printf, 3, 4))); | ||
15 | extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
16 | __attribute__ ((format(printf, 3, 4))); | ||
17 | extern int devfs_mk_symlink(const char *name, const char *link); | ||
18 | extern int devfs_mk_dir(const char *fmt, ...) | ||
19 | __attribute__ ((format(printf, 1, 2))); | ||
20 | extern void devfs_remove(const char *fmt, ...) | ||
21 | __attribute__ ((format(printf, 1, 2))); | ||
22 | extern int devfs_register_tape(const char *name); | ||
23 | extern void devfs_unregister_tape(int num); | ||
24 | extern void mount_devfs_fs(void); | ||
25 | #else /* CONFIG_DEVFS_FS */ | ||
26 | static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
27 | { | ||
28 | return 0; | ||
29 | } | ||
30 | static inline int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...) | ||
31 | { | ||
32 | return 0; | ||
33 | } | ||
34 | static inline int devfs_mk_symlink(const char *name, const char *link) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
38 | static inline int devfs_mk_dir(const char *fmt, ...) | ||
39 | { | ||
40 | return 0; | ||
41 | } | ||
42 | static inline void devfs_remove(const char *fmt, ...) | ||
43 | { | ||
44 | } | ||
45 | static inline int devfs_register_tape(const char *name) | ||
46 | { | ||
47 | return -1; | ||
48 | } | ||
49 | static inline void devfs_unregister_tape(int num) | ||
50 | { | ||
51 | } | ||
52 | static inline void mount_devfs_fs(void) | ||
53 | { | ||
54 | return; | ||
55 | } | ||
56 | #endif /* CONFIG_DEVFS_FS */ | ||
57 | #endif /* _LINUX_DEVFS_FS_KERNEL_H */ | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 272010a6078a..c94d8f1d62e5 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -44,7 +44,7 @@ enum dma_event { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * typedef dma_cookie_t | 47 | * typedef dma_cookie_t - an opaque DMA cookie |
48 | * | 48 | * |
49 | * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code | 49 | * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code |
50 | */ | 50 | */ |
@@ -80,14 +80,14 @@ struct dma_chan_percpu { | |||
80 | 80 | ||
81 | /** | 81 | /** |
82 | * struct dma_chan - devices supply DMA channels, clients use them | 82 | * struct dma_chan - devices supply DMA channels, clients use them |
83 | * @client: ptr to the client user of this chan, will be NULL when unused | 83 | * @client: ptr to the client user of this chan, will be %NULL when unused |
84 | * @device: ptr to the dma device who supplies this channel, always !NULL | 84 | * @device: ptr to the dma device who supplies this channel, always !%NULL |
85 | * @cookie: last cookie value returned to client | 85 | * @cookie: last cookie value returned to client |
86 | * @chan_id: | 86 | * @chan_id: channel ID for sysfs |
87 | * @class_dev: | 87 | * @class_dev: class device for sysfs |
88 | * @refcount: kref, used in "bigref" slow-mode | 88 | * @refcount: kref, used in "bigref" slow-mode |
89 | * @slow_ref: | 89 | * @slow_ref: indicates that the DMA channel is free |
90 | * @rcu: | 90 | * @rcu: the DMA channel's RCU head |
91 | * @client_node: used to add this to the client chan list | 91 | * @client_node: used to add this to the client chan list |
92 | * @device_node: used to add this to the device chan list | 92 | * @device_node: used to add this to the device chan list |
93 | * @local: per-cpu pointer to a struct dma_chan_percpu | 93 | * @local: per-cpu pointer to a struct dma_chan_percpu |
@@ -162,10 +162,17 @@ struct dma_client { | |||
162 | * @chancnt: how many DMA channels are supported | 162 | * @chancnt: how many DMA channels are supported |
163 | * @channels: the list of struct dma_chan | 163 | * @channels: the list of struct dma_chan |
164 | * @global_node: list_head for global dma_device_list | 164 | * @global_node: list_head for global dma_device_list |
165 | * @refcount: | 165 | * @refcount: reference count |
166 | * @done: | 166 | * @done: IO completion struct |
167 | * @dev_id: | 167 | * @dev_id: unique device ID |
168 | * Other func ptrs: used to make use of this device's capabilities | 168 | * @device_alloc_chan_resources: allocate resources and return the |
169 | * number of allocated descriptors | ||
170 | * @device_free_chan_resources: release DMA channel's resources | ||
171 | * @device_memcpy_buf_to_buf: memcpy buf pointer to buf pointer | ||
172 | * @device_memcpy_buf_to_pg: memcpy buf pointer to struct page | ||
173 | * @device_memcpy_pg_to_pg: memcpy struct page/offset to struct page/offset | ||
174 | * @device_memcpy_complete: poll the status of an IOAT DMA transaction | ||
175 | * @device_memcpy_issue_pending: push appended descriptors to hardware | ||
169 | */ | 176 | */ |
170 | struct dma_device { | 177 | struct dma_device { |
171 | 178 | ||
@@ -211,7 +218,7 @@ void dma_async_client_chan_request(struct dma_client *client, | |||
211 | * Both @dest and @src must be mappable to a bus address according to the | 218 | * Both @dest and @src must be mappable to a bus address according to the |
212 | * DMA mapping API rules for streaming mappings. | 219 | * DMA mapping API rules for streaming mappings. |
213 | * Both @dest and @src must stay memory resident (kernel memory or locked | 220 | * Both @dest and @src must stay memory resident (kernel memory or locked |
214 | * user space pages) | 221 | * user space pages). |
215 | */ | 222 | */ |
216 | static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | 223 | static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
217 | void *dest, void *src, size_t len) | 224 | void *dest, void *src, size_t len) |
@@ -225,7 +232,7 @@ static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | |||
225 | } | 232 | } |
226 | 233 | ||
227 | /** | 234 | /** |
228 | * dma_async_memcpy_buf_to_pg - offloaded copy | 235 | * dma_async_memcpy_buf_to_pg - offloaded copy from address to page |
229 | * @chan: DMA channel to offload copy to | 236 | * @chan: DMA channel to offload copy to |
230 | * @page: destination page | 237 | * @page: destination page |
231 | * @offset: offset in page to copy to | 238 | * @offset: offset in page to copy to |
@@ -250,18 +257,18 @@ static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, | |||
250 | } | 257 | } |
251 | 258 | ||
252 | /** | 259 | /** |
253 | * dma_async_memcpy_buf_to_pg - offloaded copy | 260 | * dma_async_memcpy_pg_to_pg - offloaded copy from page to page |
254 | * @chan: DMA channel to offload copy to | 261 | * @chan: DMA channel to offload copy to |
255 | * @dest_page: destination page | 262 | * @dest_pg: destination page |
256 | * @dest_off: offset in page to copy to | 263 | * @dest_off: offset in page to copy to |
257 | * @src_page: source page | 264 | * @src_pg: source page |
258 | * @src_off: offset in page to copy from | 265 | * @src_off: offset in page to copy from |
259 | * @len: length | 266 | * @len: length |
260 | * | 267 | * |
261 | * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus | 268 | * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus |
262 | * address according to the DMA mapping API rules for streaming mappings. | 269 | * address according to the DMA mapping API rules for streaming mappings. |
263 | * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident | 270 | * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident |
264 | * (kernel memory or locked user space pages) | 271 | * (kernel memory or locked user space pages). |
265 | */ | 272 | */ |
266 | static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan, | 273 | static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan, |
267 | struct page *dest_pg, unsigned int dest_off, struct page *src_pg, | 274 | struct page *dest_pg, unsigned int dest_off, struct page *src_pg, |
@@ -278,7 +285,7 @@ static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan, | |||
278 | 285 | ||
279 | /** | 286 | /** |
280 | * dma_async_memcpy_issue_pending - flush pending copies to HW | 287 | * dma_async_memcpy_issue_pending - flush pending copies to HW |
281 | * @chan: | 288 | * @chan: target DMA channel |
282 | * | 289 | * |
283 | * This allows drivers to push copies to HW in batches, | 290 | * This allows drivers to push copies to HW in batches, |
284 | * reducing MMIO writes where possible. | 291 | * reducing MMIO writes where possible. |
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h index 2fda1b2aabd9..527504c11c5e 100644 --- a/include/linux/dqblk_xfs.h +++ b/include/linux/dqblk_xfs.h | |||
@@ -125,14 +125,14 @@ typedef struct fs_disk_quota { | |||
125 | 125 | ||
126 | /* | 126 | /* |
127 | * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system. | 127 | * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system. |
128 | * Provides a centralized way to get meta infomation about the quota subsystem. | 128 | * Provides a centralized way to get meta information about the quota subsystem. |
129 | * eg. space taken up for user and group quotas, number of dquots currently | 129 | * eg. space taken up for user and group quotas, number of dquots currently |
130 | * incore. | 130 | * incore. |
131 | */ | 131 | */ |
132 | #define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */ | 132 | #define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */ |
133 | 133 | ||
134 | /* | 134 | /* |
135 | * Some basic infomation about 'quota files'. | 135 | * Some basic information about 'quota files'. |
136 | */ | 136 | */ |
137 | typedef struct fs_qfilestat { | 137 | typedef struct fs_qfilestat { |
138 | __u64 qfs_ino; /* inode number */ | 138 | __u64 qfs_ino; /* inode number */ |
diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild new file mode 100644 index 000000000000..63973af72fd5 --- /dev/null +++ b/include/linux/dvb/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y += ca.h frontend.h net.h osd.h version.h | ||
2 | unifdef-y := audio.h dmx.h video.h | ||
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index fbfa6b52e2fb..278ef4495819 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
@@ -38,7 +38,7 @@ struct statfs; | |||
38 | 38 | ||
39 | extern struct inode_operations efs_dir_inode_operations; | 39 | extern struct inode_operations efs_dir_inode_operations; |
40 | extern const struct file_operations efs_dir_operations; | 40 | extern const struct file_operations efs_dir_operations; |
41 | extern struct address_space_operations efs_symlink_aops; | 41 | extern const struct address_space_operations efs_symlink_aops; |
42 | 42 | ||
43 | extern void efs_read_inode(struct inode *); | 43 | extern void efs_read_inode(struct inode *); |
44 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); | 44 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); |
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h index 114a96d25652..6a5796c81c90 100644 --- a/include/linux/elf-em.h +++ b/include/linux/elf-em.h | |||
@@ -11,7 +11,12 @@ | |||
11 | #define EM_486 6 /* Perhaps disused */ | 11 | #define EM_486 6 /* Perhaps disused */ |
12 | #define EM_860 7 | 12 | #define EM_860 7 |
13 | #define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ | 13 | #define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ |
14 | /* Next two are historical and binaries and | ||
15 | modules of these types will be rejected by | ||
16 | Linux. */ | ||
17 | #define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ | ||
14 | #define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */ | 18 | #define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */ |
19 | |||
15 | #define EM_PARISC 15 /* HPPA */ | 20 | #define EM_PARISC 15 /* HPPA */ |
16 | #define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ | 21 | #define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ |
17 | #define EM_PPC 20 /* PowerPC */ | 22 | #define EM_PPC 20 /* PowerPC */ |
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 0cf0bea010fe..9631dddae348 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
@@ -60,6 +60,16 @@ struct elf_prstatus | |||
60 | long pr_instr; /* Current instruction */ | 60 | long pr_instr; /* Current instruction */ |
61 | #endif | 61 | #endif |
62 | elf_gregset_t pr_reg; /* GP registers */ | 62 | elf_gregset_t pr_reg; /* GP registers */ |
63 | #ifdef CONFIG_BINFMT_ELF_FDPIC | ||
64 | /* When using FDPIC, the loadmap addresses need to be communicated | ||
65 | * to GDB in order for GDB to do the necessary relocations. The | ||
66 | * fields (below) used to communicate this information are placed | ||
67 | * immediately after ``pr_reg'', so that the loadmap addresses may | ||
68 | * be viewed as part of the register set if so desired. | ||
69 | */ | ||
70 | unsigned long pr_exec_fdpic_loadmap; | ||
71 | unsigned long pr_interp_fdpic_loadmap; | ||
72 | #endif | ||
63 | int pr_fpvalid; /* True if math co-processor being used. */ | 73 | int pr_fpvalid; /* True if math co-processor being used. */ |
64 | }; | 74 | }; |
65 | 75 | ||
diff --git a/include/linux/err.h b/include/linux/err.h index ff71d2af5da3..cd3b367f7445 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
@@ -13,7 +13,9 @@ | |||
13 | * This should be a per-architecture thing, to allow different | 13 | * This should be a per-architecture thing, to allow different |
14 | * error and pointer decisions. | 14 | * error and pointer decisions. |
15 | */ | 15 | */ |
16 | #define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L) | 16 | #define MAX_ERRNO 4095 |
17 | |||
18 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) | ||
17 | 19 | ||
18 | static inline void *ERR_PTR(long error) | 20 | static inline void *ERR_PTR(long error) |
19 | { | 21 | { |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 07a08e92bc73..405f44e44e5d 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -377,10 +377,8 @@ struct fb_cursor { | |||
377 | 377 | ||
378 | #include <linux/fs.h> | 378 | #include <linux/fs.h> |
379 | #include <linux/init.h> | 379 | #include <linux/init.h> |
380 | #include <linux/tty.h> | ||
381 | #include <linux/device.h> | 380 | #include <linux/device.h> |
382 | #include <linux/workqueue.h> | 381 | #include <linux/workqueue.h> |
383 | #include <linux/devfs_fs_kernel.h> | ||
384 | #include <linux/notifier.h> | 382 | #include <linux/notifier.h> |
385 | #include <linux/list.h> | 383 | #include <linux/list.h> |
386 | #include <asm/io.h> | 384 | #include <asm/io.h> |
@@ -558,7 +556,7 @@ struct fb_pixmap { | |||
558 | * Frame buffer operations | 556 | * Frame buffer operations |
559 | * | 557 | * |
560 | * LOCKING NOTE: those functions must _ALL_ be called with the console | 558 | * LOCKING NOTE: those functions must _ALL_ be called with the console |
561 | * semaphore held, this is the only suitable locking mecanism we have | 559 | * semaphore held, this is the only suitable locking mechanism we have |
562 | * in 2.6. Some may be called at interrupt time at this point though. | 560 | * in 2.6. Some may be called at interrupt time at this point though. |
563 | */ | 561 | */ |
564 | 562 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 2d8b348c1192..25610205c90d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -27,6 +27,10 @@ | |||
27 | #define BLOCK_SIZE_BITS 10 | 27 | #define BLOCK_SIZE_BITS 10 |
28 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) | 28 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) |
29 | 29 | ||
30 | #define SEEK_SET 0 /* seek relative to beginning of file */ | ||
31 | #define SEEK_CUR 1 /* seek relative to current file position */ | ||
32 | #define SEEK_END 2 /* seek relative to end of file */ | ||
33 | |||
30 | /* And dynamically-tunable limits and defaults: */ | 34 | /* And dynamically-tunable limits and defaults: */ |
31 | struct files_stat_struct { | 35 | struct files_stat_struct { |
32 | int nr_files; /* read only */ | 36 | int nr_files; /* read only */ |
@@ -392,7 +396,7 @@ struct address_space { | |||
392 | unsigned int truncate_count; /* Cover race condition with truncate */ | 396 | unsigned int truncate_count; /* Cover race condition with truncate */ |
393 | unsigned long nrpages; /* number of total pages */ | 397 | unsigned long nrpages; /* number of total pages */ |
394 | pgoff_t writeback_index;/* writeback starts here */ | 398 | pgoff_t writeback_index;/* writeback starts here */ |
395 | struct address_space_operations *a_ops; /* methods */ | 399 | const struct address_space_operations *a_ops; /* methods */ |
396 | unsigned long flags; /* error bits/gfp mask */ | 400 | unsigned long flags; /* error bits/gfp mask */ |
397 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ | 401 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ |
398 | spinlock_t private_lock; /* for use by the address_space */ | 402 | spinlock_t private_lock; /* for use by the address_space */ |
@@ -436,6 +440,21 @@ struct block_device { | |||
436 | }; | 440 | }; |
437 | 441 | ||
438 | /* | 442 | /* |
443 | * bdev->bd_mutex nesting subclasses for the lock validator: | ||
444 | * | ||
445 | * 0: normal | ||
446 | * 1: 'whole' | ||
447 | * 2: 'partition' | ||
448 | */ | ||
449 | enum bdev_bd_mutex_lock_class | ||
450 | { | ||
451 | BD_MUTEX_NORMAL, | ||
452 | BD_MUTEX_WHOLE, | ||
453 | BD_MUTEX_PARTITION | ||
454 | }; | ||
455 | |||
456 | |||
457 | /* | ||
439 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache | 458 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache |
440 | * radix trees | 459 | * radix trees |
441 | */ | 460 | */ |
@@ -543,6 +562,25 @@ struct inode { | |||
543 | }; | 562 | }; |
544 | 563 | ||
545 | /* | 564 | /* |
565 | * inode->i_mutex nesting subclasses for the lock validator: | ||
566 | * | ||
567 | * 0: the object of the current VFS operation | ||
568 | * 1: parent | ||
569 | * 2: child/target | ||
570 | * 3: quota file | ||
571 | * | ||
572 | * The locking order between these classes is | ||
573 | * parent -> child -> normal -> quota | ||
574 | */ | ||
575 | enum inode_i_mutex_lock_class | ||
576 | { | ||
577 | I_MUTEX_NORMAL, | ||
578 | I_MUTEX_PARENT, | ||
579 | I_MUTEX_CHILD, | ||
580 | I_MUTEX_QUOTA | ||
581 | }; | ||
582 | |||
583 | /* | ||
546 | * NOTE: in a 32bit arch with a preemptable kernel and | 584 | * NOTE: in a 32bit arch with a preemptable kernel and |
547 | * an UP compile the i_size_read/write must be atomic | 585 | * an UP compile the i_size_read/write must be atomic |
548 | * with respect to the local cpu (unlike with preempt disabled), | 586 | * with respect to the local cpu (unlike with preempt disabled), |
@@ -682,6 +720,7 @@ extern spinlock_t files_lock; | |||
682 | #define FL_POSIX 1 | 720 | #define FL_POSIX 1 |
683 | #define FL_FLOCK 2 | 721 | #define FL_FLOCK 2 |
684 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 722 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
723 | #define FL_EXISTS 16 /* when unlocking, test for existence */ | ||
685 | #define FL_LEASE 32 /* lease held on this file */ | 724 | #define FL_LEASE 32 /* lease held on this file */ |
686 | #define FL_CLOSE 64 /* unlock on close */ | 725 | #define FL_CLOSE 64 /* unlock on close */ |
687 | #define FL_SLEEP 128 /* A blocking lock */ | 726 | #define FL_SLEEP 128 /* A blocking lock */ |
@@ -1276,6 +1315,8 @@ struct file_system_type { | |||
1276 | struct module *owner; | 1315 | struct module *owner; |
1277 | struct file_system_type * next; | 1316 | struct file_system_type * next; |
1278 | struct list_head fs_supers; | 1317 | struct list_head fs_supers; |
1318 | struct lock_class_key s_lock_key; | ||
1319 | struct lock_class_key s_umount_key; | ||
1279 | }; | 1320 | }; |
1280 | 1321 | ||
1281 | extern int get_sb_bdev(struct file_system_type *fs_type, | 1322 | extern int get_sb_bdev(struct file_system_type *fs_type, |
@@ -1404,8 +1445,9 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1404 | extern void bd_forget(struct inode *inode); | 1445 | extern void bd_forget(struct inode *inode); |
1405 | extern void bdput(struct block_device *); | 1446 | extern void bdput(struct block_device *); |
1406 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1447 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1448 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | ||
1407 | extern const struct file_operations def_blk_fops; | 1449 | extern const struct file_operations def_blk_fops; |
1408 | extern struct address_space_operations def_blk_aops; | 1450 | extern const struct address_space_operations def_blk_aops; |
1409 | extern const struct file_operations def_chr_fops; | 1451 | extern const struct file_operations def_chr_fops; |
1410 | extern const struct file_operations bad_sock_fops; | 1452 | extern const struct file_operations bad_sock_fops; |
1411 | extern const struct file_operations def_fifo_fops; | 1453 | extern const struct file_operations def_fifo_fops; |
@@ -1414,6 +1456,7 @@ extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | |||
1414 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1456 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1415 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1457 | extern int blkdev_get(struct block_device *, mode_t, unsigned); |
1416 | extern int blkdev_put(struct block_device *); | 1458 | extern int blkdev_put(struct block_device *); |
1459 | extern int blkdev_put_partition(struct block_device *); | ||
1417 | extern int bd_claim(struct block_device *, void *); | 1460 | extern int bd_claim(struct block_device *, void *); |
1418 | extern void bd_release(struct block_device *); | 1461 | extern void bd_release(struct block_device *); |
1419 | #ifdef CONFIG_SYSFS | 1462 | #ifdef CONFIG_SYSFS |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 3498a0c68184..e4af57e87c17 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -112,8 +112,6 @@ struct gendisk { | |||
112 | sector_t capacity; | 112 | sector_t capacity; |
113 | 113 | ||
114 | int flags; | 114 | int flags; |
115 | char devfs_name[64]; /* devfs crap */ | ||
116 | int number; /* more of the same */ | ||
117 | struct device *driverfs_dev; | 115 | struct device *driverfs_dev; |
118 | struct kobject kobj; | 116 | struct kobject kobj; |
119 | struct kobject *holder_dir; | 117 | struct kobject *holder_dir; |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 114ae583cca9..50d8b5744cf6 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #include <linux/smp_lock.h> | 5 | #include <linux/smp_lock.h> |
6 | #include <linux/lockdep.h> | ||
6 | #include <asm/hardirq.h> | 7 | #include <asm/hardirq.h> |
7 | #include <asm/system.h> | 8 | #include <asm/system.h> |
8 | 9 | ||
@@ -86,9 +87,6 @@ extern void synchronize_irq(unsigned int irq); | |||
86 | # define synchronize_irq(irq) barrier() | 87 | # define synchronize_irq(irq) barrier() |
87 | #endif | 88 | #endif |
88 | 89 | ||
89 | #define nmi_enter() irq_enter() | ||
90 | #define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET) | ||
91 | |||
92 | struct task_struct; | 90 | struct task_struct; |
93 | 91 | ||
94 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 92 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING |
@@ -97,12 +95,35 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
97 | } | 95 | } |
98 | #endif | 96 | #endif |
99 | 97 | ||
98 | /* | ||
99 | * It is safe to do non-atomic ops on ->hardirq_context, | ||
100 | * because NMI handlers may not preempt and the ops are | ||
101 | * always balanced, so the interrupted value of ->hardirq_context | ||
102 | * will always be restored. | ||
103 | */ | ||
100 | #define irq_enter() \ | 104 | #define irq_enter() \ |
101 | do { \ | 105 | do { \ |
102 | account_system_vtime(current); \ | 106 | account_system_vtime(current); \ |
103 | add_preempt_count(HARDIRQ_OFFSET); \ | 107 | add_preempt_count(HARDIRQ_OFFSET); \ |
108 | trace_hardirq_enter(); \ | ||
109 | } while (0) | ||
110 | |||
111 | /* | ||
112 | * Exit irq context without processing softirqs: | ||
113 | */ | ||
114 | #define __irq_exit() \ | ||
115 | do { \ | ||
116 | trace_hardirq_exit(); \ | ||
117 | account_system_vtime(current); \ | ||
118 | sub_preempt_count(HARDIRQ_OFFSET); \ | ||
104 | } while (0) | 119 | } while (0) |
105 | 120 | ||
121 | /* | ||
122 | * Exit irq context and process softirqs if needed: | ||
123 | */ | ||
106 | extern void irq_exit(void); | 124 | extern void irq_exit(void); |
107 | 125 | ||
126 | #define nmi_enter() do { lockdep_off(); irq_enter(); } while (0) | ||
127 | #define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0) | ||
128 | |||
108 | #endif /* LINUX_HARDIRQ_H */ | 129 | #endif /* LINUX_HARDIRQ_H */ |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 4513f9e40937..d5ebbb29aeae 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -224,8 +224,6 @@ static __inline__ void debug_frame(const struct sk_buff *skb) | |||
224 | int hdlc_open(struct net_device *dev); | 224 | int hdlc_open(struct net_device *dev); |
225 | /* Must be called by hardware driver when HDLC device is being closed */ | 225 | /* Must be called by hardware driver when HDLC device is being closed */ |
226 | void hdlc_close(struct net_device *dev); | 226 | void hdlc_close(struct net_device *dev); |
227 | /* Called by hardware driver when DCD line level changes */ | ||
228 | void hdlc_set_carrier(int on, struct net_device *dev); | ||
229 | 227 | ||
230 | /* May be used by hardware driver to gain control over HDLC device */ | 228 | /* May be used by hardware driver to gain control over HDLC device */ |
231 | static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) | 229 | static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) |
diff --git a/include/linux/hdlc/Kbuild b/include/linux/hdlc/Kbuild new file mode 100644 index 000000000000..1fb26448faa9 --- /dev/null +++ b/include/linux/hdlc/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y += ioctl.h | |||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 07d7305f131e..e4bccbcc2750 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -91,6 +91,7 @@ struct hrtimer_base { | |||
91 | ktime_t (*get_softirq_time)(void); | 91 | ktime_t (*get_softirq_time)(void); |
92 | struct hrtimer *curr_timer; | 92 | struct hrtimer *curr_timer; |
93 | ktime_t softirq_time; | 93 | ktime_t softirq_time; |
94 | struct lock_class_key lock_key; | ||
94 | }; | 95 | }; |
95 | 96 | ||
96 | /* | 97 | /* |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 526ddc8eecfb..eb0628a7ecc6 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -193,6 +193,8 @@ struct i2c_algorithm { | |||
193 | to NULL. If an adapter algorithm can do SMBus access, set | 193 | to NULL. If an adapter algorithm can do SMBus access, set |
194 | smbus_xfer. If set to NULL, the SMBus protocol is simulated | 194 | smbus_xfer. If set to NULL, the SMBus protocol is simulated |
195 | using common I2C messages */ | 195 | using common I2C messages */ |
196 | /* master_xfer should return the number of messages successfully | ||
197 | processed, or a negative value on error */ | ||
196 | int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, | 198 | int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, |
197 | int num); | 199 | int num); |
198 | int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, | 200 | int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, |
diff --git a/include/linux/ide.h b/include/linux/ide.h index ef7bef207f48..dc7abef10965 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -552,7 +552,6 @@ typedef struct ide_drive_s { | |||
552 | struct hd_driveid *id; /* drive model identification info */ | 552 | struct hd_driveid *id; /* drive model identification info */ |
553 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 553 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
554 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ | 554 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ |
555 | char devfs_name[64]; /* devfs crap */ | ||
556 | 555 | ||
557 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ | 556 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ |
558 | 557 | ||
@@ -793,6 +792,7 @@ typedef struct hwif_s { | |||
793 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 792 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
794 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 793 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
795 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | 794 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ |
795 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ | ||
796 | 796 | ||
797 | struct device gendev; | 797 | struct device gendev; |
798 | struct completion gendev_rel_comp; /* To deal with device release() */ | 798 | struct completion gendev_rel_comp; /* To deal with device release() */ |
@@ -1359,7 +1359,7 @@ extern struct semaphore ide_cfg_sem; | |||
1359 | * ide_drive_t->hwif: constant, no locking | 1359 | * ide_drive_t->hwif: constant, no locking |
1360 | */ | 1360 | */ |
1361 | 1361 | ||
1362 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable(); } while (0) | 1362 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) |
1363 | 1363 | ||
1364 | extern struct bus_type ide_bus_type; | 1364 | extern struct bus_type ide_bus_type; |
1365 | 1365 | ||
diff --git a/include/linux/idr.h b/include/linux/idr.h index f559a719dbe8..826803449db7 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -66,7 +66,7 @@ struct idr { | |||
66 | .id_free = NULL, \ | 66 | .id_free = NULL, \ |
67 | .layers = 0, \ | 67 | .layers = 0, \ |
68 | .id_free_cnt = 0, \ | 68 | .id_free_cnt = 0, \ |
69 | .lock = SPIN_LOCK_UNLOCKED, \ | 69 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ |
70 | } | 70 | } |
71 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) | 71 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) |
72 | 72 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 3a256957fb56..60aac2cea0cf 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/file.h> | 4 | #include <linux/file.h> |
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | #include <linux/irqflags.h> | ||
7 | #include <linux/lockdep.h> | ||
6 | 8 | ||
7 | #define INIT_FDTABLE \ | 9 | #define INIT_FDTABLE \ |
8 | { \ | 10 | { \ |
@@ -21,7 +23,7 @@ | |||
21 | .count = ATOMIC_INIT(1), \ | 23 | .count = ATOMIC_INIT(1), \ |
22 | .fdt = &init_files.fdtab, \ | 24 | .fdt = &init_files.fdtab, \ |
23 | .fdtab = INIT_FDTABLE, \ | 25 | .fdtab = INIT_FDTABLE, \ |
24 | .file_lock = SPIN_LOCK_UNLOCKED, \ | 26 | .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), \ |
25 | .next_fd = 0, \ | 27 | .next_fd = 0, \ |
26 | .close_on_exec_init = { { 0, } }, \ | 28 | .close_on_exec_init = { { 0, } }, \ |
27 | .open_fds_init = { { 0, } }, \ | 29 | .open_fds_init = { { 0, } }, \ |
@@ -36,7 +38,7 @@ | |||
36 | .user_id = 0, \ | 38 | .user_id = 0, \ |
37 | .next = NULL, \ | 39 | .next = NULL, \ |
38 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \ | 40 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \ |
39 | .ctx_lock = SPIN_LOCK_UNLOCKED, \ | 41 | .ctx_lock = __SPIN_LOCK_UNLOCKED(name.ctx_lock), \ |
40 | .reqs_active = 0U, \ | 42 | .reqs_active = 0U, \ |
41 | .max_reqs = ~0U, \ | 43 | .max_reqs = ~0U, \ |
42 | } | 44 | } |
@@ -48,7 +50,7 @@ | |||
48 | .mm_users = ATOMIC_INIT(2), \ | 50 | .mm_users = ATOMIC_INIT(2), \ |
49 | .mm_count = ATOMIC_INIT(1), \ | 51 | .mm_count = ATOMIC_INIT(1), \ |
50 | .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \ | 52 | .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \ |
51 | .page_table_lock = SPIN_LOCK_UNLOCKED, \ | 53 | .page_table_lock = __SPIN_LOCK_UNLOCKED(name.page_table_lock), \ |
52 | .mmlist = LIST_HEAD_INIT(name.mmlist), \ | 54 | .mmlist = LIST_HEAD_INIT(name.mmlist), \ |
53 | .cpu_vm_mask = CPU_MASK_ALL, \ | 55 | .cpu_vm_mask = CPU_MASK_ALL, \ |
54 | } | 56 | } |
@@ -69,7 +71,7 @@ | |||
69 | #define INIT_SIGHAND(sighand) { \ | 71 | #define INIT_SIGHAND(sighand) { \ |
70 | .count = ATOMIC_INIT(1), \ | 72 | .count = ATOMIC_INIT(1), \ |
71 | .action = { { { .sa_handler = NULL, } }, }, \ | 73 | .action = { { { .sa_handler = NULL, } }, }, \ |
72 | .siglock = SPIN_LOCK_UNLOCKED, \ | 74 | .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \ |
73 | } | 75 | } |
74 | 76 | ||
75 | extern struct group_info init_groups; | 77 | extern struct group_info init_groups; |
@@ -119,12 +121,13 @@ extern struct group_info init_groups; | |||
119 | .list = LIST_HEAD_INIT(tsk.pending.list), \ | 121 | .list = LIST_HEAD_INIT(tsk.pending.list), \ |
120 | .signal = {{0}}}, \ | 122 | .signal = {{0}}}, \ |
121 | .blocked = {{0}}, \ | 123 | .blocked = {{0}}, \ |
122 | .alloc_lock = SPIN_LOCK_UNLOCKED, \ | 124 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ |
123 | .journal_info = NULL, \ | 125 | .journal_info = NULL, \ |
124 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 126 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
125 | .fs_excl = ATOMIC_INIT(0), \ | 127 | .fs_excl = ATOMIC_INIT(0), \ |
126 | .pi_lock = SPIN_LOCK_UNLOCKED, \ | 128 | .pi_lock = SPIN_LOCK_UNLOCKED, \ |
127 | INIT_RT_MUTEXES(tsk) \ | 129 | INIT_TRACE_IRQFLAGS \ |
130 | INIT_LOCKDEP \ | ||
128 | } | 131 | } |
129 | 132 | ||
130 | 133 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 70741e170114..d5afee95fd43 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -10,10 +10,60 @@ | |||
10 | #include <linux/irqreturn.h> | 10 | #include <linux/irqreturn.h> |
11 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/irqflags.h> | ||
13 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
14 | #include <asm/ptrace.h> | 15 | #include <asm/ptrace.h> |
15 | #include <asm/system.h> | 16 | #include <asm/system.h> |
16 | 17 | ||
18 | /* | ||
19 | * These correspond to the IORESOURCE_IRQ_* defines in | ||
20 | * linux/ioport.h to select the interrupt line behaviour. When | ||
21 | * requesting an interrupt without specifying a IRQF_TRIGGER, the | ||
22 | * setting should be assumed to be "as already configured", which | ||
23 | * may be as per machine or firmware initialisation. | ||
24 | */ | ||
25 | #define IRQF_TRIGGER_NONE 0x00000000 | ||
26 | #define IRQF_TRIGGER_RISING 0x00000001 | ||
27 | #define IRQF_TRIGGER_FALLING 0x00000002 | ||
28 | #define IRQF_TRIGGER_HIGH 0x00000004 | ||
29 | #define IRQF_TRIGGER_LOW 0x00000008 | ||
30 | #define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \ | ||
31 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING) | ||
32 | #define IRQF_TRIGGER_PROBE 0x00000010 | ||
33 | |||
34 | /* | ||
35 | * These flags used only by the kernel as part of the | ||
36 | * irq handling routines. | ||
37 | * | ||
38 | * IRQF_DISABLED - keep irqs disabled when calling the action handler | ||
39 | * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator | ||
40 | * IRQF_SHARED - allow sharing the irq among several devices | ||
41 | * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur | ||
42 | * IRQF_TIMER - Flag to mark this interrupt as timer interrupt | ||
43 | */ | ||
44 | #define IRQF_DISABLED 0x00000020 | ||
45 | #define IRQF_SAMPLE_RANDOM 0x00000040 | ||
46 | #define IRQF_SHARED 0x00000080 | ||
47 | #define IRQF_PROBE_SHARED 0x00000100 | ||
48 | #define IRQF_TIMER 0x00000200 | ||
49 | #define IRQF_PERCPU 0x00000400 | ||
50 | |||
51 | /* | ||
52 | * Migration helpers. Scheduled for removal in 1/2007 | ||
53 | * Do not use for new code ! | ||
54 | */ | ||
55 | #define SA_INTERRUPT IRQF_DISABLED | ||
56 | #define SA_SAMPLE_RANDOM IRQF_SAMPLE_RANDOM | ||
57 | #define SA_SHIRQ IRQF_SHARED | ||
58 | #define SA_PROBEIRQ IRQF_PROBE_SHARED | ||
59 | #define SA_PERCPU IRQF_PERCPU | ||
60 | |||
61 | #define SA_TRIGGER_LOW IRQF_TRIGGER_LOW | ||
62 | #define SA_TRIGGER_HIGH IRQF_TRIGGER_HIGH | ||
63 | #define SA_TRIGGER_FALLING IRQF_TRIGGER_FALLING | ||
64 | #define SA_TRIGGER_RISING IRQF_TRIGGER_RISING | ||
65 | #define SA_TRIGGER_MASK IRQF_TRIGGER_MASK | ||
66 | |||
17 | struct irqaction { | 67 | struct irqaction { |
18 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 68 | irqreturn_t (*handler)(int, void *, struct pt_regs *); |
19 | unsigned long flags; | 69 | unsigned long flags; |
@@ -31,12 +81,90 @@ extern int request_irq(unsigned int, | |||
31 | unsigned long, const char *, void *); | 81 | unsigned long, const char *, void *); |
32 | extern void free_irq(unsigned int, void *); | 82 | extern void free_irq(unsigned int, void *); |
33 | 83 | ||
84 | /* | ||
85 | * On lockdep we dont want to enable hardirqs in hardirq | ||
86 | * context. Use local_irq_enable_in_hardirq() to annotate | ||
87 | * kernel code that has to do this nevertheless (pretty much | ||
88 | * the only valid case is for old/broken hardware that is | ||
89 | * insanely slow). | ||
90 | * | ||
91 | * NOTE: in theory this might break fragile code that relies | ||
92 | * on hardirq delivery - in practice we dont seem to have such | ||
93 | * places left. So the only effect should be slightly increased | ||
94 | * irqs-off latencies. | ||
95 | */ | ||
96 | #ifdef CONFIG_LOCKDEP | ||
97 | # define local_irq_enable_in_hardirq() do { } while (0) | ||
98 | #else | ||
99 | # define local_irq_enable_in_hardirq() local_irq_enable() | ||
100 | #endif | ||
34 | 101 | ||
35 | #ifdef CONFIG_GENERIC_HARDIRQS | 102 | #ifdef CONFIG_GENERIC_HARDIRQS |
36 | extern void disable_irq_nosync(unsigned int irq); | 103 | extern void disable_irq_nosync(unsigned int irq); |
37 | extern void disable_irq(unsigned int irq); | 104 | extern void disable_irq(unsigned int irq); |
38 | extern void enable_irq(unsigned int irq); | 105 | extern void enable_irq(unsigned int irq); |
106 | |||
107 | /* | ||
108 | * Special lockdep variants of irq disabling/enabling. | ||
109 | * These should be used for locking constructs that | ||
110 | * know that a particular irq context which is disabled, | ||
111 | * and which is the only irq-context user of a lock, | ||
112 | * that it's safe to take the lock in the irq-disabled | ||
113 | * section without disabling hardirqs. | ||
114 | * | ||
115 | * On !CONFIG_LOCKDEP they are equivalent to the normal | ||
116 | * irq disable/enable methods. | ||
117 | */ | ||
118 | static inline void disable_irq_nosync_lockdep(unsigned int irq) | ||
119 | { | ||
120 | disable_irq_nosync(irq); | ||
121 | #ifdef CONFIG_LOCKDEP | ||
122 | local_irq_disable(); | ||
123 | #endif | ||
124 | } | ||
125 | |||
126 | static inline void disable_irq_lockdep(unsigned int irq) | ||
127 | { | ||
128 | disable_irq(irq); | ||
129 | #ifdef CONFIG_LOCKDEP | ||
130 | local_irq_disable(); | ||
39 | #endif | 131 | #endif |
132 | } | ||
133 | |||
134 | static inline void enable_irq_lockdep(unsigned int irq) | ||
135 | { | ||
136 | #ifdef CONFIG_LOCKDEP | ||
137 | local_irq_enable(); | ||
138 | #endif | ||
139 | enable_irq(irq); | ||
140 | } | ||
141 | |||
142 | /* IRQ wakeup (PM) control: */ | ||
143 | extern int set_irq_wake(unsigned int irq, unsigned int on); | ||
144 | |||
145 | static inline int enable_irq_wake(unsigned int irq) | ||
146 | { | ||
147 | return set_irq_wake(irq, 1); | ||
148 | } | ||
149 | |||
150 | static inline int disable_irq_wake(unsigned int irq) | ||
151 | { | ||
152 | return set_irq_wake(irq, 0); | ||
153 | } | ||
154 | |||
155 | #else /* !CONFIG_GENERIC_HARDIRQS */ | ||
156 | /* | ||
157 | * NOTE: non-genirq architectures, if they want to support the lock | ||
158 | * validator need to define the methods below in their asm/irq.h | ||
159 | * files, under an #ifdef CONFIG_LOCKDEP section. | ||
160 | */ | ||
161 | # ifndef CONFIG_LOCKDEP | ||
162 | # define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq) | ||
163 | # define disable_irq_lockdep(irq) disable_irq(irq) | ||
164 | # define enable_irq_lockdep(irq) enable_irq(irq) | ||
165 | # endif | ||
166 | |||
167 | #endif /* CONFIG_GENERIC_HARDIRQS */ | ||
40 | 168 | ||
41 | #ifndef __ARCH_SET_SOFTIRQ_PENDING | 169 | #ifndef __ARCH_SET_SOFTIRQ_PENDING |
42 | #define set_softirq_pending(x) (local_softirq_pending() = (x)) | 170 | #define set_softirq_pending(x) (local_softirq_pending() = (x)) |
@@ -72,13 +200,11 @@ static inline void __deprecated save_and_cli(unsigned long *x) | |||
72 | #define save_and_cli(x) save_and_cli(&x) | 200 | #define save_and_cli(x) save_and_cli(&x) |
73 | #endif /* CONFIG_SMP */ | 201 | #endif /* CONFIG_SMP */ |
74 | 202 | ||
75 | /* SoftIRQ primitives. */ | 203 | extern void local_bh_disable(void); |
76 | #define local_bh_disable() \ | 204 | extern void __local_bh_enable(void); |
77 | do { add_preempt_count(SOFTIRQ_OFFSET); barrier(); } while (0) | 205 | extern void _local_bh_enable(void); |
78 | #define __local_bh_enable() \ | ||
79 | do { barrier(); sub_preempt_count(SOFTIRQ_OFFSET); } while (0) | ||
80 | |||
81 | extern void local_bh_enable(void); | 206 | extern void local_bh_enable(void); |
207 | extern void local_bh_enable_ip(unsigned long ip); | ||
82 | 208 | ||
83 | /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high | 209 | /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high |
84 | frequency threaded job scheduling. For almost all the purposes | 210 | frequency threaded job scheduling. For almost all the purposes |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index edfc733b1575..d42c83399071 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -9,13 +9,15 @@ | |||
9 | #define _LINUX_IOPORT_H | 9 | #define _LINUX_IOPORT_H |
10 | 10 | ||
11 | #include <linux/compiler.h> | 11 | #include <linux/compiler.h> |
12 | #include <linux/types.h> | ||
12 | /* | 13 | /* |
13 | * Resources are tree-like, allowing | 14 | * Resources are tree-like, allowing |
14 | * nesting etc.. | 15 | * nesting etc.. |
15 | */ | 16 | */ |
16 | struct resource { | 17 | struct resource { |
18 | resource_size_t start; | ||
19 | resource_size_t end; | ||
17 | const char *name; | 20 | const char *name; |
18 | unsigned long start, end; | ||
19 | unsigned long flags; | 21 | unsigned long flags; |
20 | struct resource *parent, *sibling, *child; | 22 | struct resource *parent, *sibling, *child; |
21 | }; | 23 | }; |
@@ -53,6 +55,7 @@ struct resource_list { | |||
53 | #define IORESOURCE_IRQ_LOWEDGE (1<<1) | 55 | #define IORESOURCE_IRQ_LOWEDGE (1<<1) |
54 | #define IORESOURCE_IRQ_HIGHLEVEL (1<<2) | 56 | #define IORESOURCE_IRQ_HIGHLEVEL (1<<2) |
55 | #define IORESOURCE_IRQ_LOWLEVEL (1<<3) | 57 | #define IORESOURCE_IRQ_LOWLEVEL (1<<3) |
58 | #define IORESOURCE_IRQ_SHAREABLE (1<<4) | ||
56 | 59 | ||
57 | /* ISA PnP DMA specific bits (IORESOURCE_BITS) */ | 60 | /* ISA PnP DMA specific bits (IORESOURCE_BITS) */ |
58 | #define IORESOURCE_DMA_TYPE_MASK (3<<0) | 61 | #define IORESOURCE_DMA_TYPE_MASK (3<<0) |
@@ -94,16 +97,15 @@ extern struct resource iomem_resource; | |||
94 | extern int request_resource(struct resource *root, struct resource *new); | 97 | extern int request_resource(struct resource *root, struct resource *new); |
95 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); | 98 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); |
96 | extern int release_resource(struct resource *new); | 99 | extern int release_resource(struct resource *new); |
97 | extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); | 100 | extern int insert_resource(struct resource *parent, struct resource *new); |
98 | extern int allocate_resource(struct resource *root, struct resource *new, | 101 | extern int allocate_resource(struct resource *root, struct resource *new, |
99 | unsigned long size, | 102 | resource_size_t size, resource_size_t min, |
100 | unsigned long min, unsigned long max, | 103 | resource_size_t max, resource_size_t align, |
101 | unsigned long align, | ||
102 | void (*alignf)(void *, struct resource *, | 104 | void (*alignf)(void *, struct resource *, |
103 | unsigned long, unsigned long), | 105 | resource_size_t, resource_size_t), |
104 | void *alignf_data); | 106 | void *alignf_data); |
105 | int adjust_resource(struct resource *res, unsigned long start, | 107 | int adjust_resource(struct resource *res, resource_size_t start, |
106 | unsigned long size); | 108 | resource_size_t size); |
107 | 109 | ||
108 | /* get registered SYSTEM_RAM resources in specified area */ | 110 | /* get registered SYSTEM_RAM resources in specified area */ |
109 | extern int find_next_system_ram(struct resource *res); | 111 | extern int find_next_system_ram(struct resource *res); |
@@ -113,17 +115,21 @@ extern int find_next_system_ram(struct resource *res); | |||
113 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) | 115 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) |
114 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) | 116 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) |
115 | 117 | ||
116 | extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name); | 118 | extern struct resource * __request_region(struct resource *, |
119 | resource_size_t start, | ||
120 | resource_size_t n, const char *name); | ||
117 | 121 | ||
118 | /* Compatibility cruft */ | 122 | /* Compatibility cruft */ |
119 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) | 123 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) |
120 | #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) | 124 | #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) |
121 | #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) | 125 | #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) |
122 | 126 | ||
123 | extern int __check_region(struct resource *, unsigned long, unsigned long); | 127 | extern int __check_region(struct resource *, resource_size_t, resource_size_t); |
124 | extern void __release_region(struct resource *, unsigned long, unsigned long); | 128 | extern void __release_region(struct resource *, resource_size_t, |
129 | resource_size_t); | ||
125 | 130 | ||
126 | static inline int __deprecated check_region(unsigned long s, unsigned long n) | 131 | static inline int __deprecated check_region(resource_size_t s, |
132 | resource_size_t n) | ||
127 | { | 133 | { |
128 | return __check_region(&ioport_resource, s, n); | 134 | return __check_region(&ioport_resource, s, n); |
129 | } | 135 | } |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 676e00dfb21a..b48eae32dc61 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __irq_h | 1 | #ifndef _LINUX_IRQ_H |
2 | #define __irq_h | 2 | #define _LINUX_IRQ_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Please do not include this file in generic code. There is currently | 5 | * Please do not include this file in generic code. There is currently |
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/smp.h> | 12 | #include <linux/smp.h> |
13 | 13 | ||
14 | #if !defined(CONFIG_S390) | 14 | #ifndef CONFIG_S390 |
15 | 15 | ||
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <linux/cache.h> | 17 | #include <linux/cache.h> |
@@ -24,84 +24,172 @@ | |||
24 | 24 | ||
25 | /* | 25 | /* |
26 | * IRQ line status. | 26 | * IRQ line status. |
27 | * | ||
28 | * Bits 0-16 are reserved for the IRQF_* bits in linux/interrupt.h | ||
29 | * | ||
30 | * IRQ types | ||
27 | */ | 31 | */ |
28 | #define IRQ_INPROGRESS 1 /* IRQ handler active - do not enter! */ | 32 | #define IRQ_TYPE_NONE 0x00000000 /* Default, unspecified type */ |
29 | #define IRQ_DISABLED 2 /* IRQ disabled - do not enter! */ | 33 | #define IRQ_TYPE_EDGE_RISING 0x00000001 /* Edge rising type */ |
30 | #define IRQ_PENDING 4 /* IRQ pending - replay on enable */ | 34 | #define IRQ_TYPE_EDGE_FALLING 0x00000002 /* Edge falling type */ |
31 | #define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */ | 35 | #define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING) |
32 | #define IRQ_AUTODETECT 16 /* IRQ is being autodetected */ | 36 | #define IRQ_TYPE_LEVEL_HIGH 0x00000004 /* Level high type */ |
33 | #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ | 37 | #define IRQ_TYPE_LEVEL_LOW 0x00000008 /* Level low type */ |
34 | #define IRQ_LEVEL 64 /* IRQ level triggered */ | 38 | #define IRQ_TYPE_SENSE_MASK 0x0000000f /* Mask of the above */ |
35 | #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ | 39 | #define IRQ_TYPE_PROBE 0x00000010 /* Probing in progress */ |
36 | #if defined(ARCH_HAS_IRQ_PER_CPU) | 40 | |
37 | # define IRQ_PER_CPU 256 /* IRQ is per CPU */ | 41 | /* Internal flags */ |
42 | #define IRQ_INPROGRESS 0x00010000 /* IRQ handler active - do not enter! */ | ||
43 | #define IRQ_DISABLED 0x00020000 /* IRQ disabled - do not enter! */ | ||
44 | #define IRQ_PENDING 0x00040000 /* IRQ pending - replay on enable */ | ||
45 | #define IRQ_REPLAY 0x00080000 /* IRQ has been replayed but not acked yet */ | ||
46 | #define IRQ_AUTODETECT 0x00100000 /* IRQ is being autodetected */ | ||
47 | #define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */ | ||
48 | #define IRQ_LEVEL 0x00400000 /* IRQ level triggered */ | ||
49 | #define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */ | ||
50 | #ifdef CONFIG_IRQ_PER_CPU | ||
51 | # define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */ | ||
38 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 52 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
39 | #else | 53 | #else |
40 | # define CHECK_IRQ_PER_CPU(var) 0 | 54 | # define CHECK_IRQ_PER_CPU(var) 0 |
41 | #endif | 55 | #endif |
42 | 56 | ||
43 | /* | 57 | #define IRQ_NOPROBE 0x02000000 /* IRQ is not valid for probing */ |
44 | * Interrupt controller descriptor. This is all we need | 58 | #define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */ |
45 | * to describe about the low-level hardware. | 59 | #define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ |
60 | #define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ | ||
61 | |||
62 | struct proc_dir_entry; | ||
63 | |||
64 | /** | ||
65 | * struct irq_chip - hardware interrupt chip descriptor | ||
66 | * | ||
67 | * @name: name for /proc/interrupts | ||
68 | * @startup: start up the interrupt (defaults to ->enable if NULL) | ||
69 | * @shutdown: shut down the interrupt (defaults to ->disable if NULL) | ||
70 | * @enable: enable the interrupt (defaults to chip->unmask if NULL) | ||
71 | * @disable: disable the interrupt (defaults to chip->mask if NULL) | ||
72 | * @ack: start of a new interrupt | ||
73 | * @mask: mask an interrupt source | ||
74 | * @mask_ack: ack and mask an interrupt source | ||
75 | * @unmask: unmask an interrupt source | ||
76 | * @eoi: end of interrupt - chip level | ||
77 | * @end: end of interrupt - flow level | ||
78 | * @set_affinity: set the CPU affinity on SMP machines | ||
79 | * @retrigger: resend an IRQ to the CPU | ||
80 | * @set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ | ||
81 | * @set_wake: enable/disable power-management wake-on of an IRQ | ||
82 | * | ||
83 | * @release: release function solely used by UML | ||
84 | * @typename: obsoleted by name, kept as migration helper | ||
46 | */ | 85 | */ |
47 | struct hw_interrupt_type { | 86 | struct irq_chip { |
48 | const char * typename; | 87 | const char *name; |
49 | unsigned int (*startup)(unsigned int irq); | 88 | unsigned int (*startup)(unsigned int irq); |
50 | void (*shutdown)(unsigned int irq); | 89 | void (*shutdown)(unsigned int irq); |
51 | void (*enable)(unsigned int irq); | 90 | void (*enable)(unsigned int irq); |
52 | void (*disable)(unsigned int irq); | 91 | void (*disable)(unsigned int irq); |
53 | void (*ack)(unsigned int irq); | 92 | |
54 | void (*end)(unsigned int irq); | 93 | void (*ack)(unsigned int irq); |
55 | void (*set_affinity)(unsigned int irq, cpumask_t dest); | 94 | void (*mask)(unsigned int irq); |
95 | void (*mask_ack)(unsigned int irq); | ||
96 | void (*unmask)(unsigned int irq); | ||
97 | void (*eoi)(unsigned int irq); | ||
98 | |||
99 | void (*end)(unsigned int irq); | ||
100 | void (*set_affinity)(unsigned int irq, cpumask_t dest); | ||
101 | int (*retrigger)(unsigned int irq); | ||
102 | int (*set_type)(unsigned int irq, unsigned int flow_type); | ||
103 | int (*set_wake)(unsigned int irq, unsigned int on); | ||
104 | |||
56 | /* Currently used only by UML, might disappear one day.*/ | 105 | /* Currently used only by UML, might disappear one day.*/ |
57 | #ifdef CONFIG_IRQ_RELEASE_METHOD | 106 | #ifdef CONFIG_IRQ_RELEASE_METHOD |
58 | void (*release)(unsigned int irq, void *dev_id); | 107 | void (*release)(unsigned int irq, void *dev_id); |
59 | #endif | 108 | #endif |
109 | /* | ||
110 | * For compatibility, ->typename is copied into ->name. | ||
111 | * Will disappear. | ||
112 | */ | ||
113 | const char *typename; | ||
60 | }; | 114 | }; |
61 | 115 | ||
62 | typedef struct hw_interrupt_type hw_irq_controller; | 116 | /** |
63 | 117 | * struct irq_desc - interrupt descriptor | |
64 | /* | 118 | * |
65 | * This is the "IRQ descriptor", which contains various information | 119 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] |
66 | * about the irq, including what kind of hardware handling it has, | 120 | * @chip: low level interrupt hardware access |
67 | * whether it is disabled etc etc. | 121 | * @handler_data: per-IRQ data for the irq_chip methods |
122 | * @chip_data: platform-specific per-chip private data for the chip | ||
123 | * methods, to allow shared chip implementations | ||
124 | * @action: the irq action chain | ||
125 | * @status: status information | ||
126 | * @depth: disable-depth, for nested irq_disable() calls | ||
127 | * @irq_count: stats field to detect stalled irqs | ||
128 | * @irqs_unhandled: stats field for spurious unhandled interrupts | ||
129 | * @lock: locking for SMP | ||
130 | * @affinity: IRQ affinity on SMP | ||
131 | * @cpu: cpu index useful for balancing | ||
132 | * @pending_mask: pending rebalanced interrupts | ||
133 | * @move_irq: need to re-target IRQ destination | ||
134 | * @dir: /proc/irq/ procfs entry | ||
135 | * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP | ||
68 | * | 136 | * |
69 | * Pad this out to 32 bytes for cache and indexing reasons. | 137 | * Pad this out to 32 bytes for cache and indexing reasons. |
70 | */ | 138 | */ |
71 | typedef struct irq_desc { | 139 | struct irq_desc { |
72 | hw_irq_controller *handler; | 140 | void fastcall (*handle_irq)(unsigned int irq, |
73 | void *handler_data; | 141 | struct irq_desc *desc, |
74 | struct irqaction *action; /* IRQ action list */ | 142 | struct pt_regs *regs); |
75 | unsigned int status; /* IRQ status */ | 143 | struct irq_chip *chip; |
76 | unsigned int depth; /* nested irq disables */ | 144 | void *handler_data; |
77 | unsigned int irq_count; /* For detecting broken interrupts */ | 145 | void *chip_data; |
78 | unsigned int irqs_unhandled; | 146 | struct irqaction *action; /* IRQ action list */ |
79 | spinlock_t lock; | 147 | unsigned int status; /* IRQ status */ |
80 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | 148 | |
81 | unsigned int move_irq; /* Flag need to re-target intr dest*/ | 149 | unsigned int depth; /* nested irq disables */ |
150 | unsigned int irq_count; /* For detecting broken IRQs */ | ||
151 | unsigned int irqs_unhandled; | ||
152 | spinlock_t lock; | ||
153 | #ifdef CONFIG_SMP | ||
154 | cpumask_t affinity; | ||
155 | unsigned int cpu; | ||
156 | #endif | ||
157 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) | ||
158 | cpumask_t pending_mask; | ||
159 | unsigned int move_irq; /* need to re-target IRQ dest */ | ||
160 | #endif | ||
161 | #ifdef CONFIG_PROC_FS | ||
162 | struct proc_dir_entry *dir; | ||
82 | #endif | 163 | #endif |
83 | } ____cacheline_aligned irq_desc_t; | 164 | } ____cacheline_aligned; |
84 | 165 | ||
85 | extern irq_desc_t irq_desc [NR_IRQS]; | 166 | extern struct irq_desc irq_desc[NR_IRQS]; |
86 | 167 | ||
87 | /* Return a pointer to the irq descriptor for IRQ. */ | 168 | /* |
88 | static inline irq_desc_t * | 169 | * Migration helpers for obsolete names, they will go away: |
89 | irq_descp (int irq) | 170 | */ |
90 | { | 171 | #define hw_interrupt_type irq_chip |
91 | return irq_desc + irq; | 172 | typedef struct irq_chip hw_irq_controller; |
92 | } | 173 | #define no_irq_type no_irq_chip |
174 | typedef struct irq_desc irq_desc_t; | ||
93 | 175 | ||
94 | #include <asm/hw_irq.h> /* the arch dependent stuff */ | 176 | /* |
177 | * Pick up the arch-dependent methods: | ||
178 | */ | ||
179 | #include <asm/hw_irq.h> | ||
95 | 180 | ||
96 | extern int setup_irq(unsigned int irq, struct irqaction * new); | 181 | extern int setup_irq(unsigned int irq, struct irqaction *new); |
97 | 182 | ||
98 | #ifdef CONFIG_GENERIC_HARDIRQS | 183 | #ifdef CONFIG_GENERIC_HARDIRQS |
99 | extern cpumask_t irq_affinity[NR_IRQS]; | 184 | |
185 | #ifndef handle_dynamic_tick | ||
186 | # define handle_dynamic_tick(a) do { } while (0) | ||
187 | #endif | ||
100 | 188 | ||
101 | #ifdef CONFIG_SMP | 189 | #ifdef CONFIG_SMP |
102 | static inline void set_native_irq_info(int irq, cpumask_t mask) | 190 | static inline void set_native_irq_info(int irq, cpumask_t mask) |
103 | { | 191 | { |
104 | irq_affinity[irq] = mask; | 192 | irq_desc[irq].affinity = mask; |
105 | } | 193 | } |
106 | #else | 194 | #else |
107 | static inline void set_native_irq_info(int irq, cpumask_t mask) | 195 | static inline void set_native_irq_info(int irq, cpumask_t mask) |
@@ -111,8 +199,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask) | |||
111 | 199 | ||
112 | #ifdef CONFIG_SMP | 200 | #ifdef CONFIG_SMP |
113 | 201 | ||
114 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | 202 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) |
115 | extern cpumask_t pending_irq_cpumask[NR_IRQS]; | ||
116 | 203 | ||
117 | void set_pending_irq(unsigned int irq, cpumask_t mask); | 204 | void set_pending_irq(unsigned int irq, cpumask_t mask); |
118 | void move_native_irq(int irq); | 205 | void move_native_irq(int irq); |
@@ -133,7 +220,7 @@ static inline void set_irq_info(int irq, cpumask_t mask) | |||
133 | { | 220 | { |
134 | } | 221 | } |
135 | 222 | ||
136 | #else // CONFIG_PCI_MSI | 223 | #else /* CONFIG_PCI_MSI */ |
137 | 224 | ||
138 | static inline void move_irq(int irq) | 225 | static inline void move_irq(int irq) |
139 | { | 226 | { |
@@ -144,26 +231,36 @@ static inline void set_irq_info(int irq, cpumask_t mask) | |||
144 | { | 231 | { |
145 | set_native_irq_info(irq, mask); | 232 | set_native_irq_info(irq, mask); |
146 | } | 233 | } |
147 | #endif // CONFIG_PCI_MSI | ||
148 | 234 | ||
149 | #else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE | 235 | #endif /* CONFIG_PCI_MSI */ |
236 | |||
237 | #else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ | ||
238 | |||
239 | static inline void move_irq(int irq) | ||
240 | { | ||
241 | } | ||
242 | |||
243 | static inline void move_native_irq(int irq) | ||
244 | { | ||
245 | } | ||
246 | |||
247 | static inline void set_pending_irq(unsigned int irq, cpumask_t mask) | ||
248 | { | ||
249 | } | ||
150 | 250 | ||
151 | #define move_irq(x) | ||
152 | #define move_native_irq(x) | ||
153 | #define set_pending_irq(x,y) | ||
154 | static inline void set_irq_info(int irq, cpumask_t mask) | 251 | static inline void set_irq_info(int irq, cpumask_t mask) |
155 | { | 252 | { |
156 | set_native_irq_info(irq, mask); | 253 | set_native_irq_info(irq, mask); |
157 | } | 254 | } |
158 | 255 | ||
159 | #endif // CONFIG_GENERIC_PENDING_IRQ | 256 | #endif /* CONFIG_GENERIC_PENDING_IRQ */ |
160 | 257 | ||
161 | #else // CONFIG_SMP | 258 | #else /* CONFIG_SMP */ |
162 | 259 | ||
163 | #define move_irq(x) | 260 | #define move_irq(x) |
164 | #define move_native_irq(x) | 261 | #define move_native_irq(x) |
165 | 262 | ||
166 | #endif // CONFIG_SMP | 263 | #endif /* CONFIG_SMP */ |
167 | 264 | ||
168 | #ifdef CONFIG_IRQBALANCE | 265 | #ifdef CONFIG_IRQBALANCE |
169 | extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); | 266 | extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); |
@@ -173,32 +270,139 @@ static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask) | |||
173 | } | 270 | } |
174 | #endif | 271 | #endif |
175 | 272 | ||
273 | #ifdef CONFIG_AUTO_IRQ_AFFINITY | ||
274 | extern int select_smp_affinity(unsigned int irq); | ||
275 | #else | ||
276 | static inline int select_smp_affinity(unsigned int irq) | ||
277 | { | ||
278 | return 1; | ||
279 | } | ||
280 | #endif | ||
281 | |||
176 | extern int no_irq_affinity; | 282 | extern int no_irq_affinity; |
177 | extern int noirqdebug_setup(char *str); | ||
178 | 283 | ||
179 | extern fastcall irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs, | 284 | /* Handle irq action chains: */ |
180 | struct irqaction *action); | 285 | extern int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, |
286 | struct irqaction *action); | ||
287 | |||
288 | /* | ||
289 | * Built-in IRQ handlers for various IRQ types, | ||
290 | * callable via desc->chip->handle_irq() | ||
291 | */ | ||
292 | extern void fastcall | ||
293 | handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs); | ||
294 | extern void fastcall | ||
295 | handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc, | ||
296 | struct pt_regs *regs); | ||
297 | extern void fastcall | ||
298 | handle_edge_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs); | ||
299 | extern void fastcall | ||
300 | handle_simple_irq(unsigned int irq, struct irq_desc *desc, | ||
301 | struct pt_regs *regs); | ||
302 | extern void fastcall | ||
303 | handle_percpu_irq(unsigned int irq, struct irq_desc *desc, | ||
304 | struct pt_regs *regs); | ||
305 | extern void fastcall | ||
306 | handle_bad_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs); | ||
307 | |||
308 | /* | ||
309 | * Get a descriptive string for the highlevel handler, for | ||
310 | * /proc/interrupts output: | ||
311 | */ | ||
312 | extern const char * | ||
313 | handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
314 | struct pt_regs *)); | ||
315 | |||
316 | /* | ||
317 | * Monolithic do_IRQ implementation. | ||
318 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) | ||
319 | */ | ||
181 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); | 320 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); |
182 | extern void note_interrupt(unsigned int irq, irq_desc_t *desc, | ||
183 | int action_ret, struct pt_regs *regs); | ||
184 | extern int can_request_irq(unsigned int irq, unsigned long irqflags); | ||
185 | 321 | ||
322 | /* | ||
323 | * Architectures call this to let the generic IRQ layer | ||
324 | * handle an interrupt. If the descriptor is attached to an | ||
325 | * irqchip-style controller then we call the ->handle_irq() handler, | ||
326 | * and it calls __do_IRQ() if it's attached to an irqtype-style controller. | ||
327 | */ | ||
328 | static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs) | ||
329 | { | ||
330 | struct irq_desc *desc = irq_desc + irq; | ||
331 | |||
332 | if (likely(desc->handle_irq)) | ||
333 | desc->handle_irq(irq, desc, regs); | ||
334 | else | ||
335 | __do_IRQ(irq, regs); | ||
336 | } | ||
337 | |||
338 | /* Handling of unhandled and spurious interrupts: */ | ||
339 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, | ||
340 | int action_ret, struct pt_regs *regs); | ||
341 | |||
342 | /* Resending of interrupts :*/ | ||
343 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); | ||
344 | |||
345 | /* Initialize /proc/irq/ */ | ||
186 | extern void init_irq_proc(void); | 346 | extern void init_irq_proc(void); |
187 | 347 | ||
188 | #ifdef CONFIG_AUTO_IRQ_AFFINITY | 348 | /* Enable/disable irq debugging output: */ |
189 | extern int select_smp_affinity(unsigned int irq); | 349 | extern int noirqdebug_setup(char *str); |
190 | #else | 350 | |
191 | static inline int | 351 | /* Checks whether the interrupt can be requested by request_irq(): */ |
192 | select_smp_affinity(unsigned int irq) | 352 | extern int can_request_irq(unsigned int irq, unsigned long irqflags); |
353 | |||
354 | /* Dummy irq-chip implementations: */ | ||
355 | extern struct irq_chip no_irq_chip; | ||
356 | extern struct irq_chip dummy_irq_chip; | ||
357 | |||
358 | extern void | ||
359 | set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, | ||
360 | void fastcall (*handle)(unsigned int, | ||
361 | struct irq_desc *, | ||
362 | struct pt_regs *)); | ||
363 | extern void | ||
364 | __set_irq_handler(unsigned int irq, | ||
365 | void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
366 | struct pt_regs *), | ||
367 | int is_chained); | ||
368 | |||
369 | /* | ||
370 | * Set a highlevel flow handler for a given IRQ: | ||
371 | */ | ||
372 | static inline void | ||
373 | set_irq_handler(unsigned int irq, | ||
374 | void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
375 | struct pt_regs *)) | ||
193 | { | 376 | { |
194 | return 1; | 377 | __set_irq_handler(irq, handle, 0); |
195 | } | 378 | } |
196 | #endif | ||
197 | 379 | ||
198 | #endif | 380 | /* |
381 | * Set a highlevel chained flow handler for a given IRQ. | ||
382 | * (a chained handler is automatically enabled and set to | ||
383 | * IRQ_NOREQUEST and IRQ_NOPROBE) | ||
384 | */ | ||
385 | static inline void | ||
386 | set_irq_chained_handler(unsigned int irq, | ||
387 | void fastcall (*handle)(unsigned int, struct irq_desc *, | ||
388 | struct pt_regs *)) | ||
389 | { | ||
390 | __set_irq_handler(irq, handle, 1); | ||
391 | } | ||
199 | 392 | ||
200 | extern hw_irq_controller no_irq_type; /* needed in every arch ? */ | 393 | /* Set/get chip/data for an IRQ: */ |
201 | 394 | ||
202 | #endif | 395 | extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); |
396 | extern int set_irq_data(unsigned int irq, void *data); | ||
397 | extern int set_irq_chip_data(unsigned int irq, void *data); | ||
398 | extern int set_irq_type(unsigned int irq, unsigned int type); | ||
399 | |||
400 | #define get_irq_chip(irq) (irq_desc[irq].chip) | ||
401 | #define get_irq_chip_data(irq) (irq_desc[irq].chip_data) | ||
402 | #define get_irq_data(irq) (irq_desc[irq].handler_data) | ||
403 | |||
404 | #endif /* CONFIG_GENERIC_HARDIRQS */ | ||
405 | |||
406 | #endif /* !CONFIG_S390 */ | ||
203 | 407 | ||
204 | #endif /* __irq_h */ | 408 | #endif /* _LINUX_IRQ_H */ |
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h new file mode 100644 index 000000000000..412e025bc5c7 --- /dev/null +++ b/include/linux/irqflags.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * include/linux/irqflags.h | ||
3 | * | ||
4 | * IRQ flags tracing: follow the state of the hardirq and softirq flags and | ||
5 | * provide callbacks for transitions between ON and OFF states. | ||
6 | * | ||
7 | * This file gets included from lowlevel asm headers too, to provide | ||
8 | * wrapped versions of the local_irq_*() APIs, based on the | ||
9 | * raw_local_irq_*() macros from the lowlevel headers. | ||
10 | */ | ||
11 | #ifndef _LINUX_TRACE_IRQFLAGS_H | ||
12 | #define _LINUX_TRACE_IRQFLAGS_H | ||
13 | |||
14 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
15 | extern void trace_hardirqs_on(void); | ||
16 | extern void trace_hardirqs_off(void); | ||
17 | extern void trace_softirqs_on(unsigned long ip); | ||
18 | extern void trace_softirqs_off(unsigned long ip); | ||
19 | # define trace_hardirq_context(p) ((p)->hardirq_context) | ||
20 | # define trace_softirq_context(p) ((p)->softirq_context) | ||
21 | # define trace_hardirqs_enabled(p) ((p)->hardirqs_enabled) | ||
22 | # define trace_softirqs_enabled(p) ((p)->softirqs_enabled) | ||
23 | # define trace_hardirq_enter() do { current->hardirq_context++; } while (0) | ||
24 | # define trace_hardirq_exit() do { current->hardirq_context--; } while (0) | ||
25 | # define trace_softirq_enter() do { current->softirq_context++; } while (0) | ||
26 | # define trace_softirq_exit() do { current->softirq_context--; } while (0) | ||
27 | # define INIT_TRACE_IRQFLAGS .softirqs_enabled = 1, | ||
28 | #else | ||
29 | # define trace_hardirqs_on() do { } while (0) | ||
30 | # define trace_hardirqs_off() do { } while (0) | ||
31 | # define trace_softirqs_on(ip) do { } while (0) | ||
32 | # define trace_softirqs_off(ip) do { } while (0) | ||
33 | # define trace_hardirq_context(p) 0 | ||
34 | # define trace_softirq_context(p) 0 | ||
35 | # define trace_hardirqs_enabled(p) 0 | ||
36 | # define trace_softirqs_enabled(p) 0 | ||
37 | # define trace_hardirq_enter() do { } while (0) | ||
38 | # define trace_hardirq_exit() do { } while (0) | ||
39 | # define trace_softirq_enter() do { } while (0) | ||
40 | # define trace_softirq_exit() do { } while (0) | ||
41 | # define INIT_TRACE_IRQFLAGS | ||
42 | #endif | ||
43 | |||
44 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT | ||
45 | |||
46 | #include <asm/irqflags.h> | ||
47 | |||
48 | #define local_irq_enable() \ | ||
49 | do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0) | ||
50 | #define local_irq_disable() \ | ||
51 | do { raw_local_irq_disable(); trace_hardirqs_off(); } while (0) | ||
52 | #define local_irq_save(flags) \ | ||
53 | do { raw_local_irq_save(flags); trace_hardirqs_off(); } while (0) | ||
54 | |||
55 | #define local_irq_restore(flags) \ | ||
56 | do { \ | ||
57 | if (raw_irqs_disabled_flags(flags)) { \ | ||
58 | raw_local_irq_restore(flags); \ | ||
59 | trace_hardirqs_off(); \ | ||
60 | } else { \ | ||
61 | trace_hardirqs_on(); \ | ||
62 | raw_local_irq_restore(flags); \ | ||
63 | } \ | ||
64 | } while (0) | ||
65 | #else /* !CONFIG_TRACE_IRQFLAGS_SUPPORT */ | ||
66 | /* | ||
67 | * The local_irq_*() APIs are equal to the raw_local_irq*() | ||
68 | * if !TRACE_IRQFLAGS. | ||
69 | */ | ||
70 | # define raw_local_irq_disable() local_irq_disable() | ||
71 | # define raw_local_irq_enable() local_irq_enable() | ||
72 | # define raw_local_irq_save(flags) local_irq_save(flags) | ||
73 | # define raw_local_irq_restore(flags) local_irq_restore(flags) | ||
74 | #endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */ | ||
75 | |||
76 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT | ||
77 | #define safe_halt() \ | ||
78 | do { \ | ||
79 | trace_hardirqs_on(); \ | ||
80 | raw_safe_halt(); \ | ||
81 | } while (0) | ||
82 | |||
83 | #define local_save_flags(flags) raw_local_save_flags(flags) | ||
84 | |||
85 | #define irqs_disabled() \ | ||
86 | ({ \ | ||
87 | unsigned long flags; \ | ||
88 | \ | ||
89 | raw_local_save_flags(flags); \ | ||
90 | raw_irqs_disabled_flags(flags); \ | ||
91 | }) | ||
92 | |||
93 | #define irqs_disabled_flags(flags) raw_irqs_disabled_flags(flags) | ||
94 | #endif /* CONFIG_X86 */ | ||
95 | |||
96 | #endif | ||
diff --git a/include/linux/isdn/Kbuild b/include/linux/isdn/Kbuild new file mode 100644 index 000000000000..991cdb29ab2e --- /dev/null +++ b/include/linux/isdn/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y += capicmd.h | |||
diff --git a/include/linux/isdn/tpam.h b/include/linux/isdn/tpam.h deleted file mode 100644 index d18dd0dc570d..000000000000 --- a/include/linux/isdn/tpam.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* $Id: tpam.h,v 1.1.2.1 2001/06/08 08:23:46 kai Exp $ | ||
2 | * | ||
3 | * Turbo PAM ISDN driver for Linux. (Kernel Driver) | ||
4 | * | ||
5 | * Copyright 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcôve | ||
6 | * | ||
7 | * For all support questions please contact: <support@auvertech.fr> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2, or (at your option) | ||
12 | * any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef _TPAM_H_ | ||
26 | #define _TPAM_H_ | ||
27 | |||
28 | #include <linux/types.h> | ||
29 | |||
30 | /* IOCTL commands */ | ||
31 | #define TPAM_CMD_DSPLOAD 0x0001 | ||
32 | #define TPAM_CMD_DSPSAVE 0x0002 | ||
33 | #define TPAM_CMD_DSPRUN 0x0003 | ||
34 | #define TPAM_CMD_LOOPMODEON 0x0004 | ||
35 | #define TPAM_CMD_LOOPMODEOFF 0x0005 | ||
36 | |||
37 | /* addresses of debug information zones on board */ | ||
38 | #define TPAM_TRAPAUDIT_REGISTER 0x005493e4 | ||
39 | #define TPAM_NCOAUDIT_REGISTER 0x00500000 | ||
40 | #define TPAM_MSGAUDIT_REGISTER 0x008E30F0 | ||
41 | |||
42 | /* length of debug information zones on board */ | ||
43 | #define TPAM_TRAPAUDIT_LENGTH 10000 | ||
44 | #define TPAM_NCOAUDIT_LENGTH 300000 | ||
45 | #define TPAM_NCOAUDIT_COUNT 30 | ||
46 | #define TPAM_MSGAUDIT_LENGTH 60000 | ||
47 | |||
48 | /* IOCTL load/save parameter */ | ||
49 | typedef struct tpam_dsp_ioctl { | ||
50 | __u32 address; /* address to load/save data */ | ||
51 | __u32 data_len; /* size of data to be loaded/saved */ | ||
52 | __u8 data[0]; /* data */ | ||
53 | } tpam_dsp_ioctl; | ||
54 | |||
55 | #endif /* _TPAM_H_ */ | ||
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index c6f70660b371..c9c760700bc3 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
@@ -186,6 +186,7 @@ struct jffs2_raw_xref | |||
186 | jint32_t hdr_crc; | 186 | jint32_t hdr_crc; |
187 | jint32_t ino; /* inode number */ | 187 | jint32_t ino; /* inode number */ |
188 | jint32_t xid; /* XATTR identifier number */ | 188 | jint32_t xid; /* XATTR identifier number */ |
189 | jint32_t xseqno; /* xref sequencial number */ | ||
189 | jint32_t node_crc; | 190 | jint32_t node_crc; |
190 | } __attribute__((packed)); | 191 | } __attribute__((packed)); |
191 | 192 | ||
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 54e2549f96ba..849043ce4ed6 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -57,10 +57,25 @@ do { \ | |||
57 | #define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr) | 57 | #define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr) |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #define print_symbol(fmt, addr) \ | 60 | static inline void print_symbol(const char *fmt, unsigned long addr) |
61 | do { \ | 61 | { |
62 | __check_printsym_format(fmt, ""); \ | 62 | __check_printsym_format(fmt, ""); |
63 | __print_symbol(fmt, addr); \ | 63 | __print_symbol(fmt, (unsigned long) |
64 | __builtin_extract_return_addr((void *)addr)); | ||
65 | } | ||
66 | |||
67 | #ifndef CONFIG_64BIT | ||
68 | #define print_ip_sym(ip) \ | ||
69 | do { \ | ||
70 | printk("[<%08lx>]", ip); \ | ||
71 | print_symbol(" %s\n", ip); \ | ||
64 | } while(0) | 72 | } while(0) |
73 | #else | ||
74 | #define print_ip_sym(ip) \ | ||
75 | do { \ | ||
76 | printk("[<%016lx>]", ip); \ | ||
77 | print_symbol(" %s\n", ip); \ | ||
78 | } while(0) | ||
79 | #endif | ||
65 | 80 | ||
66 | #endif /*_LINUX_KALLSYMS_H*/ | 81 | #endif /*_LINUX_KALLSYMS_H*/ |
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 4eb851ece080..efe0ee4cc80b 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -155,10 +155,8 @@ static inline void con_schedule_flip(struct tty_struct *t) | |||
155 | { | 155 | { |
156 | unsigned long flags; | 156 | unsigned long flags; |
157 | spin_lock_irqsave(&t->buf.lock, flags); | 157 | spin_lock_irqsave(&t->buf.lock, flags); |
158 | if (t->buf.tail != NULL) { | 158 | if (t->buf.tail != NULL) |
159 | t->buf.tail->active = 0; | ||
160 | t->buf.tail->commit = t->buf.tail->used; | 159 | t->buf.tail->commit = t->buf.tail->used; |
161 | } | ||
162 | spin_unlock_irqrestore(&t->buf.lock, flags); | 160 | spin_unlock_irqrestore(&t->buf.lock, flags); |
163 | schedule_work(&t->buf.work); | 161 | schedule_work(&t->buf.work); |
164 | } | 162 | } |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5c1ec1f84eab..181c69cad4e3 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -33,6 +33,7 @@ extern const char linux_banner[]; | |||
33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) | 34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) |
35 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 35 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
36 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | ||
36 | 37 | ||
37 | #define KERN_EMERG "<0>" /* system is unusable */ | 38 | #define KERN_EMERG "<0>" /* system is unusable */ |
38 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 39 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
diff --git a/include/linux/key.h b/include/linux/key.h index e693e729bc92..169f05e4863e 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -177,7 +177,8 @@ struct key { | |||
177 | /* | 177 | /* |
178 | * kernel managed key type definition | 178 | * kernel managed key type definition |
179 | */ | 179 | */ |
180 | typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, const char *op); | 180 | typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, |
181 | const char *op, void *aux); | ||
181 | 182 | ||
182 | struct key_type { | 183 | struct key_type { |
183 | /* name of the type */ | 184 | /* name of the type */ |
@@ -285,6 +286,11 @@ extern struct key *request_key(struct key_type *type, | |||
285 | const char *description, | 286 | const char *description, |
286 | const char *callout_info); | 287 | const char *callout_info); |
287 | 288 | ||
289 | extern struct key *request_key_with_auxdata(struct key_type *type, | ||
290 | const char *description, | ||
291 | const char *callout_info, | ||
292 | void *aux); | ||
293 | |||
288 | extern int key_validate(struct key *key); | 294 | extern int key_validate(struct key *key); |
289 | 295 | ||
290 | extern key_ref_t key_create_or_update(key_ref_t keyring, | 296 | extern key_ref_t key_create_or_update(key_ref_t keyring, |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 2d229327959e..0503b2ed8bae 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -46,6 +46,8 @@ enum kobject_action { | |||
46 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ | 46 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ |
47 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ | 47 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ |
48 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ | 48 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ |
49 | KOBJ_UNDOCK = (__force kobject_action_t) 0x08, /* undocking */ | ||
50 | KOBJ_DOCK = (__force kobject_action_t) 0x09, /* dock */ | ||
49 | }; | 51 | }; |
50 | 52 | ||
51 | struct kobject { | 53 | struct kobject { |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 20b1cf527c60..6cc497a2b6da 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
33 | #include <asm/scatterlist.h> | ||
33 | #include <asm/io.h> | 34 | #include <asm/io.h> |
34 | #include <linux/ata.h> | 35 | #include <linux/ata.h> |
35 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
@@ -130,6 +131,7 @@ enum { | |||
130 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, | 131 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, |
131 | 132 | ||
132 | ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ | 133 | ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ |
134 | ATA_DFLAG_SUSPENDED = (1 << 9), /* device suspended */ | ||
133 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, | 135 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, |
134 | 136 | ||
135 | ATA_DFLAG_DETACH = (1 << 16), | 137 | ATA_DFLAG_DETACH = (1 << 16), |
@@ -159,22 +161,28 @@ enum { | |||
159 | ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */ | 161 | ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */ |
160 | ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H | 162 | ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H |
161 | * Register FIS clearing BSY */ | 163 | * Register FIS clearing BSY */ |
162 | |||
163 | ATA_FLAG_DEBUGMSG = (1 << 13), | 164 | ATA_FLAG_DEBUGMSG = (1 << 13), |
164 | ATA_FLAG_FLUSH_PORT_TASK = (1 << 14), /* flush port task */ | ||
165 | 165 | ||
166 | ATA_FLAG_EH_PENDING = (1 << 15), /* EH pending */ | 166 | /* The following flag belongs to ap->pflags but is kept in |
167 | ATA_FLAG_EH_IN_PROGRESS = (1 << 16), /* EH in progress */ | 167 | * ap->flags because it's referenced in many LLDs and will be |
168 | ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */ | 168 | * removed in not-too-distant future. |
169 | ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */ | 169 | */ |
170 | ATA_FLAG_LOADING = (1 << 19), /* boot/loading probe */ | 170 | ATA_FLAG_DISABLED = (1 << 23), /* port is disabled, ignore it */ |
171 | ATA_FLAG_UNLOADING = (1 << 20), /* module is unloading */ | 171 | |
172 | ATA_FLAG_SCSI_HOTPLUG = (1 << 21), /* SCSI hotplug scheduled */ | 172 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
173 | 173 | ||
174 | ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */ | 174 | /* struct ata_port pflags */ |
175 | ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */ | 175 | ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */ |
176 | ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */ | ||
177 | ATA_PFLAG_FROZEN = (1 << 2), /* port is frozen */ | ||
178 | ATA_PFLAG_RECOVERED = (1 << 3), /* recovery action performed */ | ||
179 | ATA_PFLAG_LOADING = (1 << 4), /* boot/loading probe */ | ||
180 | ATA_PFLAG_UNLOADING = (1 << 5), /* module is unloading */ | ||
181 | ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ | ||
176 | 182 | ||
177 | /* bits 24:31 of ap->flags are reserved for LLDD specific flags */ | 183 | ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ |
184 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ | ||
185 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | ||
178 | 186 | ||
179 | /* struct ata_queued_cmd flags */ | 187 | /* struct ata_queued_cmd flags */ |
180 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ | 188 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ |
@@ -247,12 +255,19 @@ enum { | |||
247 | ATA_EH_REVALIDATE = (1 << 0), | 255 | ATA_EH_REVALIDATE = (1 << 0), |
248 | ATA_EH_SOFTRESET = (1 << 1), | 256 | ATA_EH_SOFTRESET = (1 << 1), |
249 | ATA_EH_HARDRESET = (1 << 2), | 257 | ATA_EH_HARDRESET = (1 << 2), |
258 | ATA_EH_SUSPEND = (1 << 3), | ||
259 | ATA_EH_RESUME = (1 << 4), | ||
260 | ATA_EH_PM_FREEZE = (1 << 5), | ||
250 | 261 | ||
251 | ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, | 262 | ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, |
252 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, | 263 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_SUSPEND | |
264 | ATA_EH_RESUME | ATA_EH_PM_FREEZE, | ||
253 | 265 | ||
254 | /* ata_eh_info->flags */ | 266 | /* ata_eh_info->flags */ |
255 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ | 267 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ |
268 | ATA_EHI_RESUME_LINK = (1 << 1), /* need to resume link */ | ||
269 | ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */ | ||
270 | ATA_EHI_QUIET = (1 << 3), /* be quiet */ | ||
256 | 271 | ||
257 | ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ | 272 | ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ |
258 | 273 | ||
@@ -485,6 +500,7 @@ struct ata_port { | |||
485 | const struct ata_port_operations *ops; | 500 | const struct ata_port_operations *ops; |
486 | spinlock_t *lock; | 501 | spinlock_t *lock; |
487 | unsigned long flags; /* ATA_FLAG_xxx */ | 502 | unsigned long flags; /* ATA_FLAG_xxx */ |
503 | unsigned int pflags; /* ATA_PFLAG_xxx */ | ||
488 | unsigned int id; /* unique id req'd by scsi midlyr */ | 504 | unsigned int id; /* unique id req'd by scsi midlyr */ |
489 | unsigned int port_no; /* unique port #; from zero */ | 505 | unsigned int port_no; /* unique port #; from zero */ |
490 | unsigned int hard_port_no; /* hardware port #; from zero */ | 506 | unsigned int hard_port_no; /* hardware port #; from zero */ |
@@ -534,6 +550,9 @@ struct ata_port { | |||
534 | struct list_head eh_done_q; | 550 | struct list_head eh_done_q; |
535 | wait_queue_head_t eh_wait_q; | 551 | wait_queue_head_t eh_wait_q; |
536 | 552 | ||
553 | pm_message_t pm_mesg; | ||
554 | int *pm_result; | ||
555 | |||
537 | void *private_data; | 556 | void *private_data; |
538 | 557 | ||
539 | u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ | 558 | u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ |
@@ -588,6 +607,9 @@ struct ata_port_operations { | |||
588 | void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, | 607 | void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, |
589 | u32 val); | 608 | u32 val); |
590 | 609 | ||
610 | int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); | ||
611 | int (*port_resume) (struct ata_port *ap); | ||
612 | |||
591 | int (*port_start) (struct ata_port *ap); | 613 | int (*port_start) (struct ata_port *ap); |
592 | void (*port_stop) (struct ata_port *ap); | 614 | void (*port_stop) (struct ata_port *ap); |
593 | 615 | ||
@@ -621,9 +643,18 @@ struct ata_timing { | |||
621 | 643 | ||
622 | #define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) | 644 | #define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) |
623 | 645 | ||
624 | extern const unsigned long sata_deb_timing_boot[]; | 646 | extern const unsigned long sata_deb_timing_normal[]; |
625 | extern const unsigned long sata_deb_timing_eh[]; | 647 | extern const unsigned long sata_deb_timing_hotplug[]; |
626 | extern const unsigned long sata_deb_timing_before_fsrst[]; | 648 | extern const unsigned long sata_deb_timing_long[]; |
649 | |||
650 | static inline const unsigned long * | ||
651 | sata_ehc_deb_timing(struct ata_eh_context *ehc) | ||
652 | { | ||
653 | if (ehc->i.flags & ATA_EHI_HOTPLUGGED) | ||
654 | return sata_deb_timing_hotplug; | ||
655 | else | ||
656 | return sata_deb_timing_normal; | ||
657 | } | ||
627 | 658 | ||
628 | extern void ata_port_probe(struct ata_port *); | 659 | extern void ata_port_probe(struct ata_port *); |
629 | extern void __sata_phy_reset(struct ata_port *ap); | 660 | extern void __sata_phy_reset(struct ata_port *ap); |
@@ -643,6 +674,8 @@ extern void ata_std_ports(struct ata_ioports *ioaddr); | |||
643 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, | 674 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, |
644 | unsigned int n_ports); | 675 | unsigned int n_ports); |
645 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 676 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
677 | extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state); | ||
678 | extern void ata_pci_device_do_resume(struct pci_dev *pdev); | ||
646 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); | 679 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); |
647 | extern int ata_pci_device_resume(struct pci_dev *pdev); | 680 | extern int ata_pci_device_resume(struct pci_dev *pdev); |
648 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); | 681 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); |
@@ -663,8 +696,9 @@ extern int ata_port_online(struct ata_port *ap); | |||
663 | extern int ata_port_offline(struct ata_port *ap); | 696 | extern int ata_port_offline(struct ata_port *ap); |
664 | extern int ata_scsi_device_resume(struct scsi_device *); | 697 | extern int ata_scsi_device_resume(struct scsi_device *); |
665 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); | 698 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); |
666 | extern int ata_device_resume(struct ata_device *); | 699 | extern int ata_host_set_suspend(struct ata_host_set *host_set, |
667 | extern int ata_device_suspend(struct ata_device *, pm_message_t state); | 700 | pm_message_t mesg); |
701 | extern void ata_host_set_resume(struct ata_host_set *host_set); | ||
668 | extern int ata_ratelimit(void); | 702 | extern int ata_ratelimit(void); |
669 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 703 | extern unsigned int ata_busy_sleep(struct ata_port *ap, |
670 | unsigned long timeout_pat, | 704 | unsigned long timeout_pat, |
@@ -824,19 +858,24 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
824 | (ehi)->desc_len = 0; \ | 858 | (ehi)->desc_len = 0; \ |
825 | } while (0) | 859 | } while (0) |
826 | 860 | ||
827 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | 861 | static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi) |
828 | { | 862 | { |
829 | if (ehi->flags & ATA_EHI_HOTPLUGGED) | 863 | if (ehi->flags & ATA_EHI_HOTPLUGGED) |
830 | return; | 864 | return; |
831 | 865 | ||
832 | ehi->flags |= ATA_EHI_HOTPLUGGED; | 866 | ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; |
833 | ehi->hotplug_timestamp = jiffies; | 867 | ehi->hotplug_timestamp = jiffies; |
834 | 868 | ||
835 | ehi->err_mask |= AC_ERR_ATA_BUS; | ||
836 | ehi->action |= ATA_EH_SOFTRESET; | 869 | ehi->action |= ATA_EH_SOFTRESET; |
837 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; | 870 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; |
838 | } | 871 | } |
839 | 872 | ||
873 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | ||
874 | { | ||
875 | __ata_ehi_hotplugged(ehi); | ||
876 | ehi->err_mask |= AC_ERR_ATA_BUS; | ||
877 | } | ||
878 | |||
840 | /* | 879 | /* |
841 | * qc helpers | 880 | * qc helpers |
842 | */ | 881 | */ |
@@ -887,6 +926,9 @@ static inline unsigned int ata_tag_internal(unsigned int tag) | |||
887 | return tag == ATA_MAX_QUEUE - 1; | 926 | return tag == ATA_MAX_QUEUE - 1; |
888 | } | 927 | } |
889 | 928 | ||
929 | /* | ||
930 | * device helpers | ||
931 | */ | ||
890 | static inline unsigned int ata_class_enabled(unsigned int class) | 932 | static inline unsigned int ata_class_enabled(unsigned int class) |
891 | { | 933 | { |
892 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | 934 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; |
@@ -917,6 +959,22 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev) | |||
917 | return ata_class_absent(dev->class); | 959 | return ata_class_absent(dev->class); |
918 | } | 960 | } |
919 | 961 | ||
962 | static inline unsigned int ata_dev_ready(const struct ata_device *dev) | ||
963 | { | ||
964 | return ata_dev_enabled(dev) && !(dev->flags & ATA_DFLAG_SUSPENDED); | ||
965 | } | ||
966 | |||
967 | /* | ||
968 | * port helpers | ||
969 | */ | ||
970 | static inline int ata_port_max_devices(const struct ata_port *ap) | ||
971 | { | ||
972 | if (ap->flags & ATA_FLAG_SLAVE_POSS) | ||
973 | return 2; | ||
974 | return 1; | ||
975 | } | ||
976 | |||
977 | |||
920 | static inline u8 ata_chk_status(struct ata_port *ap) | 978 | static inline u8 ata_chk_status(struct ata_port *ap) |
921 | { | 979 | { |
922 | return ap->ops->check_status(ap); | 980 | return ap->ops->check_status(ap); |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h new file mode 100644 index 000000000000..c040a8c969aa --- /dev/null +++ b/include/linux/lockdep.h | |||
@@ -0,0 +1,353 @@ | |||
1 | /* | ||
2 | * Runtime locking correctness validator | ||
3 | * | ||
4 | * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> | ||
5 | * | ||
6 | * see Documentation/lockdep-design.txt for more details. | ||
7 | */ | ||
8 | #ifndef __LINUX_LOCKDEP_H | ||
9 | #define __LINUX_LOCKDEP_H | ||
10 | |||
11 | #include <linux/linkage.h> | ||
12 | #include <linux/list.h> | ||
13 | #include <linux/debug_locks.h> | ||
14 | #include <linux/stacktrace.h> | ||
15 | |||
16 | #ifdef CONFIG_LOCKDEP | ||
17 | |||
18 | /* | ||
19 | * Lock-class usage-state bits: | ||
20 | */ | ||
21 | enum lock_usage_bit | ||
22 | { | ||
23 | LOCK_USED = 0, | ||
24 | LOCK_USED_IN_HARDIRQ, | ||
25 | LOCK_USED_IN_SOFTIRQ, | ||
26 | LOCK_ENABLED_SOFTIRQS, | ||
27 | LOCK_ENABLED_HARDIRQS, | ||
28 | LOCK_USED_IN_HARDIRQ_READ, | ||
29 | LOCK_USED_IN_SOFTIRQ_READ, | ||
30 | LOCK_ENABLED_SOFTIRQS_READ, | ||
31 | LOCK_ENABLED_HARDIRQS_READ, | ||
32 | LOCK_USAGE_STATES | ||
33 | }; | ||
34 | |||
35 | /* | ||
36 | * Usage-state bitmasks: | ||
37 | */ | ||
38 | #define LOCKF_USED (1 << LOCK_USED) | ||
39 | #define LOCKF_USED_IN_HARDIRQ (1 << LOCK_USED_IN_HARDIRQ) | ||
40 | #define LOCKF_USED_IN_SOFTIRQ (1 << LOCK_USED_IN_SOFTIRQ) | ||
41 | #define LOCKF_ENABLED_HARDIRQS (1 << LOCK_ENABLED_HARDIRQS) | ||
42 | #define LOCKF_ENABLED_SOFTIRQS (1 << LOCK_ENABLED_SOFTIRQS) | ||
43 | |||
44 | #define LOCKF_ENABLED_IRQS (LOCKF_ENABLED_HARDIRQS | LOCKF_ENABLED_SOFTIRQS) | ||
45 | #define LOCKF_USED_IN_IRQ (LOCKF_USED_IN_HARDIRQ | LOCKF_USED_IN_SOFTIRQ) | ||
46 | |||
47 | #define LOCKF_USED_IN_HARDIRQ_READ (1 << LOCK_USED_IN_HARDIRQ_READ) | ||
48 | #define LOCKF_USED_IN_SOFTIRQ_READ (1 << LOCK_USED_IN_SOFTIRQ_READ) | ||
49 | #define LOCKF_ENABLED_HARDIRQS_READ (1 << LOCK_ENABLED_HARDIRQS_READ) | ||
50 | #define LOCKF_ENABLED_SOFTIRQS_READ (1 << LOCK_ENABLED_SOFTIRQS_READ) | ||
51 | |||
52 | #define LOCKF_ENABLED_IRQS_READ \ | ||
53 | (LOCKF_ENABLED_HARDIRQS_READ | LOCKF_ENABLED_SOFTIRQS_READ) | ||
54 | #define LOCKF_USED_IN_IRQ_READ \ | ||
55 | (LOCKF_USED_IN_HARDIRQ_READ | LOCKF_USED_IN_SOFTIRQ_READ) | ||
56 | |||
57 | #define MAX_LOCKDEP_SUBCLASSES 8UL | ||
58 | |||
59 | /* | ||
60 | * Lock-classes are keyed via unique addresses, by embedding the | ||
61 | * lockclass-key into the kernel (or module) .data section. (For | ||
62 | * static locks we use the lock address itself as the key.) | ||
63 | */ | ||
64 | struct lockdep_subclass_key { | ||
65 | char __one_byte; | ||
66 | } __attribute__ ((__packed__)); | ||
67 | |||
68 | struct lock_class_key { | ||
69 | struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES]; | ||
70 | }; | ||
71 | |||
72 | /* | ||
73 | * The lock-class itself: | ||
74 | */ | ||
75 | struct lock_class { | ||
76 | /* | ||
77 | * class-hash: | ||
78 | */ | ||
79 | struct list_head hash_entry; | ||
80 | |||
81 | /* | ||
82 | * global list of all lock-classes: | ||
83 | */ | ||
84 | struct list_head lock_entry; | ||
85 | |||
86 | struct lockdep_subclass_key *key; | ||
87 | unsigned int subclass; | ||
88 | |||
89 | /* | ||
90 | * IRQ/softirq usage tracking bits: | ||
91 | */ | ||
92 | unsigned long usage_mask; | ||
93 | struct stack_trace usage_traces[LOCK_USAGE_STATES]; | ||
94 | |||
95 | /* | ||
96 | * These fields represent a directed graph of lock dependencies, | ||
97 | * to every node we attach a list of "forward" and a list of | ||
98 | * "backward" graph nodes. | ||
99 | */ | ||
100 | struct list_head locks_after, locks_before; | ||
101 | |||
102 | /* | ||
103 | * Generation counter, when doing certain classes of graph walking, | ||
104 | * to ensure that we check one node only once: | ||
105 | */ | ||
106 | unsigned int version; | ||
107 | |||
108 | /* | ||
109 | * Statistics counter: | ||
110 | */ | ||
111 | unsigned long ops; | ||
112 | |||
113 | const char *name; | ||
114 | int name_version; | ||
115 | }; | ||
116 | |||
117 | /* | ||
118 | * Map the lock object (the lock instance) to the lock-class object. | ||
119 | * This is embedded into specific lock instances: | ||
120 | */ | ||
121 | struct lockdep_map { | ||
122 | struct lock_class_key *key; | ||
123 | struct lock_class *class_cache; | ||
124 | const char *name; | ||
125 | }; | ||
126 | |||
127 | /* | ||
128 | * Every lock has a list of other locks that were taken after it. | ||
129 | * We only grow the list, never remove from it: | ||
130 | */ | ||
131 | struct lock_list { | ||
132 | struct list_head entry; | ||
133 | struct lock_class *class; | ||
134 | struct stack_trace trace; | ||
135 | }; | ||
136 | |||
137 | /* | ||
138 | * We record lock dependency chains, so that we can cache them: | ||
139 | */ | ||
140 | struct lock_chain { | ||
141 | struct list_head entry; | ||
142 | u64 chain_key; | ||
143 | }; | ||
144 | |||
145 | struct held_lock { | ||
146 | /* | ||
147 | * One-way hash of the dependency chain up to this point. We | ||
148 | * hash the hashes step by step as the dependency chain grows. | ||
149 | * | ||
150 | * We use it for dependency-caching and we skip detection | ||
151 | * passes and dependency-updates if there is a cache-hit, so | ||
152 | * it is absolutely critical for 100% coverage of the validator | ||
153 | * to have a unique key value for every unique dependency path | ||
154 | * that can occur in the system, to make a unique hash value | ||
155 | * as likely as possible - hence the 64-bit width. | ||
156 | * | ||
157 | * The task struct holds the current hash value (initialized | ||
158 | * with zero), here we store the previous hash value: | ||
159 | */ | ||
160 | u64 prev_chain_key; | ||
161 | struct lock_class *class; | ||
162 | unsigned long acquire_ip; | ||
163 | struct lockdep_map *instance; | ||
164 | |||
165 | /* | ||
166 | * The lock-stack is unified in that the lock chains of interrupt | ||
167 | * contexts nest ontop of process context chains, but we 'separate' | ||
168 | * the hashes by starting with 0 if we cross into an interrupt | ||
169 | * context, and we also keep do not add cross-context lock | ||
170 | * dependencies - the lock usage graph walking covers that area | ||
171 | * anyway, and we'd just unnecessarily increase the number of | ||
172 | * dependencies otherwise. [Note: hardirq and softirq contexts | ||
173 | * are separated from each other too.] | ||
174 | * | ||
175 | * The following field is used to detect when we cross into an | ||
176 | * interrupt context: | ||
177 | */ | ||
178 | int irq_context; | ||
179 | int trylock; | ||
180 | int read; | ||
181 | int check; | ||
182 | int hardirqs_off; | ||
183 | }; | ||
184 | |||
185 | /* | ||
186 | * Initialization, self-test and debugging-output methods: | ||
187 | */ | ||
188 | extern void lockdep_init(void); | ||
189 | extern void lockdep_info(void); | ||
190 | extern void lockdep_reset(void); | ||
191 | extern void lockdep_reset_lock(struct lockdep_map *lock); | ||
192 | extern void lockdep_free_key_range(void *start, unsigned long size); | ||
193 | |||
194 | extern void lockdep_off(void); | ||
195 | extern void lockdep_on(void); | ||
196 | extern int lockdep_internal(void); | ||
197 | |||
198 | /* | ||
199 | * These methods are used by specific locking variants (spinlocks, | ||
200 | * rwlocks, mutexes and rwsems) to pass init/acquire/release events | ||
201 | * to lockdep: | ||
202 | */ | ||
203 | |||
204 | extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | ||
205 | struct lock_class_key *key); | ||
206 | |||
207 | /* | ||
208 | * Reinitialize a lock key - for cases where there is special locking or | ||
209 | * special initialization of locks so that the validator gets the scope | ||
210 | * of dependencies wrong: they are either too broad (they need a class-split) | ||
211 | * or they are too narrow (they suffer from a false class-split): | ||
212 | */ | ||
213 | #define lockdep_set_class(lock, key) \ | ||
214 | lockdep_init_map(&(lock)->dep_map, #key, key) | ||
215 | #define lockdep_set_class_and_name(lock, key, name) \ | ||
216 | lockdep_init_map(&(lock)->dep_map, name, key) | ||
217 | |||
218 | /* | ||
219 | * Acquire a lock. | ||
220 | * | ||
221 | * Values for "read": | ||
222 | * | ||
223 | * 0: exclusive (write) acquire | ||
224 | * 1: read-acquire (no recursion allowed) | ||
225 | * 2: read-acquire with same-instance recursion allowed | ||
226 | * | ||
227 | * Values for check: | ||
228 | * | ||
229 | * 0: disabled | ||
230 | * 1: simple checks (freeing, held-at-exit-time, etc.) | ||
231 | * 2: full validation | ||
232 | */ | ||
233 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | ||
234 | int trylock, int read, int check, unsigned long ip); | ||
235 | |||
236 | extern void lock_release(struct lockdep_map *lock, int nested, | ||
237 | unsigned long ip); | ||
238 | |||
239 | # define INIT_LOCKDEP .lockdep_recursion = 0, | ||
240 | |||
241 | #else /* !LOCKDEP */ | ||
242 | |||
243 | static inline void lockdep_off(void) | ||
244 | { | ||
245 | } | ||
246 | |||
247 | static inline void lockdep_on(void) | ||
248 | { | ||
249 | } | ||
250 | |||
251 | static inline int lockdep_internal(void) | ||
252 | { | ||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | # define lock_acquire(l, s, t, r, c, i) do { } while (0) | ||
257 | # define lock_release(l, n, i) do { } while (0) | ||
258 | # define lockdep_init() do { } while (0) | ||
259 | # define lockdep_info() do { } while (0) | ||
260 | # define lockdep_init_map(lock, name, key) do { (void)(key); } while (0) | ||
261 | # define lockdep_set_class(lock, key) do { (void)(key); } while (0) | ||
262 | # define lockdep_set_class_and_name(lock, key, name) \ | ||
263 | do { (void)(key); } while (0) | ||
264 | # define INIT_LOCKDEP | ||
265 | # define lockdep_reset() do { debug_locks = 1; } while (0) | ||
266 | # define lockdep_free_key_range(start, size) do { } while (0) | ||
267 | /* | ||
268 | * The class key takes no space if lockdep is disabled: | ||
269 | */ | ||
270 | struct lock_class_key { }; | ||
271 | #endif /* !LOCKDEP */ | ||
272 | |||
273 | #if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS) | ||
274 | extern void early_init_irq_lock_class(void); | ||
275 | #else | ||
276 | # define early_init_irq_lock_class() do { } while (0) | ||
277 | #endif | ||
278 | |||
279 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
280 | extern void early_boot_irqs_off(void); | ||
281 | extern void early_boot_irqs_on(void); | ||
282 | #else | ||
283 | # define early_boot_irqs_off() do { } while (0) | ||
284 | # define early_boot_irqs_on() do { } while (0) | ||
285 | #endif | ||
286 | |||
287 | /* | ||
288 | * For trivial one-depth nesting of a lock-class, the following | ||
289 | * global define can be used. (Subsystems with multiple levels | ||
290 | * of nesting should define their own lock-nesting subclasses.) | ||
291 | */ | ||
292 | #define SINGLE_DEPTH_NESTING 1 | ||
293 | |||
294 | /* | ||
295 | * Map the dependency ops to NOP or to real lockdep ops, depending | ||
296 | * on the per lock-class debug mode: | ||
297 | */ | ||
298 | |||
299 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
300 | # ifdef CONFIG_PROVE_LOCKING | ||
301 | # define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | ||
302 | # else | ||
303 | # define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | ||
304 | # endif | ||
305 | # define spin_release(l, n, i) lock_release(l, n, i) | ||
306 | #else | ||
307 | # define spin_acquire(l, s, t, i) do { } while (0) | ||
308 | # define spin_release(l, n, i) do { } while (0) | ||
309 | #endif | ||
310 | |||
311 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
312 | # ifdef CONFIG_PROVE_LOCKING | ||
313 | # define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | ||
314 | # define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, i) | ||
315 | # else | ||
316 | # define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | ||
317 | # define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, i) | ||
318 | # endif | ||
319 | # define rwlock_release(l, n, i) lock_release(l, n, i) | ||
320 | #else | ||
321 | # define rwlock_acquire(l, s, t, i) do { } while (0) | ||
322 | # define rwlock_acquire_read(l, s, t, i) do { } while (0) | ||
323 | # define rwlock_release(l, n, i) do { } while (0) | ||
324 | #endif | ||
325 | |||
326 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
327 | # ifdef CONFIG_PROVE_LOCKING | ||
328 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | ||
329 | # else | ||
330 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | ||
331 | # endif | ||
332 | # define mutex_release(l, n, i) lock_release(l, n, i) | ||
333 | #else | ||
334 | # define mutex_acquire(l, s, t, i) do { } while (0) | ||
335 | # define mutex_release(l, n, i) do { } while (0) | ||
336 | #endif | ||
337 | |||
338 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
339 | # ifdef CONFIG_PROVE_LOCKING | ||
340 | # define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) | ||
341 | # define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, i) | ||
342 | # else | ||
343 | # define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) | ||
344 | # define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, i) | ||
345 | # endif | ||
346 | # define rwsem_release(l, n, i) lock_release(l, n, i) | ||
347 | #else | ||
348 | # define rwsem_acquire(l, s, t, i) do { } while (0) | ||
349 | # define rwsem_acquire_read(l, s, t, i) do { } while (0) | ||
350 | # define rwsem_release(l, n, i) do { } while (0) | ||
351 | #endif | ||
352 | |||
353 | #endif /* __LINUX_LOCKDEP_H */ | ||
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h index bbc93ae217e1..432b2fa24929 100644 --- a/include/linux/mc146818rtc.h +++ b/include/linux/mc146818rtc.h | |||
@@ -89,4 +89,11 @@ extern spinlock_t rtc_lock; /* serialize CMOS RAM access */ | |||
89 | # define RTC_VRT 0x80 /* valid RAM and time */ | 89 | # define RTC_VRT 0x80 /* valid RAM and time */ |
90 | /**********************************************************************/ | 90 | /**********************************************************************/ |
91 | 91 | ||
92 | #ifndef ARCH_RTC_LOCATION /* Override by <asm/mc146818rtc.h>? */ | ||
93 | |||
94 | #define RTC_IO_EXTENT 0x8 | ||
95 | #define RTC_IOMAPPED 1 /* Default to I/O mapping. */ | ||
96 | |||
97 | #endif /* ARCH_RTC_LOCATION */ | ||
98 | |||
92 | #endif /* _MC146818RTC_H */ | 99 | #endif /* _MC146818RTC_H */ |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 5b584dafb5a6..b03cfb91e228 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -40,7 +40,6 @@ struct miscdevice { | |||
40 | struct list_head list; | 40 | struct list_head list; |
41 | struct device *dev; | 41 | struct device *dev; |
42 | struct class_device *class; | 42 | struct class_device *class; |
43 | char devfs_name[64]; | ||
44 | }; | 43 | }; |
45 | 44 | ||
46 | extern int misc_register(struct miscdevice * misc); | 45 | extern int misc_register(struct miscdevice * misc); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index c41a1299b8cf..990957e0929f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/prio_tree.h> | 14 | #include <linux/prio_tree.h> |
15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/debug_locks.h> | ||
17 | 18 | ||
18 | struct mempolicy; | 19 | struct mempolicy; |
19 | struct anon_vma; | 20 | struct anon_vma; |
@@ -36,7 +37,6 @@ extern int sysctl_legacy_va_layout; | |||
36 | #include <asm/page.h> | 37 | #include <asm/page.h> |
37 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
38 | #include <asm/processor.h> | 39 | #include <asm/processor.h> |
39 | #include <asm/atomic.h> | ||
40 | 40 | ||
41 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) | 41 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
42 | 42 | ||
@@ -515,6 +515,11 @@ static inline void set_page_links(struct page *page, unsigned long zone, | |||
515 | set_page_section(page, pfn_to_section_nr(pfn)); | 515 | set_page_section(page, pfn_to_section_nr(pfn)); |
516 | } | 516 | } |
517 | 517 | ||
518 | /* | ||
519 | * Some inline functions in vmstat.h depend on page_zone() | ||
520 | */ | ||
521 | #include <linux/vmstat.h> | ||
522 | |||
518 | #ifndef CONFIG_DISCONTIGMEM | 523 | #ifndef CONFIG_DISCONTIGMEM |
519 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ | 524 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ |
520 | extern struct page *mem_map; | 525 | extern struct page *mem_map; |
@@ -1030,13 +1035,6 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
1030 | } | 1035 | } |
1031 | #endif /* CONFIG_PROC_FS */ | 1036 | #endif /* CONFIG_PROC_FS */ |
1032 | 1037 | ||
1033 | static inline void | ||
1034 | debug_check_no_locks_freed(const void *from, unsigned long len) | ||
1035 | { | ||
1036 | mutex_debug_check_no_locks_freed(from, len); | ||
1037 | rt_mutex_debug_check_no_locks_freed(from, len); | ||
1038 | } | ||
1039 | |||
1040 | #ifndef CONFIG_DEBUG_PAGEALLOC | 1038 | #ifndef CONFIG_DEBUG_PAGEALLOC |
1041 | static inline void | 1039 | static inline void |
1042 | kernel_map_pages(struct page *page, int numpages, int enable) | 1040 | kernel_map_pages(struct page *page, int numpages, int enable) |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d6120fa69116..656b588a9f96 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -46,6 +46,27 @@ struct zone_padding { | |||
46 | #define ZONE_PADDING(name) | 46 | #define ZONE_PADDING(name) |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | enum zone_stat_item { | ||
50 | NR_ANON_PAGES, /* Mapped anonymous pages */ | ||
51 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. | ||
52 | only modified from process context */ | ||
53 | NR_FILE_PAGES, | ||
54 | NR_SLAB, /* Pages used by slab allocator */ | ||
55 | NR_PAGETABLE, /* used for pagetables */ | ||
56 | NR_FILE_DIRTY, | ||
57 | NR_WRITEBACK, | ||
58 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | ||
59 | NR_BOUNCE, | ||
60 | #ifdef CONFIG_NUMA | ||
61 | NUMA_HIT, /* allocated in intended node */ | ||
62 | NUMA_MISS, /* allocated in non intended node */ | ||
63 | NUMA_FOREIGN, /* was intended here, hit elsewhere */ | ||
64 | NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */ | ||
65 | NUMA_LOCAL, /* allocation from local node */ | ||
66 | NUMA_OTHER, /* allocation from other node */ | ||
67 | #endif | ||
68 | NR_VM_ZONE_STAT_ITEMS }; | ||
69 | |||
49 | struct per_cpu_pages { | 70 | struct per_cpu_pages { |
50 | int count; /* number of pages in the list */ | 71 | int count; /* number of pages in the list */ |
51 | int high; /* high watermark, emptying needed */ | 72 | int high; /* high watermark, emptying needed */ |
@@ -55,13 +76,8 @@ struct per_cpu_pages { | |||
55 | 76 | ||
56 | struct per_cpu_pageset { | 77 | struct per_cpu_pageset { |
57 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ | 78 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ |
58 | #ifdef CONFIG_NUMA | 79 | #ifdef CONFIG_SMP |
59 | unsigned long numa_hit; /* allocated in intended node */ | 80 | s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; |
60 | unsigned long numa_miss; /* allocated in non intended node */ | ||
61 | unsigned long numa_foreign; /* was intended here, hit elsewhere */ | ||
62 | unsigned long interleave_hit; /* interleaver prefered this zone */ | ||
63 | unsigned long local_node; /* allocation from local node */ | ||
64 | unsigned long other_node; /* allocation from other node */ | ||
65 | #endif | 81 | #endif |
66 | } ____cacheline_aligned_in_smp; | 82 | } ____cacheline_aligned_in_smp; |
67 | 83 | ||
@@ -134,6 +150,10 @@ struct zone { | |||
134 | unsigned long lowmem_reserve[MAX_NR_ZONES]; | 150 | unsigned long lowmem_reserve[MAX_NR_ZONES]; |
135 | 151 | ||
136 | #ifdef CONFIG_NUMA | 152 | #ifdef CONFIG_NUMA |
153 | /* | ||
154 | * zone reclaim becomes active if more unmapped pages exist. | ||
155 | */ | ||
156 | unsigned long min_unmapped_ratio; | ||
137 | struct per_cpu_pageset *pageset[NR_CPUS]; | 157 | struct per_cpu_pageset *pageset[NR_CPUS]; |
138 | #else | 158 | #else |
139 | struct per_cpu_pageset pageset[NR_CPUS]; | 159 | struct per_cpu_pageset pageset[NR_CPUS]; |
@@ -165,12 +185,8 @@ struct zone { | |||
165 | /* A count of how many reclaimers are scanning this zone */ | 185 | /* A count of how many reclaimers are scanning this zone */ |
166 | atomic_t reclaim_in_progress; | 186 | atomic_t reclaim_in_progress; |
167 | 187 | ||
168 | /* | 188 | /* Zone statistics */ |
169 | * timestamp (in jiffies) of the last zone reclaim that did not | 189 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; |
170 | * result in freeing of pages. This is used to avoid repeated scans | ||
171 | * if all memory in the zone is in use. | ||
172 | */ | ||
173 | unsigned long last_unsuccessful_zone_reclaim; | ||
174 | 190 | ||
175 | /* | 191 | /* |
176 | * prev_priority holds the scanning priority for this zone. It is | 192 | * prev_priority holds the scanning priority for this zone. It is |
@@ -402,6 +418,8 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, | |||
402 | void __user *, size_t *, loff_t *); | 418 | void __user *, size_t *, loff_t *); |
403 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *, | 419 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *, |
404 | void __user *, size_t *, loff_t *); | 420 | void __user *, size_t *, loff_t *); |
421 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | ||
422 | struct file *, void __user *, size_t *, loff_t *); | ||
405 | 423 | ||
406 | #include <linux/topology.h> | 424 | #include <linux/topology.h> |
407 | /* Returns the number of the current Node. */ | 425 | /* Returns the number of the current Node. */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 9ebbb74b7b72..d06c74fb8c26 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -203,6 +203,15 @@ void *__symbol_get_gpl(const char *symbol); | |||
203 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ | 203 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ |
204 | __EXPORT_SYMBOL(sym, "_gpl_future") | 204 | __EXPORT_SYMBOL(sym, "_gpl_future") |
205 | 205 | ||
206 | |||
207 | #ifdef CONFIG_UNUSED_SYMBOLS | ||
208 | #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused") | ||
209 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl") | ||
210 | #else | ||
211 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
212 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
213 | #endif | ||
214 | |||
206 | #endif | 215 | #endif |
207 | 216 | ||
208 | struct module_ref | 217 | struct module_ref |
@@ -261,6 +270,15 @@ struct module | |||
261 | unsigned int num_gpl_syms; | 270 | unsigned int num_gpl_syms; |
262 | const unsigned long *gpl_crcs; | 271 | const unsigned long *gpl_crcs; |
263 | 272 | ||
273 | /* unused exported symbols. */ | ||
274 | const struct kernel_symbol *unused_syms; | ||
275 | unsigned int num_unused_syms; | ||
276 | const unsigned long *unused_crcs; | ||
277 | /* GPL-only, unused exported symbols. */ | ||
278 | const struct kernel_symbol *unused_gpl_syms; | ||
279 | unsigned int num_unused_gpl_syms; | ||
280 | const unsigned long *unused_gpl_crcs; | ||
281 | |||
264 | /* symbols that will be GPL-only in the near future. */ | 282 | /* symbols that will be GPL-only in the near future. */ |
265 | const struct kernel_symbol *gpl_future_syms; | 283 | const struct kernel_symbol *gpl_future_syms; |
266 | unsigned int num_gpl_future_syms; | 284 | unsigned int num_gpl_future_syms; |
@@ -340,6 +358,7 @@ static inline int module_is_live(struct module *mod) | |||
340 | /* Is this address in a module? (second is with no locks, for oops) */ | 358 | /* Is this address in a module? (second is with no locks, for oops) */ |
341 | struct module *module_text_address(unsigned long addr); | 359 | struct module *module_text_address(unsigned long addr); |
342 | struct module *__module_text_address(unsigned long addr); | 360 | struct module *__module_text_address(unsigned long addr); |
361 | int is_module_address(unsigned long addr); | ||
343 | 362 | ||
344 | /* Returns module and fills in value, defined and namebuf, or NULL if | 363 | /* Returns module and fills in value, defined and namebuf, or NULL if |
345 | symnum out of range. */ | 364 | symnum out of range. */ |
@@ -456,6 +475,8 @@ void module_remove_driver(struct device_driver *); | |||
456 | #define EXPORT_SYMBOL(sym) | 475 | #define EXPORT_SYMBOL(sym) |
457 | #define EXPORT_SYMBOL_GPL(sym) | 476 | #define EXPORT_SYMBOL_GPL(sym) |
458 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) | 477 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) |
478 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
479 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
459 | 480 | ||
460 | /* Given an address, look for it in the exception tables. */ | 481 | /* Given an address, look for it in the exception tables. */ |
461 | static inline const struct exception_table_entry * | 482 | static inline const struct exception_table_entry * |
@@ -476,6 +497,11 @@ static inline struct module *__module_text_address(unsigned long addr) | |||
476 | return NULL; | 497 | return NULL; |
477 | } | 498 | } |
478 | 499 | ||
500 | static inline int is_module_address(unsigned long addr) | ||
501 | { | ||
502 | return 0; | ||
503 | } | ||
504 | |||
479 | /* Get/put a kernel symbol (calls should be symmetric) */ | 505 | /* Get/put a kernel symbol (calls should be symmetric) */ |
480 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) | 506 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) |
481 | #define symbol_put(x) do { } while(0) | 507 | #define symbol_put(x) do { } while(0) |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 7a7fbe87fef0..1221b7c44158 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -19,21 +19,21 @@ | |||
19 | 19 | ||
20 | /** | 20 | /** |
21 | * struct nand_bbt_descr - bad block table descriptor | 21 | * struct nand_bbt_descr - bad block table descriptor |
22 | * @param options options for this descriptor | 22 | * @options: options for this descriptor |
23 | * @param pages the page(s) where we find the bbt, used with | 23 | * @pages: the page(s) where we find the bbt, used with |
24 | * option BBT_ABSPAGE when bbt is searched, | 24 | * option BBT_ABSPAGE when bbt is searched, |
25 | * then we store the found bbts pages here. | 25 | * then we store the found bbts pages here. |
26 | * Its an array and supports up to 8 chips now | 26 | * Its an array and supports up to 8 chips now |
27 | * @param offs offset of the pattern in the oob area of the page | 27 | * @offs: offset of the pattern in the oob area of the page |
28 | * @param veroffs offset of the bbt version counter in the oob are of the page | 28 | * @veroffs: offset of the bbt version counter in the oob area of the page |
29 | * @param version version read from the bbt page during scan | 29 | * @version: version read from the bbt page during scan |
30 | * @param len length of the pattern, if 0 no pattern check is performed | 30 | * @len: length of the pattern, if 0 no pattern check is performed |
31 | * @param maxblocks maximum number of blocks to search for a bbt. This number of | 31 | * @maxblocks: maximum number of blocks to search for a bbt. This |
32 | * blocks is reserved at the end of the device | 32 | * number of blocks is reserved at the end of the device |
33 | * where the tables are written. | 33 | * where the tables are written. |
34 | * @param reserved_block_code if non-0, this pattern denotes a reserved | 34 | * @reserved_block_code: if non-0, this pattern denotes a reserved |
35 | * (rather than bad) block in the stored bbt | 35 | * (rather than bad) block in the stored bbt |
36 | * @param pattern pattern to identify bad block table or factory marked | 36 | * @pattern: pattern to identify bad block table or factory marked |
37 | * good / bad blocks, can be NULL, if len = 0 | 37 | * good / bad blocks, can be NULL, if len = 0 |
38 | * | 38 | * |
39 | * Descriptor for the bad block table marker and the descriptor for the | 39 | * Descriptor for the bad block table marker and the descriptor for the |
@@ -93,12 +93,15 @@ struct nand_bbt_descr { | |||
93 | #define ONENAND_BADBLOCK_POS 0 | 93 | #define ONENAND_BADBLOCK_POS 0 |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * struct bbt_info - [GENERIC] Bad Block Table data structure | 96 | * struct bbm_info - [GENERIC] Bad Block Table data structure |
97 | * @param bbt_erase_shift [INTERN] number of address bits in a bbt entry | 97 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
98 | * @param badblockpos [INTERN] position of the bad block marker in the oob area | 98 | * @badblockpos: [INTERN] position of the bad block marker in the oob area |
99 | * @param bbt [INTERN] bad block table pointer | 99 | * @options: options for this descriptor |
100 | * @param badblock_pattern [REPLACEABLE] bad block scan pattern used for initial bad block scan | 100 | * @bbt: [INTERN] bad block table pointer |
101 | * @param priv [OPTIONAL] pointer to private bbm date | 101 | * @isbad_bbt: function to determine if a block is bad |
102 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for | ||
103 | * initial bad block scan | ||
104 | * @priv: [OPTIONAL] pointer to private bbm date | ||
102 | */ | 105 | */ |
103 | struct bbm_info { | 106 | struct bbm_info { |
104 | int bbt_erase_shift; | 107 | int bbt_erase_shift; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 9b7a2b525d63..94a443d45258 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -77,11 +77,11 @@ typedef enum { | |||
77 | * | 77 | * |
78 | * @len: number of bytes to write/read. When a data buffer is given | 78 | * @len: number of bytes to write/read. When a data buffer is given |
79 | * (datbuf != NULL) this is the number of data bytes. When | 79 | * (datbuf != NULL) this is the number of data bytes. When |
80 | + no data buffer is available this is the number of oob bytes. | 80 | * no data buffer is available this is the number of oob bytes. |
81 | * | 81 | * |
82 | * @retlen: number of bytes written/read. When a data buffer is given | 82 | * @retlen: number of bytes written/read. When a data buffer is given |
83 | * (datbuf != NULL) this is the number of data bytes. When | 83 | * (datbuf != NULL) this is the number of data bytes. When |
84 | + no data buffer is available this is the number of oob bytes. | 84 | * no data buffer is available this is the number of oob bytes. |
85 | * | 85 | * |
86 | * @ooblen: number of oob bytes per page | 86 | * @ooblen: number of oob bytes per page |
87 | * @ooboffs: offset of oob data in the oob area (only relevant when | 87 | * @ooboffs: offset of oob data in the oob area (only relevant when |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 66559272ebcb..0b4cd2fa64aa 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -202,7 +202,7 @@ typedef enum { | |||
202 | struct nand_chip; | 202 | struct nand_chip; |
203 | 203 | ||
204 | /** | 204 | /** |
205 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices | 205 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices |
206 | * @lock: protection lock | 206 | * @lock: protection lock |
207 | * @active: the mtd device which holds the controller currently | 207 | * @active: the mtd device which holds the controller currently |
208 | * @wq: wait queue to sleep on if a NAND operation is in progress | 208 | * @wq: wait queue to sleep on if a NAND operation is in progress |
@@ -223,12 +223,15 @@ struct nand_hw_control { | |||
223 | * @total: total number of ecc bytes per page | 223 | * @total: total number of ecc bytes per page |
224 | * @prepad: padding information for syndrome based ecc generators | 224 | * @prepad: padding information for syndrome based ecc generators |
225 | * @postpad: padding information for syndrome based ecc generators | 225 | * @postpad: padding information for syndrome based ecc generators |
226 | * @layout: ECC layout control struct pointer | ||
226 | * @hwctl: function to control hardware ecc generator. Must only | 227 | * @hwctl: function to control hardware ecc generator. Must only |
227 | * be provided if an hardware ECC is available | 228 | * be provided if an hardware ECC is available |
228 | * @calculate: function for ecc calculation or readback from ecc hardware | 229 | * @calculate: function for ecc calculation or readback from ecc hardware |
229 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | 230 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) |
230 | * @read_page: function to read a page according to the ecc generator requirements | 231 | * @read_page: function to read a page according to the ecc generator requirements |
231 | * @write_page: function to write a page according to the ecc generator requirements | 232 | * @write_page: function to write a page according to the ecc generator requirements |
233 | * @read_oob: function to read chip OOB data | ||
234 | * @write_oob: function to write chip OOB data | ||
232 | */ | 235 | */ |
233 | struct nand_ecc_ctrl { | 236 | struct nand_ecc_ctrl { |
234 | nand_ecc_modes_t mode; | 237 | nand_ecc_modes_t mode; |
@@ -300,11 +303,15 @@ struct nand_buffers { | |||
300 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip | 303 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip |
301 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready | 304 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready |
302 | * @ecc: [BOARDSPECIFIC] ecc control ctructure | 305 | * @ecc: [BOARDSPECIFIC] ecc control ctructure |
306 | * @buffers: buffer structure for read/write | ||
307 | * @hwcontrol: platform-specific hardware control structure | ||
308 | * @ops: oob operation operands | ||
303 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support | 309 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support |
304 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 310 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
305 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) | 311 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) |
306 | * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress | 312 | * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress |
307 | * @state: [INTERN] the current state of the NAND device | 313 | * @state: [INTERN] the current state of the NAND device |
314 | * @oob_poi: poison value buffer | ||
308 | * @page_shift: [INTERN] number of address bits in a page (column address bits) | 315 | * @page_shift: [INTERN] number of address bits in a page (column address bits) |
309 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 316 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
310 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 317 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
@@ -400,7 +407,6 @@ struct nand_chip { | |||
400 | 407 | ||
401 | /** | 408 | /** |
402 | * struct nand_flash_dev - NAND Flash Device ID Structure | 409 | * struct nand_flash_dev - NAND Flash Device ID Structure |
403 | * | ||
404 | * @name: Identify the device type | 410 | * @name: Identify the device type |
405 | * @id: device ID code | 411 | * @id: device ID code |
406 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 | 412 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 |
@@ -519,9 +525,8 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
519 | 525 | ||
520 | /** | 526 | /** |
521 | * struct platform_nand_chip - chip level device structure | 527 | * struct platform_nand_chip - chip level device structure |
522 | * | ||
523 | * @nr_chips: max. number of chips to scan for | 528 | * @nr_chips: max. number of chips to scan for |
524 | * @chip_offs: chip number offset | 529 | * @chip_offset: chip number offset |
525 | * @nr_partitions: number of partitions pointed to by partitions (or zero) | 530 | * @nr_partitions: number of partitions pointed to by partitions (or zero) |
526 | * @partitions: mtd partition list | 531 | * @partitions: mtd partition list |
527 | * @chip_delay: R/B delay value in us | 532 | * @chip_delay: R/B delay value in us |
@@ -542,11 +547,10 @@ struct platform_nand_chip { | |||
542 | 547 | ||
543 | /** | 548 | /** |
544 | * struct platform_nand_ctrl - controller level device structure | 549 | * struct platform_nand_ctrl - controller level device structure |
545 | * | ||
546 | * @hwcontrol: platform specific hardware control structure | 550 | * @hwcontrol: platform specific hardware control structure |
547 | * @dev_ready: platform specific function to read ready/busy pin | 551 | * @dev_ready: platform specific function to read ready/busy pin |
548 | * @select_chip: platform specific chip select function | 552 | * @select_chip: platform specific chip select function |
549 | * @priv_data: private data to transport driver specific settings | 553 | * @priv: private data to transport driver specific settings |
550 | * | 554 | * |
551 | * All fields are optional and depend on the hardware driver requirements | 555 | * All fields are optional and depend on the hardware driver requirements |
552 | */ | 556 | */ |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 9ce9a48db444..1f4972155249 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -23,7 +23,7 @@ extern int onenand_scan(struct mtd_info *mtd, int max_chips); | |||
23 | /* Free resources held by the OneNAND device */ | 23 | /* Free resources held by the OneNAND device */ |
24 | extern void onenand_release(struct mtd_info *mtd); | 24 | extern void onenand_release(struct mtd_info *mtd); |
25 | 25 | ||
26 | /** | 26 | /* |
27 | * onenand_state_t - chip states | 27 | * onenand_state_t - chip states |
28 | * Enumeration for OneNAND flash chip state | 28 | * Enumeration for OneNAND flash chip state |
29 | */ | 29 | */ |
@@ -42,9 +42,9 @@ typedef enum { | |||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct onenand_bufferram - OneNAND BufferRAM Data | 44 | * struct onenand_bufferram - OneNAND BufferRAM Data |
45 | * @param block block address in BufferRAM | 45 | * @block: block address in BufferRAM |
46 | * @param page page address in BufferRAM | 46 | * @page: page address in BufferRAM |
47 | * @param valid valid flag | 47 | * @valid: valid flag |
48 | */ | 48 | */ |
49 | struct onenand_bufferram { | 49 | struct onenand_bufferram { |
50 | int block; | 50 | int block; |
@@ -54,32 +54,43 @@ struct onenand_bufferram { | |||
54 | 54 | ||
55 | /** | 55 | /** |
56 | * struct onenand_chip - OneNAND Private Flash Chip Data | 56 | * struct onenand_chip - OneNAND Private Flash Chip Data |
57 | * @param base [BOARDSPECIFIC] address to access OneNAND | 57 | * @base: [BOARDSPECIFIC] address to access OneNAND |
58 | * @param chipsize [INTERN] the size of one chip for multichip arrays | 58 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
59 | * @param device_id [INTERN] device ID | 59 | * @device_id: [INTERN] device ID |
60 | * @param verstion_id [INTERN] version ID | 60 | * @density_mask: chip density, used for DDP devices |
61 | * @param options [BOARDSPECIFIC] various chip options. They can partly be set to inform onenand_scan about | 61 | * @verstion_id: [INTERN] version ID |
62 | * @param erase_shift [INTERN] number of address bits in a block | 62 | * @options: [BOARDSPECIFIC] various chip options. They can |
63 | * @param page_shift [INTERN] number of address bits in a page | 63 | * partly be set to inform onenand_scan about |
64 | * @param ppb_shift [INTERN] number of address bits in a pages per block | 64 | * @erase_shift: [INTERN] number of address bits in a block |
65 | * @param page_mask [INTERN] a page per block mask | 65 | * @page_shift: [INTERN] number of address bits in a page |
66 | * @param bufferam_index [INTERN] BufferRAM index | 66 | * @ppb_shift: [INTERN] number of address bits in a pages per block |
67 | * @param bufferam [INTERN] BufferRAM info | 67 | * @page_mask: [INTERN] a page per block mask |
68 | * @param readw [REPLACEABLE] hardware specific function for read short | 68 | * @bufferram_index: [INTERN] BufferRAM index |
69 | * @param writew [REPLACEABLE] hardware specific function for write short | 69 | * @bufferram: [INTERN] BufferRAM info |
70 | * @param command [REPLACEABLE] hardware specific function for writing commands to the chip | 70 | * @readw: [REPLACEABLE] hardware specific function for read short |
71 | * @param wait [REPLACEABLE] hardware specific function for wait on ready | 71 | * @writew: [REPLACEABLE] hardware specific function for write short |
72 | * @param read_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area | 72 | * @command: [REPLACEABLE] hardware specific function for writing |
73 | * @param write_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area | 73 | * commands to the chip |
74 | * @param read_word [REPLACEABLE] hardware specific function for read register of OneNAND | 74 | * @wait: [REPLACEABLE] hardware specific function for wait on ready |
75 | * @param write_word [REPLACEABLE] hardware specific function for write register of OneNAND | 75 | * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
76 | * @param scan_bbt [REPLACEALBE] hardware specific function for scaning Bad block Table | 76 | * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
77 | * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip | 77 | * @read_word: [REPLACEABLE] hardware specific function for read |
78 | * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress | 78 | * register of OneNAND |
79 | * @param state [INTERN] the current state of the OneNAND device | 79 | * @write_word: [REPLACEABLE] hardware specific function for write |
80 | * @param ecclayout [REPLACEABLE] the default ecc placement scheme | 80 | * register of OneNAND |
81 | * @param bbm [REPLACEABLE] pointer to Bad Block Management | 81 | * @mmcontrol: sync burst read function |
82 | * @param priv [OPTIONAL] pointer to private chip date | 82 | * @block_markbad: function to mark a block as bad |
83 | * @scan_bbt: [REPLACEALBE] hardware specific function for scanning | ||
84 | * Bad block Table | ||
85 | * @chip_lock: [INTERN] spinlock used to protect access to this | ||
86 | * structure and the chip | ||
87 | * @wq: [INTERN] wait queue to sleep on if a OneNAND | ||
88 | * operation is in progress | ||
89 | * @state: [INTERN] the current state of the OneNAND device | ||
90 | * @page_buf: data buffer | ||
91 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme | ||
92 | * @bbm: [REPLACEABLE] pointer to Bad Block Management | ||
93 | * @priv: [OPTIONAL] pointer to private chip date | ||
83 | */ | 94 | */ |
84 | struct onenand_chip { | 95 | struct onenand_chip { |
85 | void __iomem *base; | 96 | void __iomem *base; |
@@ -147,9 +158,9 @@ struct onenand_chip { | |||
147 | #define ONENAND_MFR_SAMSUNG 0xec | 158 | #define ONENAND_MFR_SAMSUNG 0xec |
148 | 159 | ||
149 | /** | 160 | /** |
150 | * struct nand_manufacturers - NAND Flash Manufacturer ID Structure | 161 | * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure |
151 | * @param name: Manufacturer name | 162 | * @name: Manufacturer name |
152 | * @param id: manufacturer ID code of device. | 163 | * @id: manufacturer ID code of device. |
153 | */ | 164 | */ |
154 | struct onenand_manufacturers { | 165 | struct onenand_manufacturers { |
155 | int id; | 166 | int id; |
diff --git a/include/linux/mutex-debug.h b/include/linux/mutex-debug.h index 8b5769f00467..2537285e1064 100644 --- a/include/linux/mutex-debug.h +++ b/include/linux/mutex-debug.h | |||
@@ -2,22 +2,22 @@ | |||
2 | #define __LINUX_MUTEX_DEBUG_H | 2 | #define __LINUX_MUTEX_DEBUG_H |
3 | 3 | ||
4 | #include <linux/linkage.h> | 4 | #include <linux/linkage.h> |
5 | #include <linux/lockdep.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Mutexes - debugging helpers: | 8 | * Mutexes - debugging helpers: |
8 | */ | 9 | */ |
9 | 10 | ||
10 | #define __DEBUG_MUTEX_INITIALIZER(lockname) \ | 11 | #define __DEBUG_MUTEX_INITIALIZER(lockname) \ |
11 | , .held_list = LIST_HEAD_INIT(lockname.held_list), \ | 12 | , .magic = &lockname |
12 | .name = #lockname , .magic = &lockname | ||
13 | 13 | ||
14 | #define mutex_init(sem) __mutex_init(sem, __FUNCTION__) | 14 | #define mutex_init(mutex) \ |
15 | do { \ | ||
16 | static struct lock_class_key __key; \ | ||
17 | \ | ||
18 | __mutex_init((mutex), #mutex, &__key); \ | ||
19 | } while (0) | ||
15 | 20 | ||
16 | extern void FASTCALL(mutex_destroy(struct mutex *lock)); | 21 | extern void FASTCALL(mutex_destroy(struct mutex *lock)); |
17 | 22 | ||
18 | extern void mutex_debug_show_all_locks(void); | ||
19 | extern void mutex_debug_show_held_locks(struct task_struct *filter); | ||
20 | extern void mutex_debug_check_no_locks_held(struct task_struct *task); | ||
21 | extern void mutex_debug_check_no_locks_freed(const void *from, unsigned long len); | ||
22 | |||
23 | #endif | 23 | #endif |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index f1ac507fa20d..27c48daa3183 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/spinlock_types.h> | 14 | #include <linux/spinlock_types.h> |
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <linux/lockdep.h> | ||
16 | 17 | ||
17 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
18 | 19 | ||
@@ -50,11 +51,12 @@ struct mutex { | |||
50 | struct list_head wait_list; | 51 | struct list_head wait_list; |
51 | #ifdef CONFIG_DEBUG_MUTEXES | 52 | #ifdef CONFIG_DEBUG_MUTEXES |
52 | struct thread_info *owner; | 53 | struct thread_info *owner; |
53 | struct list_head held_list; | ||
54 | unsigned long acquire_ip; | ||
55 | const char *name; | 54 | const char *name; |
56 | void *magic; | 55 | void *magic; |
57 | #endif | 56 | #endif |
57 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
58 | struct lockdep_map dep_map; | ||
59 | #endif | ||
58 | }; | 60 | }; |
59 | 61 | ||
60 | /* | 62 | /* |
@@ -74,24 +76,34 @@ struct mutex_waiter { | |||
74 | # include <linux/mutex-debug.h> | 76 | # include <linux/mutex-debug.h> |
75 | #else | 77 | #else |
76 | # define __DEBUG_MUTEX_INITIALIZER(lockname) | 78 | # define __DEBUG_MUTEX_INITIALIZER(lockname) |
77 | # define mutex_init(mutex) __mutex_init(mutex, NULL) | 79 | # define mutex_init(mutex) \ |
80 | do { \ | ||
81 | static struct lock_class_key __key; \ | ||
82 | \ | ||
83 | __mutex_init((mutex), #mutex, &__key); \ | ||
84 | } while (0) | ||
78 | # define mutex_destroy(mutex) do { } while (0) | 85 | # define mutex_destroy(mutex) do { } while (0) |
79 | # define mutex_debug_show_all_locks() do { } while (0) | 86 | #endif |
80 | # define mutex_debug_show_held_locks(p) do { } while (0) | 87 | |
81 | # define mutex_debug_check_no_locks_held(task) do { } while (0) | 88 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
82 | # define mutex_debug_check_no_locks_freed(from, len) do { } while (0) | 89 | # define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ |
90 | , .dep_map = { .name = #lockname } | ||
91 | #else | ||
92 | # define __DEP_MAP_MUTEX_INITIALIZER(lockname) | ||
83 | #endif | 93 | #endif |
84 | 94 | ||
85 | #define __MUTEX_INITIALIZER(lockname) \ | 95 | #define __MUTEX_INITIALIZER(lockname) \ |
86 | { .count = ATOMIC_INIT(1) \ | 96 | { .count = ATOMIC_INIT(1) \ |
87 | , .wait_lock = SPIN_LOCK_UNLOCKED \ | 97 | , .wait_lock = SPIN_LOCK_UNLOCKED \ |
88 | , .wait_list = LIST_HEAD_INIT(lockname.wait_list) \ | 98 | , .wait_list = LIST_HEAD_INIT(lockname.wait_list) \ |
89 | __DEBUG_MUTEX_INITIALIZER(lockname) } | 99 | __DEBUG_MUTEX_INITIALIZER(lockname) \ |
100 | __DEP_MAP_MUTEX_INITIALIZER(lockname) } | ||
90 | 101 | ||
91 | #define DEFINE_MUTEX(mutexname) \ | 102 | #define DEFINE_MUTEX(mutexname) \ |
92 | struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) | 103 | struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) |
93 | 104 | ||
94 | extern void fastcall __mutex_init(struct mutex *lock, const char *name); | 105 | extern void __mutex_init(struct mutex *lock, const char *name, |
106 | struct lock_class_key *key); | ||
95 | 107 | ||
96 | /*** | 108 | /*** |
97 | * mutex_is_locked - is the mutex locked | 109 | * mutex_is_locked - is the mutex locked |
@@ -110,6 +122,13 @@ static inline int fastcall mutex_is_locked(struct mutex *lock) | |||
110 | */ | 122 | */ |
111 | extern void fastcall mutex_lock(struct mutex *lock); | 123 | extern void fastcall mutex_lock(struct mutex *lock); |
112 | extern int fastcall mutex_lock_interruptible(struct mutex *lock); | 124 | extern int fastcall mutex_lock_interruptible(struct mutex *lock); |
125 | |||
126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
127 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | ||
128 | #else | ||
129 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | ||
130 | #endif | ||
131 | |||
113 | /* | 132 | /* |
114 | * NOTE: mutex_trylock() follows the spin_trylock() convention, | 133 | * NOTE: mutex_trylock() follows the spin_trylock() convention, |
115 | * not the down_trylock() convention! | 134 | * not the down_trylock() convention! |
diff --git a/include/linux/net.h b/include/linux/net.h index 385e68f5bd93..b20c53c74413 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -61,6 +61,7 @@ typedef enum { | |||
61 | #define SOCK_ASYNC_WAITDATA 1 | 61 | #define SOCK_ASYNC_WAITDATA 1 |
62 | #define SOCK_NOSPACE 2 | 62 | #define SOCK_NOSPACE 2 |
63 | #define SOCK_PASSCRED 3 | 63 | #define SOCK_PASSCRED 3 |
64 | #define SOCK_PASSSEC 4 | ||
64 | 65 | ||
65 | #ifndef ARCH_HAS_SOCKET_TYPES | 66 | #ifndef ARCH_HAS_SOCKET_TYPES |
66 | /** | 67 | /** |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 03cd7551a7a1..76cc099c8580 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -313,8 +313,12 @@ struct net_device | |||
313 | 313 | ||
314 | /* Segmentation offload features */ | 314 | /* Segmentation offload features */ |
315 | #define NETIF_F_GSO_SHIFT 16 | 315 | #define NETIF_F_GSO_SHIFT 16 |
316 | #define NETIF_F_GSO_MASK 0xffff0000 | ||
316 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) | 317 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) |
317 | #define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT) | 318 | #define NETIF_F_UFO (SKB_GSO_UDP << NETIF_F_GSO_SHIFT) |
319 | #define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT) | ||
320 | #define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT) | ||
321 | #define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT) | ||
318 | 322 | ||
319 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | 323 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) |
320 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) | 324 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) |
@@ -543,7 +547,9 @@ struct packet_type { | |||
543 | struct net_device *, | 547 | struct net_device *, |
544 | struct packet_type *, | 548 | struct packet_type *, |
545 | struct net_device *); | 549 | struct net_device *); |
546 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); | 550 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
551 | int features); | ||
552 | int (*gso_send_check)(struct sk_buff *skb); | ||
547 | void *af_packet_priv; | 553 | void *af_packet_priv; |
548 | struct list_head list; | 554 | struct list_head list; |
549 | }; | 555 | }; |
@@ -968,7 +974,7 @@ extern int netdev_max_backlog; | |||
968 | extern int weight_p; | 974 | extern int weight_p; |
969 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 975 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
970 | extern int skb_checksum_help(struct sk_buff *skb, int inward); | 976 | extern int skb_checksum_help(struct sk_buff *skb, int inward); |
971 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg); | 977 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features); |
972 | #ifdef CONFIG_BUG | 978 | #ifdef CONFIG_BUG |
973 | extern void netdev_rx_csum_fault(struct net_device *dev); | 979 | extern void netdev_rx_csum_fault(struct net_device *dev); |
974 | #else | 980 | #else |
@@ -988,11 +994,22 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
988 | 994 | ||
989 | extern void linkwatch_run_queue(void); | 995 | extern void linkwatch_run_queue(void); |
990 | 996 | ||
997 | static inline int net_gso_ok(int features, int gso_type) | ||
998 | { | ||
999 | int feature = gso_type << NETIF_F_GSO_SHIFT; | ||
1000 | return (features & feature) == feature; | ||
1001 | } | ||
1002 | |||
1003 | static inline int skb_gso_ok(struct sk_buff *skb, int features) | ||
1004 | { | ||
1005 | return net_gso_ok(features, skb_shinfo(skb)->gso_type); | ||
1006 | } | ||
1007 | |||
991 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 1008 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) |
992 | { | 1009 | { |
993 | int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT; | 1010 | return skb_is_gso(skb) && |
994 | return skb_shinfo(skb)->gso_size && | 1011 | (!skb_gso_ok(skb, dev->features) || |
995 | (dev->features & feature) != feature; | 1012 | unlikely(skb->ip_summed != CHECKSUM_HW)); |
996 | } | 1013 | } |
997 | 1014 | ||
998 | #endif /* __KERNEL__ */ | 1015 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild new file mode 100644 index 000000000000..d06311acd448 --- /dev/null +++ b/include/linux/netfilter/Kbuild | |||
@@ -0,0 +1,11 @@ | |||
1 | header-y := nf_conntrack_sctp.h nf_conntrack_tuple_common.h \ | ||
2 | nfnetlink_conntrack.h nfnetlink_log.h nfnetlink_queue.h \ | ||
3 | xt_CLASSIFY.h xt_comment.h xt_connbytes.h xt_connmark.h \ | ||
4 | xt_CONNMARK.h xt_conntrack.h xt_dccp.h xt_esp.h \ | ||
5 | xt_helper.h xt_length.h xt_limit.h xt_mac.h xt_mark.h \ | ||
6 | xt_MARK.h xt_multiport.h xt_NFQUEUE.h xt_pkttype.h \ | ||
7 | xt_policy.h xt_realm.h xt_sctp.h xt_state.h xt_string.h \ | ||
8 | xt_tcpmss.h xt_tcpudp.h | ||
9 | |||
10 | unifdef-y := nf_conntrack_common.h nf_conntrack_ftp.h \ | ||
11 | nf_conntrack_tcp.h nfnetlink.h x_tables.h xt_physdev.h | ||
diff --git a/include/linux/netfilter_arp/Kbuild b/include/linux/netfilter_arp/Kbuild new file mode 100644 index 000000000000..198ec5e7b17d --- /dev/null +++ b/include/linux/netfilter_arp/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y := arpt_mangle.h | ||
2 | unifdef-y := arp_tables.h | ||
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild new file mode 100644 index 000000000000..5b1aba6abbad --- /dev/null +++ b/include/linux/netfilter_bridge/Kbuild | |||
@@ -0,0 +1,4 @@ | |||
1 | header-y += ebt_among.h ebt_arp.h ebt_arpreply.h ebt_ip.h ebt_limit.h \ | ||
2 | ebt_log.h ebt_mark_m.h ebt_mark_t.h ebt_nat.h ebt_pkttype.h \ | ||
3 | ebt_redirect.h ebt_stp.h ebt_ulog.h ebt_vlan.h | ||
4 | unifdef-y := ebtables.h ebt_802_3.h | ||
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild new file mode 100644 index 000000000000..04e4d2721689 --- /dev/null +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -0,0 +1,21 @@ | |||
1 | |||
2 | header-y := ip_conntrack_helper.h ip_conntrack_helper_h323_asn1.h \ | ||
3 | ip_conntrack_helper_h323_types.h ip_conntrack_protocol.h \ | ||
4 | ip_conntrack_sctp.h ip_conntrack_tcp.h ip_conntrack_tftp.h \ | ||
5 | ip_nat_pptp.h ipt_addrtype.h ipt_ah.h \ | ||
6 | ipt_CLASSIFY.h ipt_CLUSTERIP.h ipt_comment.h \ | ||
7 | ipt_connbytes.h ipt_connmark.h ipt_CONNMARK.h \ | ||
8 | ipt_conntrack.h ipt_dccp.h ipt_dscp.h ipt_DSCP.h ipt_ecn.h \ | ||
9 | ipt_ECN.h ipt_esp.h ipt_hashlimit.h ipt_helper.h \ | ||
10 | ipt_iprange.h ipt_length.h ipt_limit.h ipt_LOG.h ipt_mac.h \ | ||
11 | ipt_mark.h ipt_MARK.h ipt_multiport.h ipt_NFQUEUE.h \ | ||
12 | ipt_owner.h ipt_physdev.h ipt_pkttype.h ipt_policy.h \ | ||
13 | ipt_realm.h ipt_recent.h ipt_REJECT.h ipt_SAME.h \ | ||
14 | ipt_sctp.h ipt_state.h ipt_string.h ipt_tcpmss.h \ | ||
15 | ipt_TCPMSS.h ipt_tos.h ipt_TOS.h ipt_ttl.h ipt_TTL.h \ | ||
16 | ipt_ULOG.h | ||
17 | |||
18 | unifdef-y := ip_conntrack.h ip_conntrack_h323.h ip_conntrack_irc.h \ | ||
19 | ip_conntrack_pptp.h ip_conntrack_proto_gre.h \ | ||
20 | ip_conntrack_tuple.h ip_nat.h ip_nat_rule.h ip_queue.h \ | ||
21 | ip_tables.h | ||
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild new file mode 100644 index 000000000000..913ddbf55b4b --- /dev/null +++ b/include/linux/netfilter_ipv6/Kbuild | |||
@@ -0,0 +1,6 @@ | |||
1 | header-y += ip6t_HL.h ip6t_LOG.h ip6t_MARK.h ip6t_REJECT.h ip6t_ah.h \ | ||
2 | ip6t_esp.h ip6t_frag.h ip6t_hl.h ip6t_ipv6header.h \ | ||
3 | ip6t_length.h ip6t_limit.h ip6t_mac.h ip6t_mark.h \ | ||
4 | ip6t_multiport.h ip6t_opts.h ip6t_owner.h ip6t_policy.h \ | ||
5 | ip6t_physdev.h ip6t_rt.h | ||
6 | unifdef-y := ip6_tables.h | ||
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 5f681d534295..db05182ca0e8 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -157,6 +157,12 @@ enum nfs_opnum4 { | |||
157 | OP_ILLEGAL = 10044, | 157 | OP_ILLEGAL = 10044, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | /*Defining first and last NFS4 operations implemented. | ||
161 | Needs to be updated if more operations are defined in future.*/ | ||
162 | |||
163 | #define FIRST_NFS4_OP OP_ACCESS | ||
164 | #define LAST_NFS4_OP OP_RELEASE_LOCKOWNER | ||
165 | |||
160 | enum nfsstat4 { | 166 | enum nfsstat4 { |
161 | NFS4_OK = 0, | 167 | NFS4_OK = 0, |
162 | NFS4ERR_PERM = 1, | 168 | NFS4ERR_PERM = 1, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 0a1740b2532e..55ea853d57bc 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #ifndef _LINUX_NFS_FS_H | 9 | #ifndef _LINUX_NFS_FS_H |
10 | #define _LINUX_NFS_FS_H | 10 | #define _LINUX_NFS_FS_H |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | #include <linux/in.h> | 12 | #include <linux/in.h> |
14 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
15 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
@@ -335,7 +334,7 @@ extern struct inode_operations nfs_file_inode_operations; | |||
335 | extern struct inode_operations nfs3_file_inode_operations; | 334 | extern struct inode_operations nfs3_file_inode_operations; |
336 | #endif /* CONFIG_NFS_V3 */ | 335 | #endif /* CONFIG_NFS_V3 */ |
337 | extern const struct file_operations nfs_file_operations; | 336 | extern const struct file_operations nfs_file_operations; |
338 | extern struct address_space_operations nfs_file_aops; | 337 | extern const struct address_space_operations nfs_file_aops; |
339 | 338 | ||
340 | static inline struct rpc_cred *nfs_file_cred(struct file *file) | 339 | static inline struct rpc_cred *nfs_file_cred(struct file *file) |
341 | { | 340 | { |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 7c7320fa51aa..2d3fb6416d91 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -729,6 +729,7 @@ struct nfs_read_data { | |||
729 | struct list_head pages; /* Coalesced read requests */ | 729 | struct list_head pages; /* Coalesced read requests */ |
730 | struct nfs_page *req; /* multi ops per nfs_page */ | 730 | struct nfs_page *req; /* multi ops per nfs_page */ |
731 | struct page **pagevec; | 731 | struct page **pagevec; |
732 | unsigned int npages; /* active pages in pagevec */ | ||
732 | struct nfs_readargs args; | 733 | struct nfs_readargs args; |
733 | struct nfs_readres res; | 734 | struct nfs_readres res; |
734 | #ifdef CONFIG_NFS_V4 | 735 | #ifdef CONFIG_NFS_V4 |
@@ -747,6 +748,7 @@ struct nfs_write_data { | |||
747 | struct list_head pages; /* Coalesced requests we wish to flush */ | 748 | struct list_head pages; /* Coalesced requests we wish to flush */ |
748 | struct nfs_page *req; /* multi ops per nfs_page */ | 749 | struct nfs_page *req; /* multi ops per nfs_page */ |
749 | struct page **pagevec; | 750 | struct page **pagevec; |
751 | unsigned int npages; /* active pages in pagevec */ | ||
750 | struct nfs_writeargs args; /* argument struct */ | 752 | struct nfs_writeargs args; /* argument struct */ |
751 | struct nfs_writeres res; /* result struct */ | 753 | struct nfs_writeres res; /* result struct */ |
752 | #ifdef CONFIG_NFS_V4 | 754 | #ifdef CONFIG_NFS_V4 |
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild new file mode 100644 index 000000000000..c8c545665885 --- /dev/null +++ b/include/linux/nfsd/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | unifdef-y := const.h export.h stats.h syscall.h nfsfh.h debug.h auth.h | ||
2 | |||
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h index b6f1e0cda4f2..28a82fdd922f 100644 --- a/include/linux/nfsd/stats.h +++ b/include/linux/nfsd/stats.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #ifndef LINUX_NFSD_STATS_H | 9 | #ifndef LINUX_NFSD_STATS_H |
10 | #define LINUX_NFSD_STATS_H | 10 | #define LINUX_NFSD_STATS_H |
11 | 11 | ||
12 | #include <linux/nfs4.h> | ||
13 | |||
12 | struct nfsd_stats { | 14 | struct nfsd_stats { |
13 | unsigned int rchits; /* repcache hits */ | 15 | unsigned int rchits; /* repcache hits */ |
14 | unsigned int rcmisses; /* repcache hits */ | 16 | unsigned int rcmisses; /* repcache hits */ |
@@ -27,6 +29,10 @@ struct nfsd_stats { | |||
27 | unsigned int ra_size; /* size of ra cache */ | 29 | unsigned int ra_size; /* size of ra cache */ |
28 | unsigned int ra_depth[11]; /* number of times ra entry was found that deep | 30 | unsigned int ra_depth[11]; /* number of times ra entry was found that deep |
29 | * in the cache (10percentiles). [10] = not found */ | 31 | * in the cache (10percentiles). [10] = not found */ |
32 | #ifdef CONFIG_NFSD_V4 | ||
33 | unsigned int nfs4_opcount[LAST_NFS4_OP + 1]; /* count of individual nfsv4 operations */ | ||
34 | #endif | ||
35 | |||
30 | }; | 36 | }; |
31 | 37 | ||
32 | /* thread usage wraps very million seconds (approx one fortnight) */ | 38 | /* thread usage wraps very million seconds (approx one fortnight) */ |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 51dbab9710c7..7ff386a6ae87 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -65,7 +65,7 @@ struct raw_notifier_head { | |||
65 | } while (0) | 65 | } while (0) |
66 | 66 | ||
67 | #define ATOMIC_NOTIFIER_INIT(name) { \ | 67 | #define ATOMIC_NOTIFIER_INIT(name) { \ |
68 | .lock = SPIN_LOCK_UNLOCKED, \ | 68 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ |
69 | .head = NULL } | 69 | .head = NULL } |
70 | #define BLOCKING_NOTIFIER_INIT(name) { \ | 70 | #define BLOCKING_NOTIFIER_INIT(name) { \ |
71 | .rwsem = __RWSEM_INITIALIZER((name).rwsem), \ | 71 | .rwsem = __RWSEM_INITIALIZER((name).rwsem), \ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 0c076d58c676..5748642e9f36 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -5,12 +5,8 @@ | |||
5 | #ifndef PAGE_FLAGS_H | 5 | #ifndef PAGE_FLAGS_H |
6 | #define PAGE_FLAGS_H | 6 | #define PAGE_FLAGS_H |
7 | 7 | ||
8 | #include <linux/percpu.h> | ||
9 | #include <linux/cache.h> | ||
10 | #include <linux/types.h> | 8 | #include <linux/types.h> |
11 | 9 | ||
12 | #include <asm/pgtable.h> | ||
13 | |||
14 | /* | 10 | /* |
15 | * Various page->flags bits: | 11 | * Various page->flags bits: |
16 | * | 12 | * |
@@ -103,134 +99,6 @@ | |||
103 | #endif | 99 | #endif |
104 | 100 | ||
105 | /* | 101 | /* |
106 | * Global page accounting. One instance per CPU. Only unsigned longs are | ||
107 | * allowed. | ||
108 | * | ||
109 | * - Fields can be modified with xxx_page_state and xxx_page_state_zone at | ||
110 | * any time safely (which protects the instance from modification by | ||
111 | * interrupt. | ||
112 | * - The __xxx_page_state variants can be used safely when interrupts are | ||
113 | * disabled. | ||
114 | * - The __xxx_page_state variants can be used if the field is only | ||
115 | * modified from process context and protected from preemption, or only | ||
116 | * modified from interrupt context. In this case, the field should be | ||
117 | * commented here. | ||
118 | */ | ||
119 | struct page_state { | ||
120 | unsigned long nr_dirty; /* Dirty writeable pages */ | ||
121 | unsigned long nr_writeback; /* Pages under writeback */ | ||
122 | unsigned long nr_unstable; /* NFS unstable pages */ | ||
123 | unsigned long nr_page_table_pages;/* Pages used for pagetables */ | ||
124 | unsigned long nr_mapped; /* mapped into pagetables. | ||
125 | * only modified from process context */ | ||
126 | unsigned long nr_slab; /* In slab */ | ||
127 | #define GET_PAGE_STATE_LAST nr_slab | ||
128 | |||
129 | /* | ||
130 | * The below are zeroed by get_page_state(). Use get_full_page_state() | ||
131 | * to add up all these. | ||
132 | */ | ||
133 | unsigned long pgpgin; /* Disk reads */ | ||
134 | unsigned long pgpgout; /* Disk writes */ | ||
135 | unsigned long pswpin; /* swap reads */ | ||
136 | unsigned long pswpout; /* swap writes */ | ||
137 | |||
138 | unsigned long pgalloc_high; /* page allocations */ | ||
139 | unsigned long pgalloc_normal; | ||
140 | unsigned long pgalloc_dma32; | ||
141 | unsigned long pgalloc_dma; | ||
142 | |||
143 | unsigned long pgfree; /* page freeings */ | ||
144 | unsigned long pgactivate; /* pages moved inactive->active */ | ||
145 | unsigned long pgdeactivate; /* pages moved active->inactive */ | ||
146 | |||
147 | unsigned long pgfault; /* faults (major+minor) */ | ||
148 | unsigned long pgmajfault; /* faults (major only) */ | ||
149 | |||
150 | unsigned long pgrefill_high; /* inspected in refill_inactive_zone */ | ||
151 | unsigned long pgrefill_normal; | ||
152 | unsigned long pgrefill_dma32; | ||
153 | unsigned long pgrefill_dma; | ||
154 | |||
155 | unsigned long pgsteal_high; /* total highmem pages reclaimed */ | ||
156 | unsigned long pgsteal_normal; | ||
157 | unsigned long pgsteal_dma32; | ||
158 | unsigned long pgsteal_dma; | ||
159 | |||
160 | unsigned long pgscan_kswapd_high;/* total highmem pages scanned */ | ||
161 | unsigned long pgscan_kswapd_normal; | ||
162 | unsigned long pgscan_kswapd_dma32; | ||
163 | unsigned long pgscan_kswapd_dma; | ||
164 | |||
165 | unsigned long pgscan_direct_high;/* total highmem pages scanned */ | ||
166 | unsigned long pgscan_direct_normal; | ||
167 | unsigned long pgscan_direct_dma32; | ||
168 | unsigned long pgscan_direct_dma; | ||
169 | |||
170 | unsigned long pginodesteal; /* pages reclaimed via inode freeing */ | ||
171 | unsigned long slabs_scanned; /* slab objects scanned */ | ||
172 | unsigned long kswapd_steal; /* pages reclaimed by kswapd */ | ||
173 | unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */ | ||
174 | unsigned long pageoutrun; /* kswapd's calls to page reclaim */ | ||
175 | unsigned long allocstall; /* direct reclaim calls */ | ||
176 | |||
177 | unsigned long pgrotated; /* pages rotated to tail of the LRU */ | ||
178 | unsigned long nr_bounce; /* pages for bounce buffers */ | ||
179 | }; | ||
180 | |||
181 | extern void get_page_state(struct page_state *ret); | ||
182 | extern void get_page_state_node(struct page_state *ret, int node); | ||
183 | extern void get_full_page_state(struct page_state *ret); | ||
184 | extern unsigned long read_page_state_offset(unsigned long offset); | ||
185 | extern void mod_page_state_offset(unsigned long offset, unsigned long delta); | ||
186 | extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | ||
187 | |||
188 | #define read_page_state(member) \ | ||
189 | read_page_state_offset(offsetof(struct page_state, member)) | ||
190 | |||
191 | #define mod_page_state(member, delta) \ | ||
192 | mod_page_state_offset(offsetof(struct page_state, member), (delta)) | ||
193 | |||
194 | #define __mod_page_state(member, delta) \ | ||
195 | __mod_page_state_offset(offsetof(struct page_state, member), (delta)) | ||
196 | |||
197 | #define inc_page_state(member) mod_page_state(member, 1UL) | ||
198 | #define dec_page_state(member) mod_page_state(member, 0UL - 1) | ||
199 | #define add_page_state(member,delta) mod_page_state(member, (delta)) | ||
200 | #define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta)) | ||
201 | |||
202 | #define __inc_page_state(member) __mod_page_state(member, 1UL) | ||
203 | #define __dec_page_state(member) __mod_page_state(member, 0UL - 1) | ||
204 | #define __add_page_state(member,delta) __mod_page_state(member, (delta)) | ||
205 | #define __sub_page_state(member,delta) __mod_page_state(member, 0UL - (delta)) | ||
206 | |||
207 | #define page_state(member) (*__page_state(offsetof(struct page_state, member))) | ||
208 | |||
209 | #define state_zone_offset(zone, member) \ | ||
210 | ({ \ | ||
211 | unsigned offset; \ | ||
212 | if (is_highmem(zone)) \ | ||
213 | offset = offsetof(struct page_state, member##_high); \ | ||
214 | else if (is_normal(zone)) \ | ||
215 | offset = offsetof(struct page_state, member##_normal); \ | ||
216 | else if (is_dma32(zone)) \ | ||
217 | offset = offsetof(struct page_state, member##_dma32); \ | ||
218 | else \ | ||
219 | offset = offsetof(struct page_state, member##_dma); \ | ||
220 | offset; \ | ||
221 | }) | ||
222 | |||
223 | #define __mod_page_state_zone(zone, member, delta) \ | ||
224 | do { \ | ||
225 | __mod_page_state_offset(state_zone_offset(zone, member), (delta)); \ | ||
226 | } while (0) | ||
227 | |||
228 | #define mod_page_state_zone(zone, member, delta) \ | ||
229 | do { \ | ||
230 | mod_page_state_offset(state_zone_offset(zone, member), (delta)); \ | ||
231 | } while (0) | ||
232 | |||
233 | /* | ||
234 | * Manipulation of page state flags | 102 | * Manipulation of page state flags |
235 | */ | 103 | */ |
236 | #define PageLocked(page) \ | 104 | #define PageLocked(page) \ |
@@ -254,7 +122,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
254 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) | 122 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) |
255 | 123 | ||
256 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) | 124 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) |
257 | #ifndef SetPageUptodate | 125 | #ifdef CONFIG_S390 |
126 | #define SetPageUptodate(_page) \ | ||
127 | do { \ | ||
128 | struct page *__page = (_page); \ | ||
129 | if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ | ||
130 | page_test_and_clear_dirty(_page); \ | ||
131 | } while (0) | ||
132 | #else | ||
258 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) | 133 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) |
259 | #endif | 134 | #endif |
260 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) | 135 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) |
@@ -306,7 +181,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
306 | do { \ | 181 | do { \ |
307 | if (!test_and_set_bit(PG_writeback, \ | 182 | if (!test_and_set_bit(PG_writeback, \ |
308 | &(page)->flags)) \ | 183 | &(page)->flags)) \ |
309 | inc_page_state(nr_writeback); \ | 184 | inc_zone_page_state(page, NR_WRITEBACK); \ |
310 | } while (0) | 185 | } while (0) |
311 | #define TestSetPageWriteback(page) \ | 186 | #define TestSetPageWriteback(page) \ |
312 | ({ \ | 187 | ({ \ |
@@ -314,14 +189,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
314 | ret = test_and_set_bit(PG_writeback, \ | 189 | ret = test_and_set_bit(PG_writeback, \ |
315 | &(page)->flags); \ | 190 | &(page)->flags); \ |
316 | if (!ret) \ | 191 | if (!ret) \ |
317 | inc_page_state(nr_writeback); \ | 192 | inc_zone_page_state(page, NR_WRITEBACK); \ |
318 | ret; \ | 193 | ret; \ |
319 | }) | 194 | }) |
320 | #define ClearPageWriteback(page) \ | 195 | #define ClearPageWriteback(page) \ |
321 | do { \ | 196 | do { \ |
322 | if (test_and_clear_bit(PG_writeback, \ | 197 | if (test_and_clear_bit(PG_writeback, \ |
323 | &(page)->flags)) \ | 198 | &(page)->flags)) \ |
324 | dec_page_state(nr_writeback); \ | 199 | dec_zone_page_state(page, NR_WRITEBACK); \ |
325 | } while (0) | 200 | } while (0) |
326 | #define TestClearPageWriteback(page) \ | 201 | #define TestClearPageWriteback(page) \ |
327 | ({ \ | 202 | ({ \ |
@@ -329,7 +204,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
329 | ret = test_and_clear_bit(PG_writeback, \ | 204 | ret = test_and_clear_bit(PG_writeback, \ |
330 | &(page)->flags); \ | 205 | &(page)->flags); \ |
331 | if (ret) \ | 206 | if (ret) \ |
332 | dec_page_state(nr_writeback); \ | 207 | dec_zone_page_state(page, NR_WRITEBACK); \ |
333 | ret; \ | 208 | ret; \ |
334 | }) | 209 | }) |
335 | 210 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 1245df7141aa..0a2f5d27f60e 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -113,51 +113,6 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | |||
113 | extern void remove_from_page_cache(struct page *page); | 113 | extern void remove_from_page_cache(struct page *page); |
114 | extern void __remove_from_page_cache(struct page *page); | 114 | extern void __remove_from_page_cache(struct page *page); |
115 | 115 | ||
116 | extern atomic_t nr_pagecache; | ||
117 | |||
118 | #ifdef CONFIG_SMP | ||
119 | |||
120 | #define PAGECACHE_ACCT_THRESHOLD max(16, NR_CPUS * 2) | ||
121 | DECLARE_PER_CPU(long, nr_pagecache_local); | ||
122 | |||
123 | /* | ||
124 | * pagecache_acct implements approximate accounting for pagecache. | ||
125 | * vm_enough_memory() do not need high accuracy. Writers will keep | ||
126 | * an offset in their per-cpu arena and will spill that into the | ||
127 | * global count whenever the absolute value of the local count | ||
128 | * exceeds the counter's threshold. | ||
129 | * | ||
130 | * MUST be protected from preemption. | ||
131 | * current protection is mapping->page_lock. | ||
132 | */ | ||
133 | static inline void pagecache_acct(int count) | ||
134 | { | ||
135 | long *local; | ||
136 | |||
137 | local = &__get_cpu_var(nr_pagecache_local); | ||
138 | *local += count; | ||
139 | if (*local > PAGECACHE_ACCT_THRESHOLD || *local < -PAGECACHE_ACCT_THRESHOLD) { | ||
140 | atomic_add(*local, &nr_pagecache); | ||
141 | *local = 0; | ||
142 | } | ||
143 | } | ||
144 | |||
145 | #else | ||
146 | |||
147 | static inline void pagecache_acct(int count) | ||
148 | { | ||
149 | atomic_add(count, &nr_pagecache); | ||
150 | } | ||
151 | #endif | ||
152 | |||
153 | static inline unsigned long get_page_cache_size(void) | ||
154 | { | ||
155 | int ret = atomic_read(&nr_pagecache); | ||
156 | if (unlikely(ret < 0)) | ||
157 | ret = 0; | ||
158 | return ret; | ||
159 | } | ||
160 | |||
161 | /* | 116 | /* |
162 | * Return byte-offset into filesystem object for page. | 117 | * Return byte-offset into filesystem object for page. |
163 | */ | 118 | */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 62a8c22f5f60..8565b81d7fbc 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -161,6 +161,7 @@ struct pci_dev { | |||
161 | unsigned int is_enabled:1; /* pci_enable_device has been called */ | 161 | unsigned int is_enabled:1; /* pci_enable_device has been called */ |
162 | unsigned int is_busmaster:1; /* device is busmaster */ | 162 | unsigned int is_busmaster:1; /* device is busmaster */ |
163 | unsigned int no_msi:1; /* device may not use msi */ | 163 | unsigned int no_msi:1; /* device may not use msi */ |
164 | unsigned int no_d1d2:1; /* only allow d0 or d3 */ | ||
164 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 165 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ |
165 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 166 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
166 | unsigned int msi_enabled:1; | 167 | unsigned int msi_enabled:1; |
@@ -404,8 +405,8 @@ int pcibios_enable_device(struct pci_dev *, int mask); | |||
404 | char *pcibios_setup (char *str); | 405 | char *pcibios_setup (char *str); |
405 | 406 | ||
406 | /* Used only when drivers/pci/setup.c is used */ | 407 | /* Used only when drivers/pci/setup.c is used */ |
407 | void pcibios_align_resource(void *, struct resource *, | 408 | void pcibios_align_resource(void *, struct resource *, resource_size_t, |
408 | unsigned long, unsigned long); | 409 | resource_size_t); |
409 | void pcibios_update_irq(struct pci_dev *, int irq); | 410 | void pcibios_update_irq(struct pci_dev *, int irq); |
410 | 411 | ||
411 | /* Generic PCI functions used internally */ | 412 | /* Generic PCI functions used internally */ |
@@ -532,10 +533,10 @@ void pci_release_region(struct pci_dev *, int); | |||
532 | 533 | ||
533 | /* drivers/pci/bus.c */ | 534 | /* drivers/pci/bus.c */ |
534 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | 535 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, |
535 | unsigned long size, unsigned long align, | 536 | resource_size_t size, resource_size_t align, |
536 | unsigned long min, unsigned int type_mask, | 537 | resource_size_t min, unsigned int type_mask, |
537 | void (*alignf)(void *, struct resource *, | 538 | void (*alignf)(void *, struct resource *, |
538 | unsigned long, unsigned long), | 539 | resource_size_t, resource_size_t), |
539 | void *alignf_data); | 540 | void *alignf_data); |
540 | void pci_enable_bridges(struct pci_bus *bus); | 541 | void pci_enable_bridges(struct pci_bus *bus); |
541 | 542 | ||
@@ -730,7 +731,8 @@ static inline char *pci_name(struct pci_dev *pdev) | |||
730 | */ | 731 | */ |
731 | #ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER | 732 | #ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER |
732 | static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, | 733 | static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, |
733 | const struct resource *rsrc, u64 *start, u64 *end) | 734 | const struct resource *rsrc, resource_size_t *start, |
735 | resource_size_t *end) | ||
734 | { | 736 | { |
735 | *start = rsrc->start; | 737 | *start = rsrc->start; |
736 | *end = rsrc->end; | 738 | *end = rsrc->end; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c2fd2d19938b..c09396d2c77b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -728,7 +728,9 @@ | |||
728 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 | 728 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 |
729 | #define PCI_DEVICE_ID_TI_4450 0x8011 | 729 | #define PCI_DEVICE_ID_TI_4450 0x8011 |
730 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 | 730 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 |
731 | #define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 | ||
731 | #define PCI_DEVICE_ID_TI_X515 0x8036 | 732 | #define PCI_DEVICE_ID_TI_X515 0x8036 |
733 | #define PCI_DEVICE_ID_TI_XX12 0x8039 | ||
732 | #define PCI_DEVICE_ID_TI_1130 0xac12 | 734 | #define PCI_DEVICE_ID_TI_1130 0xac12 |
733 | #define PCI_DEVICE_ID_TI_1031 0xac13 | 735 | #define PCI_DEVICE_ID_TI_1031 0xac13 |
734 | #define PCI_DEVICE_ID_TI_1131 0xac15 | 736 | #define PCI_DEVICE_ID_TI_1131 0xac15 |
@@ -1202,6 +1204,7 @@ | |||
1202 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF | 1204 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF |
1203 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 | 1205 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 |
1204 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 | 1206 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 |
1207 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448 | ||
1205 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 | 1208 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 |
1206 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 | 1209 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 |
1207 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 | 1210 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 |
@@ -1440,6 +1443,7 @@ | |||
1440 | #define PCI_DEVICE_ID_RICOH_RL5C475 0x0475 | 1443 | #define PCI_DEVICE_ID_RICOH_RL5C475 0x0475 |
1441 | #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 | 1444 | #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 |
1442 | #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 | 1445 | #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 |
1446 | #define PCI_DEVICE_ID_RICOH_R5C822 0x0822 | ||
1443 | 1447 | ||
1444 | #define PCI_VENDOR_ID_DLINK 0x1186 | 1448 | #define PCI_VENDOR_ID_DLINK 0x1186 |
1445 | #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 | 1449 | #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 |
@@ -2015,6 +2019,13 @@ | |||
2015 | #define PCI_VENDOR_ID_TDI 0x192E | 2019 | #define PCI_VENDOR_ID_TDI 0x192E |
2016 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2020 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
2017 | 2021 | ||
2022 | #define PCI_VENDOR_ID_JMICRON 0x197B | ||
2023 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 | ||
2024 | #define PCI_DEVICE_ID_JMICRON_JMB361 0x2361 | ||
2025 | #define PCI_DEVICE_ID_JMICRON_JMB363 0x2363 | ||
2026 | #define PCI_DEVICE_ID_JMICRON_JMB365 0x2365 | ||
2027 | #define PCI_DEVICE_ID_JMICRON_JMB366 0x2366 | ||
2028 | #define PCI_DEVICE_ID_JMICRON_JMB368 0x2368 | ||
2018 | 2029 | ||
2019 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 | 2030 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 |
2020 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 | 2031 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 |
@@ -2170,7 +2181,6 @@ | |||
2170 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 | 2181 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 |
2171 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e | 2182 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e |
2172 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 | 2183 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 |
2173 | #define PCI_DEVICE_ID_INTEL_GD31244 0x3200 | ||
2174 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 | 2184 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
2175 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2185 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
2176 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 | 2186 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 6bce4a240364..96930cb5927c 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -422,7 +422,23 @@ | |||
422 | #define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ | 422 | #define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ |
423 | #define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ | 423 | #define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ |
424 | #define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ | 424 | #define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ |
425 | /* Correctable Err Reporting Enable */ | ||
426 | #define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 | ||
427 | /* Non-fatal Err Reporting Enable */ | ||
428 | #define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 | ||
429 | /* Fatal Err Reporting Enable */ | ||
430 | #define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 | ||
425 | #define PCI_ERR_ROOT_STATUS 48 | 431 | #define PCI_ERR_ROOT_STATUS 48 |
432 | #define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ | ||
433 | /* Multi ERR_COR Received */ | ||
434 | #define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 | ||
435 | /* ERR_FATAL/NONFATAL Recevied */ | ||
436 | #define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 | ||
437 | /* Multi ERR_FATAL/NONFATAL Recevied */ | ||
438 | #define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 | ||
439 | #define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ | ||
440 | #define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ | ||
441 | #define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ | ||
426 | #define PCI_ERR_ROOT_COR_SRC 52 | 442 | #define PCI_ERR_ROOT_COR_SRC 52 |
427 | #define PCI_ERR_ROOT_SRC 54 | 443 | #define PCI_ERR_ROOT_SRC 54 |
428 | 444 | ||
diff --git a/include/linux/plist.h b/include/linux/plist.h index 3404faef542c..b95818a037ad 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
@@ -73,6 +73,7 @@ | |||
73 | #ifndef _LINUX_PLIST_H_ | 73 | #ifndef _LINUX_PLIST_H_ |
74 | #define _LINUX_PLIST_H_ | 74 | #define _LINUX_PLIST_H_ |
75 | 75 | ||
76 | #include <linux/kernel.h> | ||
76 | #include <linux/list.h> | 77 | #include <linux/list.h> |
77 | #include <linux/spinlock_types.h> | 78 | #include <linux/spinlock_types.h> |
78 | 79 | ||
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h index 78027c533b94..514729a44688 100644 --- a/include/linux/pm_legacy.h +++ b/include/linux/pm_legacy.h | |||
@@ -15,11 +15,6 @@ struct pm_dev __deprecated * | |||
15 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); | 15 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * Unregister all devices with matching callback | ||
19 | */ | ||
20 | void __deprecated pm_unregister_all(pm_callback callback); | ||
21 | |||
22 | /* | ||
23 | * Send a request to all devices | 18 | * Send a request to all devices |
24 | */ | 19 | */ |
25 | int __deprecated pm_send_all(pm_request_t rqst, void *data); | 20 | int __deprecated pm_send_all(pm_request_t rqst, void *data); |
@@ -35,8 +30,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type, | |||
35 | return NULL; | 30 | return NULL; |
36 | } | 31 | } |
37 | 32 | ||
38 | static inline void pm_unregister_all(pm_callback callback) {} | ||
39 | |||
40 | static inline int pm_send_all(pm_request_t rqst, void *data) | 33 | static inline int pm_send_all(pm_request_t rqst, void *data) |
41 | { | 34 | { |
42 | return 0; | 35 | return 0; |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 93b0959eb40f..ab8a8dd8d64c 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -389,7 +389,8 @@ int pnp_start_dev(struct pnp_dev *dev); | |||
389 | int pnp_stop_dev(struct pnp_dev *dev); | 389 | int pnp_stop_dev(struct pnp_dev *dev); |
390 | int pnp_activate_dev(struct pnp_dev *dev); | 390 | int pnp_activate_dev(struct pnp_dev *dev); |
391 | int pnp_disable_dev(struct pnp_dev *dev); | 391 | int pnp_disable_dev(struct pnp_dev *dev); |
392 | void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); | 392 | void pnp_resource_change(struct resource *resource, resource_size_t start, |
393 | resource_size_t size); | ||
393 | 394 | ||
394 | /* protocol helpers */ | 395 | /* protocol helpers */ |
395 | int pnp_is_active(struct pnp_dev * dev); | 396 | int pnp_is_active(struct pnp_dev * dev); |
@@ -434,7 +435,9 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } | |||
434 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | 435 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } |
435 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | 436 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } |
436 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | 437 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } |
437 | static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { } | 438 | static inline void pnp_resource_change(struct resource *resource, |
439 | resource_size_t start, | ||
440 | resource_size_t size) { } | ||
438 | 441 | ||
439 | /* protocol helpers */ | 442 | /* protocol helpers */ |
440 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } | 443 | static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } |
diff --git a/include/linux/poison.h b/include/linux/poison.h index a5347c02432e..3e628f990fdf 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -44,6 +44,11 @@ | |||
44 | 44 | ||
45 | /********** drivers/atm/ **********/ | 45 | /********** drivers/atm/ **********/ |
46 | #define ATM_POISON_FREE 0x12 | 46 | #define ATM_POISON_FREE 0x12 |
47 | #define ATM_POISON 0xdeadbeef | ||
48 | |||
49 | /********** net/ **********/ | ||
50 | #define NEIGHBOR_DEAD 0xdeadbeef | ||
51 | #define NETFILTER_LINK_POISON 0xdead57ac | ||
47 | 52 | ||
48 | /********** kernel/mutexes **********/ | 53 | /********** kernel/mutexes **********/ |
49 | #define MUTEX_DEBUG_INIT 0x11 | 54 | #define MUTEX_DEBUG_INIT 0x11 |
diff --git a/include/linux/raid/Kbuild b/include/linux/raid/Kbuild new file mode 100644 index 000000000000..73fa27a8d552 --- /dev/null +++ b/include/linux/raid/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y += md_p.h md_u.h | |||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c1e0ac55bab5..d28890295852 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -148,9 +148,10 @@ struct mddev_s | |||
148 | 148 | ||
149 | struct mdk_thread_s *thread; /* management thread */ | 149 | struct mdk_thread_s *thread; /* management thread */ |
150 | struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ | 150 | struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ |
151 | sector_t curr_resync; /* blocks scheduled */ | 151 | sector_t curr_resync; /* last block scheduled */ |
152 | unsigned long resync_mark; /* a recent timestamp */ | 152 | unsigned long resync_mark; /* a recent timestamp */ |
153 | sector_t resync_mark_cnt;/* blocks written at resync_mark */ | 153 | sector_t resync_mark_cnt;/* blocks written at resync_mark */ |
154 | sector_t curr_mark_cnt; /* blocks scheduled now */ | ||
154 | 155 | ||
155 | sector_t resync_max_sectors; /* may be set by personality */ | 156 | sector_t resync_max_sectors; /* may be set by personality */ |
156 | 157 | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 48dfe00070c7..b4ca73d65891 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -163,14 +163,22 @@ extern int rcu_needs_cpu(int cpu); | |||
163 | * | 163 | * |
164 | * It is illegal to block while in an RCU read-side critical section. | 164 | * It is illegal to block while in an RCU read-side critical section. |
165 | */ | 165 | */ |
166 | #define rcu_read_lock() preempt_disable() | 166 | #define rcu_read_lock() \ |
167 | do { \ | ||
168 | preempt_disable(); \ | ||
169 | __acquire(RCU); \ | ||
170 | } while(0) | ||
167 | 171 | ||
168 | /** | 172 | /** |
169 | * rcu_read_unlock - marks the end of an RCU read-side critical section. | 173 | * rcu_read_unlock - marks the end of an RCU read-side critical section. |
170 | * | 174 | * |
171 | * See rcu_read_lock() for more information. | 175 | * See rcu_read_lock() for more information. |
172 | */ | 176 | */ |
173 | #define rcu_read_unlock() preempt_enable() | 177 | #define rcu_read_unlock() \ |
178 | do { \ | ||
179 | __release(RCU); \ | ||
180 | preempt_enable(); \ | ||
181 | } while(0) | ||
174 | 182 | ||
175 | /* | 183 | /* |
176 | * So where is rcu_write_lock()? It does not exist, as there is no | 184 | * So where is rcu_write_lock()? It does not exist, as there is no |
@@ -193,14 +201,22 @@ extern int rcu_needs_cpu(int cpu); | |||
193 | * can use just rcu_read_lock(). | 201 | * can use just rcu_read_lock(). |
194 | * | 202 | * |
195 | */ | 203 | */ |
196 | #define rcu_read_lock_bh() local_bh_disable() | 204 | #define rcu_read_lock_bh() \ |
205 | do { \ | ||
206 | local_bh_disable(); \ | ||
207 | __acquire(RCU_BH); \ | ||
208 | } while(0) | ||
197 | 209 | ||
198 | /* | 210 | /* |
199 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section | 211 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section |
200 | * | 212 | * |
201 | * See rcu_read_lock_bh() for more information. | 213 | * See rcu_read_lock_bh() for more information. |
202 | */ | 214 | */ |
203 | #define rcu_read_unlock_bh() local_bh_enable() | 215 | #define rcu_read_unlock_bh() \ |
216 | do { \ | ||
217 | __release(RCU_BH); \ | ||
218 | local_bh_enable(); \ | ||
219 | } while(0) | ||
204 | 220 | ||
205 | /** | 221 | /** |
206 | * rcu_dereference - fetch an RCU-protected pointer in an | 222 | * rcu_dereference - fetch an RCU-protected pointer in an |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 5676c4210e2c..daa2d83cefe8 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1973,7 +1973,7 @@ void reiserfs_unmap_buffer(struct buffer_head *); | |||
1973 | /* file.c */ | 1973 | /* file.c */ |
1974 | extern struct inode_operations reiserfs_file_inode_operations; | 1974 | extern struct inode_operations reiserfs_file_inode_operations; |
1975 | extern const struct file_operations reiserfs_file_operations; | 1975 | extern const struct file_operations reiserfs_file_operations; |
1976 | extern struct address_space_operations reiserfs_address_space_operations; | 1976 | extern const struct address_space_operations reiserfs_address_space_operations; |
1977 | 1977 | ||
1978 | /* fix_nodes.c */ | 1978 | /* fix_nodes.c */ |
1979 | 1979 | ||
diff --git a/include/linux/root_dev.h b/include/linux/root_dev.h index ea4bc9d13735..ed241aad7c17 100644 --- a/include/linux/root_dev.h +++ b/include/linux/root_dev.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _ROOT_DEV_H_ | 2 | #define _ROOT_DEV_H_ |
3 | 3 | ||
4 | #include <linux/major.h> | 4 | #include <linux/major.h> |
5 | #include <linux/types.h> | ||
6 | #include <linux/kdev_t.h> | ||
5 | 7 | ||
6 | enum { | 8 | enum { |
7 | Root_NFS = MKDEV(UNNAMED_MAJOR, 255), | 9 | Root_NFS = MKDEV(UNNAMED_MAJOR, 255), |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 36e2bf4b4315..5371e4e74595 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -34,8 +34,8 @@ struct rtc_time { | |||
34 | * alarm API. | 34 | * alarm API. |
35 | */ | 35 | */ |
36 | struct rtc_wkalrm { | 36 | struct rtc_wkalrm { |
37 | unsigned char enabled; /* 0 = alarm disable, 1 = alarm disabled */ | 37 | unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */ |
38 | unsigned char pending; /* 0 = alarm pending, 1 = alarm not pending */ | 38 | unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */ |
39 | struct rtc_time time; /* time the alarm is set to */ | 39 | struct rtc_time time; /* time the alarm is set to */ |
40 | }; | 40 | }; |
41 | 41 | ||
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index fa4a3b82ba70..5d41dee82f80 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
@@ -29,8 +29,6 @@ struct rt_mutex { | |||
29 | struct task_struct *owner; | 29 | struct task_struct *owner; |
30 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 30 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
31 | int save_state; | 31 | int save_state; |
32 | struct list_head held_list_entry; | ||
33 | unsigned long acquire_ip; | ||
34 | const char *name, *file; | 32 | const char *name, *file; |
35 | int line; | 33 | int line; |
36 | void *magic; | 34 | void *magic; |
@@ -98,14 +96,6 @@ extern int rt_mutex_trylock(struct rt_mutex *lock); | |||
98 | 96 | ||
99 | extern void rt_mutex_unlock(struct rt_mutex *lock); | 97 | extern void rt_mutex_unlock(struct rt_mutex *lock); |
100 | 98 | ||
101 | #ifdef CONFIG_DEBUG_RT_MUTEXES | ||
102 | # define INIT_RT_MUTEX_DEBUG(tsk) \ | ||
103 | .held_list_head = LIST_HEAD_INIT(tsk.held_list_head), \ | ||
104 | .held_list_lock = SPIN_LOCK_UNLOCKED | ||
105 | #else | ||
106 | # define INIT_RT_MUTEX_DEBUG(tsk) | ||
107 | #endif | ||
108 | |||
109 | #ifdef CONFIG_RT_MUTEXES | 99 | #ifdef CONFIG_RT_MUTEXES |
110 | # define INIT_RT_MUTEXES(tsk) \ | 100 | # define INIT_RT_MUTEXES(tsk) \ |
111 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ | 101 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ |
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index f30f805080ae..ae1fcadd598e 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h | |||
@@ -32,30 +32,37 @@ struct rw_semaphore { | |||
32 | __s32 activity; | 32 | __s32 activity; |
33 | spinlock_t wait_lock; | 33 | spinlock_t wait_lock; |
34 | struct list_head wait_list; | 34 | struct list_head wait_list; |
35 | #if RWSEM_DEBUG | 35 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
36 | int debug; | 36 | struct lockdep_map dep_map; |
37 | #endif | 37 | #endif |
38 | }; | 38 | }; |
39 | 39 | ||
40 | /* | 40 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
41 | * initialisation | 41 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } |
42 | */ | ||
43 | #if RWSEM_DEBUG | ||
44 | #define __RWSEM_DEBUG_INIT , 0 | ||
45 | #else | 42 | #else |
46 | #define __RWSEM_DEBUG_INIT /* */ | 43 | # define __RWSEM_DEP_MAP_INIT(lockname) |
47 | #endif | 44 | #endif |
48 | 45 | ||
49 | #define __RWSEM_INITIALIZER(name) \ | 46 | #define __RWSEM_INITIALIZER(name) \ |
50 | { 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEBUG_INIT } | 47 | { 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } |
51 | 48 | ||
52 | #define DECLARE_RWSEM(name) \ | 49 | #define DECLARE_RWSEM(name) \ |
53 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 50 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
54 | 51 | ||
55 | extern void FASTCALL(init_rwsem(struct rw_semaphore *sem)); | 52 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, |
53 | struct lock_class_key *key); | ||
54 | |||
55 | #define init_rwsem(sem) \ | ||
56 | do { \ | ||
57 | static struct lock_class_key __key; \ | ||
58 | \ | ||
59 | __init_rwsem((sem), #sem, &__key); \ | ||
60 | } while (0) | ||
61 | |||
56 | extern void FASTCALL(__down_read(struct rw_semaphore *sem)); | 62 | extern void FASTCALL(__down_read(struct rw_semaphore *sem)); |
57 | extern int FASTCALL(__down_read_trylock(struct rw_semaphore *sem)); | 63 | extern int FASTCALL(__down_read_trylock(struct rw_semaphore *sem)); |
58 | extern void FASTCALL(__down_write(struct rw_semaphore *sem)); | 64 | extern void FASTCALL(__down_write(struct rw_semaphore *sem)); |
65 | extern void FASTCALL(__down_write_nested(struct rw_semaphore *sem, int subclass)); | ||
59 | extern int FASTCALL(__down_write_trylock(struct rw_semaphore *sem)); | 66 | extern int FASTCALL(__down_write_trylock(struct rw_semaphore *sem)); |
60 | extern void FASTCALL(__up_read(struct rw_semaphore *sem)); | 67 | extern void FASTCALL(__up_read(struct rw_semaphore *sem)); |
61 | extern void FASTCALL(__up_write(struct rw_semaphore *sem)); | 68 | extern void FASTCALL(__up_write(struct rw_semaphore *sem)); |
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index f99fe90732ab..7b524b4109a0 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
@@ -9,8 +9,6 @@ | |||
9 | 9 | ||
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | 11 | ||
12 | #define RWSEM_DEBUG 0 | ||
13 | |||
14 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
15 | 13 | ||
16 | #include <linux/types.h> | 14 | #include <linux/types.h> |
@@ -26,89 +24,71 @@ struct rw_semaphore; | |||
26 | #include <asm/rwsem.h> /* use an arch-specific implementation */ | 24 | #include <asm/rwsem.h> /* use an arch-specific implementation */ |
27 | #endif | 25 | #endif |
28 | 26 | ||
29 | #ifndef rwsemtrace | ||
30 | #if RWSEM_DEBUG | ||
31 | extern void FASTCALL(rwsemtrace(struct rw_semaphore *sem, const char *str)); | ||
32 | #else | ||
33 | #define rwsemtrace(SEM,FMT) | ||
34 | #endif | ||
35 | #endif | ||
36 | |||
37 | /* | 27 | /* |
38 | * lock for reading | 28 | * lock for reading |
39 | */ | 29 | */ |
40 | static inline void down_read(struct rw_semaphore *sem) | 30 | extern void down_read(struct rw_semaphore *sem); |
41 | { | ||
42 | might_sleep(); | ||
43 | rwsemtrace(sem,"Entering down_read"); | ||
44 | __down_read(sem); | ||
45 | rwsemtrace(sem,"Leaving down_read"); | ||
46 | } | ||
47 | 31 | ||
48 | /* | 32 | /* |
49 | * trylock for reading -- returns 1 if successful, 0 if contention | 33 | * trylock for reading -- returns 1 if successful, 0 if contention |
50 | */ | 34 | */ |
51 | static inline int down_read_trylock(struct rw_semaphore *sem) | 35 | extern int down_read_trylock(struct rw_semaphore *sem); |
52 | { | ||
53 | int ret; | ||
54 | rwsemtrace(sem,"Entering down_read_trylock"); | ||
55 | ret = __down_read_trylock(sem); | ||
56 | rwsemtrace(sem,"Leaving down_read_trylock"); | ||
57 | return ret; | ||
58 | } | ||
59 | 36 | ||
60 | /* | 37 | /* |
61 | * lock for writing | 38 | * lock for writing |
62 | */ | 39 | */ |
63 | static inline void down_write(struct rw_semaphore *sem) | 40 | extern void down_write(struct rw_semaphore *sem); |
64 | { | ||
65 | might_sleep(); | ||
66 | rwsemtrace(sem,"Entering down_write"); | ||
67 | __down_write(sem); | ||
68 | rwsemtrace(sem,"Leaving down_write"); | ||
69 | } | ||
70 | 41 | ||
71 | /* | 42 | /* |
72 | * trylock for writing -- returns 1 if successful, 0 if contention | 43 | * trylock for writing -- returns 1 if successful, 0 if contention |
73 | */ | 44 | */ |
74 | static inline int down_write_trylock(struct rw_semaphore *sem) | 45 | extern int down_write_trylock(struct rw_semaphore *sem); |
75 | { | ||
76 | int ret; | ||
77 | rwsemtrace(sem,"Entering down_write_trylock"); | ||
78 | ret = __down_write_trylock(sem); | ||
79 | rwsemtrace(sem,"Leaving down_write_trylock"); | ||
80 | return ret; | ||
81 | } | ||
82 | 46 | ||
83 | /* | 47 | /* |
84 | * release a read lock | 48 | * release a read lock |
85 | */ | 49 | */ |
86 | static inline void up_read(struct rw_semaphore *sem) | 50 | extern void up_read(struct rw_semaphore *sem); |
87 | { | ||
88 | rwsemtrace(sem,"Entering up_read"); | ||
89 | __up_read(sem); | ||
90 | rwsemtrace(sem,"Leaving up_read"); | ||
91 | } | ||
92 | 51 | ||
93 | /* | 52 | /* |
94 | * release a write lock | 53 | * release a write lock |
95 | */ | 54 | */ |
96 | static inline void up_write(struct rw_semaphore *sem) | 55 | extern void up_write(struct rw_semaphore *sem); |
97 | { | ||
98 | rwsemtrace(sem,"Entering up_write"); | ||
99 | __up_write(sem); | ||
100 | rwsemtrace(sem,"Leaving up_write"); | ||
101 | } | ||
102 | 56 | ||
103 | /* | 57 | /* |
104 | * downgrade write lock to read lock | 58 | * downgrade write lock to read lock |
105 | */ | 59 | */ |
106 | static inline void downgrade_write(struct rw_semaphore *sem) | 60 | extern void downgrade_write(struct rw_semaphore *sem); |
107 | { | 61 | |
108 | rwsemtrace(sem,"Entering downgrade_write"); | 62 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
109 | __downgrade_write(sem); | 63 | /* |
110 | rwsemtrace(sem,"Leaving downgrade_write"); | 64 | * nested locking. NOTE: rwsems are not allowed to recurse |
111 | } | 65 | * (which occurs if the same task tries to acquire the same |
66 | * lock instance multiple times), but multiple locks of the | ||
67 | * same lock class might be taken, if the order of the locks | ||
68 | * is always the same. This ordering rule can be expressed | ||
69 | * to lockdep via the _nested() APIs, but enumerating the | ||
70 | * subclasses that are used. (If the nesting relationship is | ||
71 | * static then another method for expressing nested locking is | ||
72 | * the explicit definition of lock class keys and the use of | ||
73 | * lockdep_set_class() at lock initialization time. | ||
74 | * See Documentation/lockdep-design.txt for more details.) | ||
75 | */ | ||
76 | extern void down_read_nested(struct rw_semaphore *sem, int subclass); | ||
77 | extern void down_write_nested(struct rw_semaphore *sem, int subclass); | ||
78 | /* | ||
79 | * Take/release a lock when not the owner will release it. | ||
80 | * | ||
81 | * [ This API should be avoided as much as possible - the | ||
82 | * proper abstraction for this case is completions. ] | ||
83 | */ | ||
84 | extern void down_read_non_owner(struct rw_semaphore *sem); | ||
85 | extern void up_read_non_owner(struct rw_semaphore *sem); | ||
86 | #else | ||
87 | # define down_read_nested(sem, subclass) down_read(sem) | ||
88 | # define down_write_nested(sem, subclass) down_write(sem) | ||
89 | # define down_read_non_owner(sem) down_read(sem) | ||
90 | # define up_read_non_owner(sem) up_read(sem) | ||
91 | #endif | ||
112 | 92 | ||
113 | #endif /* __KERNEL__ */ | 93 | #endif /* __KERNEL__ */ |
114 | #endif /* _LINUX_RWSEM_H */ | 94 | #endif /* _LINUX_RWSEM_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 821f0481ebe1..1c876e27ff93 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -184,11 +184,11 @@ extern unsigned long weighted_cpuload(const int cpu); | |||
184 | extern rwlock_t tasklist_lock; | 184 | extern rwlock_t tasklist_lock; |
185 | extern spinlock_t mmlist_lock; | 185 | extern spinlock_t mmlist_lock; |
186 | 186 | ||
187 | typedef struct task_struct task_t; | 187 | struct task_struct; |
188 | 188 | ||
189 | extern void sched_init(void); | 189 | extern void sched_init(void); |
190 | extern void sched_init_smp(void); | 190 | extern void sched_init_smp(void); |
191 | extern void init_idle(task_t *idle, int cpu); | 191 | extern void init_idle(struct task_struct *idle, int cpu); |
192 | 192 | ||
193 | extern cpumask_t nohz_cpu_mask; | 193 | extern cpumask_t nohz_cpu_mask; |
194 | 194 | ||
@@ -383,7 +383,7 @@ struct signal_struct { | |||
383 | wait_queue_head_t wait_chldexit; /* for wait4() */ | 383 | wait_queue_head_t wait_chldexit; /* for wait4() */ |
384 | 384 | ||
385 | /* current thread group signal load-balancing target: */ | 385 | /* current thread group signal load-balancing target: */ |
386 | task_t *curr_target; | 386 | struct task_struct *curr_target; |
387 | 387 | ||
388 | /* shared signal handling: */ | 388 | /* shared signal handling: */ |
389 | struct sigpending shared_pending; | 389 | struct sigpending shared_pending; |
@@ -534,7 +534,6 @@ extern struct user_struct *find_user(uid_t); | |||
534 | extern struct user_struct root_user; | 534 | extern struct user_struct root_user; |
535 | #define INIT_USER (&root_user) | 535 | #define INIT_USER (&root_user) |
536 | 536 | ||
537 | typedef struct prio_array prio_array_t; | ||
538 | struct backing_dev_info; | 537 | struct backing_dev_info; |
539 | struct reclaim_state; | 538 | struct reclaim_state; |
540 | 539 | ||
@@ -699,7 +698,7 @@ extern int groups_search(struct group_info *group_info, gid_t grp); | |||
699 | ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) | 698 | ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) |
700 | 699 | ||
701 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK | 700 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK |
702 | extern void prefetch_stack(struct task_struct*); | 701 | extern void prefetch_stack(struct task_struct *t); |
703 | #else | 702 | #else |
704 | static inline void prefetch_stack(struct task_struct *t) { } | 703 | static inline void prefetch_stack(struct task_struct *t) { } |
705 | #endif | 704 | #endif |
@@ -715,6 +714,8 @@ enum sleep_type { | |||
715 | SLEEP_INTERRUPTED, | 714 | SLEEP_INTERRUPTED, |
716 | }; | 715 | }; |
717 | 716 | ||
717 | struct prio_array; | ||
718 | |||
718 | struct task_struct { | 719 | struct task_struct { |
719 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ | 720 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ |
720 | struct thread_info *thread_info; | 721 | struct thread_info *thread_info; |
@@ -732,7 +733,7 @@ struct task_struct { | |||
732 | int load_weight; /* for niceness load balancing purposes */ | 733 | int load_weight; /* for niceness load balancing purposes */ |
733 | int prio, static_prio, normal_prio; | 734 | int prio, static_prio, normal_prio; |
734 | struct list_head run_list; | 735 | struct list_head run_list; |
735 | prio_array_t *array; | 736 | struct prio_array *array; |
736 | 737 | ||
737 | unsigned short ioprio; | 738 | unsigned short ioprio; |
738 | unsigned int btrace_seq; | 739 | unsigned int btrace_seq; |
@@ -865,16 +866,34 @@ struct task_struct { | |||
865 | struct plist_head pi_waiters; | 866 | struct plist_head pi_waiters; |
866 | /* Deadlock detection and priority inheritance handling */ | 867 | /* Deadlock detection and priority inheritance handling */ |
867 | struct rt_mutex_waiter *pi_blocked_on; | 868 | struct rt_mutex_waiter *pi_blocked_on; |
868 | # ifdef CONFIG_DEBUG_RT_MUTEXES | ||
869 | spinlock_t held_list_lock; | ||
870 | struct list_head held_list_head; | ||
871 | # endif | ||
872 | #endif | 869 | #endif |
873 | 870 | ||
874 | #ifdef CONFIG_DEBUG_MUTEXES | 871 | #ifdef CONFIG_DEBUG_MUTEXES |
875 | /* mutex deadlock detection */ | 872 | /* mutex deadlock detection */ |
876 | struct mutex_waiter *blocked_on; | 873 | struct mutex_waiter *blocked_on; |
877 | #endif | 874 | #endif |
875 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
876 | unsigned int irq_events; | ||
877 | int hardirqs_enabled; | ||
878 | unsigned long hardirq_enable_ip; | ||
879 | unsigned int hardirq_enable_event; | ||
880 | unsigned long hardirq_disable_ip; | ||
881 | unsigned int hardirq_disable_event; | ||
882 | int softirqs_enabled; | ||
883 | unsigned long softirq_disable_ip; | ||
884 | unsigned int softirq_disable_event; | ||
885 | unsigned long softirq_enable_ip; | ||
886 | unsigned int softirq_enable_event; | ||
887 | int hardirq_context; | ||
888 | int softirq_context; | ||
889 | #endif | ||
890 | #ifdef CONFIG_LOCKDEP | ||
891 | # define MAX_LOCK_DEPTH 30UL | ||
892 | u64 curr_chain_key; | ||
893 | int lockdep_depth; | ||
894 | struct held_lock held_locks[MAX_LOCK_DEPTH]; | ||
895 | unsigned int lockdep_recursion; | ||
896 | #endif | ||
878 | 897 | ||
879 | /* journalling filesystem info */ | 898 | /* journalling filesystem info */ |
880 | void *journal_info; | 899 | void *journal_info; |
@@ -1013,9 +1032,9 @@ static inline void put_task_struct(struct task_struct *t) | |||
1013 | #define used_math() tsk_used_math(current) | 1032 | #define used_math() tsk_used_math(current) |
1014 | 1033 | ||
1015 | #ifdef CONFIG_SMP | 1034 | #ifdef CONFIG_SMP |
1016 | extern int set_cpus_allowed(task_t *p, cpumask_t new_mask); | 1035 | extern int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask); |
1017 | #else | 1036 | #else |
1018 | static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) | 1037 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) |
1019 | { | 1038 | { |
1020 | if (!cpu_isset(0, new_mask)) | 1039 | if (!cpu_isset(0, new_mask)) |
1021 | return -EINVAL; | 1040 | return -EINVAL; |
@@ -1024,7 +1043,8 @@ static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) | |||
1024 | #endif | 1043 | #endif |
1025 | 1044 | ||
1026 | extern unsigned long long sched_clock(void); | 1045 | extern unsigned long long sched_clock(void); |
1027 | extern unsigned long long current_sched_time(const task_t *current_task); | 1046 | extern unsigned long long |
1047 | current_sched_time(const struct task_struct *current_task); | ||
1028 | 1048 | ||
1029 | /* sched_exec is called by processes performing an exec */ | 1049 | /* sched_exec is called by processes performing an exec */ |
1030 | #ifdef CONFIG_SMP | 1050 | #ifdef CONFIG_SMP |
@@ -1042,27 +1062,27 @@ static inline void idle_task_exit(void) {} | |||
1042 | extern void sched_idle_next(void); | 1062 | extern void sched_idle_next(void); |
1043 | 1063 | ||
1044 | #ifdef CONFIG_RT_MUTEXES | 1064 | #ifdef CONFIG_RT_MUTEXES |
1045 | extern int rt_mutex_getprio(task_t *p); | 1065 | extern int rt_mutex_getprio(struct task_struct *p); |
1046 | extern void rt_mutex_setprio(task_t *p, int prio); | 1066 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
1047 | extern void rt_mutex_adjust_pi(task_t *p); | 1067 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
1048 | #else | 1068 | #else |
1049 | static inline int rt_mutex_getprio(task_t *p) | 1069 | static inline int rt_mutex_getprio(struct task_struct *p) |
1050 | { | 1070 | { |
1051 | return p->normal_prio; | 1071 | return p->normal_prio; |
1052 | } | 1072 | } |
1053 | # define rt_mutex_adjust_pi(p) do { } while (0) | 1073 | # define rt_mutex_adjust_pi(p) do { } while (0) |
1054 | #endif | 1074 | #endif |
1055 | 1075 | ||
1056 | extern void set_user_nice(task_t *p, long nice); | 1076 | extern void set_user_nice(struct task_struct *p, long nice); |
1057 | extern int task_prio(const task_t *p); | 1077 | extern int task_prio(const struct task_struct *p); |
1058 | extern int task_nice(const task_t *p); | 1078 | extern int task_nice(const struct task_struct *p); |
1059 | extern int can_nice(const task_t *p, const int nice); | 1079 | extern int can_nice(const struct task_struct *p, const int nice); |
1060 | extern int task_curr(const task_t *p); | 1080 | extern int task_curr(const struct task_struct *p); |
1061 | extern int idle_cpu(int cpu); | 1081 | extern int idle_cpu(int cpu); |
1062 | extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); | 1082 | extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); |
1063 | extern task_t *idle_task(int cpu); | 1083 | extern struct task_struct *idle_task(int cpu); |
1064 | extern task_t *curr_task(int cpu); | 1084 | extern struct task_struct *curr_task(int cpu); |
1065 | extern void set_curr_task(int cpu, task_t *p); | 1085 | extern void set_curr_task(int cpu, struct task_struct *p); |
1066 | 1086 | ||
1067 | void yield(void); | 1087 | void yield(void); |
1068 | 1088 | ||
@@ -1119,8 +1139,8 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk, | |||
1119 | #else | 1139 | #else |
1120 | static inline void kick_process(struct task_struct *tsk) { } | 1140 | static inline void kick_process(struct task_struct *tsk) { } |
1121 | #endif | 1141 | #endif |
1122 | extern void FASTCALL(sched_fork(task_t * p, int clone_flags)); | 1142 | extern void FASTCALL(sched_fork(struct task_struct * p, int clone_flags)); |
1123 | extern void FASTCALL(sched_exit(task_t * p)); | 1143 | extern void FASTCALL(sched_exit(struct task_struct * p)); |
1124 | 1144 | ||
1125 | extern int in_group_p(gid_t); | 1145 | extern int in_group_p(gid_t); |
1126 | extern int in_egroup_p(gid_t); | 1146 | extern int in_egroup_p(gid_t); |
@@ -1153,7 +1173,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *); | |||
1153 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1173 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1154 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1174 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1155 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1175 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1156 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t); | 1176 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32); |
1157 | extern void do_notify_parent(struct task_struct *, int); | 1177 | extern void do_notify_parent(struct task_struct *, int); |
1158 | extern void force_sig(int, struct task_struct *); | 1178 | extern void force_sig(int, struct task_struct *); |
1159 | extern void force_sig_specific(int, struct task_struct *); | 1179 | extern void force_sig_specific(int, struct task_struct *); |
@@ -1225,17 +1245,17 @@ extern NORET_TYPE void do_group_exit(int); | |||
1225 | extern void daemonize(const char *, ...); | 1245 | extern void daemonize(const char *, ...); |
1226 | extern int allow_signal(int); | 1246 | extern int allow_signal(int); |
1227 | extern int disallow_signal(int); | 1247 | extern int disallow_signal(int); |
1228 | extern task_t *child_reaper; | 1248 | extern struct task_struct *child_reaper; |
1229 | 1249 | ||
1230 | extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); | 1250 | extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); |
1231 | extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); | 1251 | extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); |
1232 | task_t *fork_idle(int); | 1252 | struct task_struct *fork_idle(int); |
1233 | 1253 | ||
1234 | extern void set_task_comm(struct task_struct *tsk, char *from); | 1254 | extern void set_task_comm(struct task_struct *tsk, char *from); |
1235 | extern void get_task_comm(char *to, struct task_struct *tsk); | 1255 | extern void get_task_comm(char *to, struct task_struct *tsk); |
1236 | 1256 | ||
1237 | #ifdef CONFIG_SMP | 1257 | #ifdef CONFIG_SMP |
1238 | extern void wait_task_inactive(task_t * p); | 1258 | extern void wait_task_inactive(struct task_struct * p); |
1239 | #else | 1259 | #else |
1240 | #define wait_task_inactive(p) do { } while (0) | 1260 | #define wait_task_inactive(p) do { } while (0) |
1241 | #endif | 1261 | #endif |
@@ -1261,13 +1281,13 @@ extern void wait_task_inactive(task_t * p); | |||
1261 | /* de_thread depends on thread_group_leader not being a pid based check */ | 1281 | /* de_thread depends on thread_group_leader not being a pid based check */ |
1262 | #define thread_group_leader(p) (p == p->group_leader) | 1282 | #define thread_group_leader(p) (p == p->group_leader) |
1263 | 1283 | ||
1264 | static inline task_t *next_thread(const task_t *p) | 1284 | static inline struct task_struct *next_thread(const struct task_struct *p) |
1265 | { | 1285 | { |
1266 | return list_entry(rcu_dereference(p->thread_group.next), | 1286 | return list_entry(rcu_dereference(p->thread_group.next), |
1267 | task_t, thread_group); | 1287 | struct task_struct, thread_group); |
1268 | } | 1288 | } |
1269 | 1289 | ||
1270 | static inline int thread_group_empty(task_t *p) | 1290 | static inline int thread_group_empty(struct task_struct *p) |
1271 | { | 1291 | { |
1272 | return list_empty(&p->thread_group); | 1292 | return list_empty(&p->thread_group); |
1273 | } | 1293 | } |
diff --git a/include/linux/security.h b/include/linux/security.h index 51805806f974..f75303831d09 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -67,7 +67,7 @@ struct xfrm_state; | |||
67 | struct xfrm_user_sec_ctx; | 67 | struct xfrm_user_sec_ctx; |
68 | 68 | ||
69 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | 69 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); |
70 | extern int cap_netlink_recv(struct sk_buff *skb); | 70 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * Values used in the task_security_ops calls | 73 | * Values used in the task_security_ops calls |
@@ -567,6 +567,9 @@ struct swap_info_struct; | |||
567 | * @p. | 567 | * @p. |
568 | * @p contains the task_struct for the process. | 568 | * @p contains the task_struct for the process. |
569 | * Return 0 if permission is granted. | 569 | * Return 0 if permission is granted. |
570 | * @task_getsecid: | ||
571 | * Retrieve the security identifier of the process @p. | ||
572 | * @p contains the task_struct for the process and place is into @secid. | ||
570 | * @task_setgroups: | 573 | * @task_setgroups: |
571 | * Check permission before setting the supplementary group set of the | 574 | * Check permission before setting the supplementary group set of the |
572 | * current process. | 575 | * current process. |
@@ -582,6 +585,10 @@ struct swap_info_struct; | |||
582 | * @p contains the task_struct of process. | 585 | * @p contains the task_struct of process. |
583 | * @ioprio contains the new ioprio value | 586 | * @ioprio contains the new ioprio value |
584 | * Return 0 if permission is granted. | 587 | * Return 0 if permission is granted. |
588 | * @task_getioprio | ||
589 | * Check permission before getting the ioprio value of @p. | ||
590 | * @p contains the task_struct of process. | ||
591 | * Return 0 if permission is granted. | ||
585 | * @task_setrlimit: | 592 | * @task_setrlimit: |
586 | * Check permission before setting the resource limits of the current | 593 | * Check permission before setting the resource limits of the current |
587 | * process for @resource to @new_rlim. The old resource limit values can | 594 | * process for @resource to @new_rlim. The old resource limit values can |
@@ -615,6 +622,7 @@ struct swap_info_struct; | |||
615 | * @p contains the task_struct for process. | 622 | * @p contains the task_struct for process. |
616 | * @info contains the signal information. | 623 | * @info contains the signal information. |
617 | * @sig contains the signal value. | 624 | * @sig contains the signal value. |
625 | * @secid contains the sid of the process where the signal originated | ||
618 | * Return 0 if permission is granted. | 626 | * Return 0 if permission is granted. |
619 | * @task_wait: | 627 | * @task_wait: |
620 | * Check permission before allowing a process to reap a child process @p | 628 | * Check permission before allowing a process to reap a child process @p |
@@ -656,6 +664,7 @@ struct swap_info_struct; | |||
656 | * Check permission before processing the received netlink message in | 664 | * Check permission before processing the received netlink message in |
657 | * @skb. | 665 | * @skb. |
658 | * @skb contains the sk_buff structure for the netlink message. | 666 | * @skb contains the sk_buff structure for the netlink message. |
667 | * @cap indicates the capability required | ||
659 | * Return 0 if permission is granted. | 668 | * Return 0 if permission is granted. |
660 | * | 669 | * |
661 | * Security hooks for Unix domain networking. | 670 | * Security hooks for Unix domain networking. |
@@ -1218,16 +1227,18 @@ struct security_operations { | |||
1218 | int (*task_setpgid) (struct task_struct * p, pid_t pgid); | 1227 | int (*task_setpgid) (struct task_struct * p, pid_t pgid); |
1219 | int (*task_getpgid) (struct task_struct * p); | 1228 | int (*task_getpgid) (struct task_struct * p); |
1220 | int (*task_getsid) (struct task_struct * p); | 1229 | int (*task_getsid) (struct task_struct * p); |
1230 | void (*task_getsecid) (struct task_struct * p, u32 * secid); | ||
1221 | int (*task_setgroups) (struct group_info *group_info); | 1231 | int (*task_setgroups) (struct group_info *group_info); |
1222 | int (*task_setnice) (struct task_struct * p, int nice); | 1232 | int (*task_setnice) (struct task_struct * p, int nice); |
1223 | int (*task_setioprio) (struct task_struct * p, int ioprio); | 1233 | int (*task_setioprio) (struct task_struct * p, int ioprio); |
1234 | int (*task_getioprio) (struct task_struct * p); | ||
1224 | int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); | 1235 | int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); |
1225 | int (*task_setscheduler) (struct task_struct * p, int policy, | 1236 | int (*task_setscheduler) (struct task_struct * p, int policy, |
1226 | struct sched_param * lp); | 1237 | struct sched_param * lp); |
1227 | int (*task_getscheduler) (struct task_struct * p); | 1238 | int (*task_getscheduler) (struct task_struct * p); |
1228 | int (*task_movememory) (struct task_struct * p); | 1239 | int (*task_movememory) (struct task_struct * p); |
1229 | int (*task_kill) (struct task_struct * p, | 1240 | int (*task_kill) (struct task_struct * p, |
1230 | struct siginfo * info, int sig); | 1241 | struct siginfo * info, int sig, u32 secid); |
1231 | int (*task_wait) (struct task_struct * p); | 1242 | int (*task_wait) (struct task_struct * p); |
1232 | int (*task_prctl) (int option, unsigned long arg2, | 1243 | int (*task_prctl) (int option, unsigned long arg2, |
1233 | unsigned long arg3, unsigned long arg4, | 1244 | unsigned long arg3, unsigned long arg4, |
@@ -1266,7 +1277,7 @@ struct security_operations { | |||
1266 | struct sembuf * sops, unsigned nsops, int alter); | 1277 | struct sembuf * sops, unsigned nsops, int alter); |
1267 | 1278 | ||
1268 | int (*netlink_send) (struct sock * sk, struct sk_buff * skb); | 1279 | int (*netlink_send) (struct sock * sk, struct sk_buff * skb); |
1269 | int (*netlink_recv) (struct sk_buff * skb); | 1280 | int (*netlink_recv) (struct sk_buff * skb, int cap); |
1270 | 1281 | ||
1271 | /* allow module stacking */ | 1282 | /* allow module stacking */ |
1272 | int (*register_security) (const char *name, | 1283 | int (*register_security) (const char *name, |
@@ -1838,6 +1849,11 @@ static inline int security_task_getsid (struct task_struct *p) | |||
1838 | return security_ops->task_getsid (p); | 1849 | return security_ops->task_getsid (p); |
1839 | } | 1850 | } |
1840 | 1851 | ||
1852 | static inline void security_task_getsecid (struct task_struct *p, u32 *secid) | ||
1853 | { | ||
1854 | security_ops->task_getsecid (p, secid); | ||
1855 | } | ||
1856 | |||
1841 | static inline int security_task_setgroups (struct group_info *group_info) | 1857 | static inline int security_task_setgroups (struct group_info *group_info) |
1842 | { | 1858 | { |
1843 | return security_ops->task_setgroups (group_info); | 1859 | return security_ops->task_setgroups (group_info); |
@@ -1853,6 +1869,11 @@ static inline int security_task_setioprio (struct task_struct *p, int ioprio) | |||
1853 | return security_ops->task_setioprio (p, ioprio); | 1869 | return security_ops->task_setioprio (p, ioprio); |
1854 | } | 1870 | } |
1855 | 1871 | ||
1872 | static inline int security_task_getioprio (struct task_struct *p) | ||
1873 | { | ||
1874 | return security_ops->task_getioprio (p); | ||
1875 | } | ||
1876 | |||
1856 | static inline int security_task_setrlimit (unsigned int resource, | 1877 | static inline int security_task_setrlimit (unsigned int resource, |
1857 | struct rlimit *new_rlim) | 1878 | struct rlimit *new_rlim) |
1858 | { | 1879 | { |
@@ -1877,9 +1898,10 @@ static inline int security_task_movememory (struct task_struct *p) | |||
1877 | } | 1898 | } |
1878 | 1899 | ||
1879 | static inline int security_task_kill (struct task_struct *p, | 1900 | static inline int security_task_kill (struct task_struct *p, |
1880 | struct siginfo *info, int sig) | 1901 | struct siginfo *info, int sig, |
1902 | u32 secid) | ||
1881 | { | 1903 | { |
1882 | return security_ops->task_kill (p, info, sig); | 1904 | return security_ops->task_kill (p, info, sig, secid); |
1883 | } | 1905 | } |
1884 | 1906 | ||
1885 | static inline int security_task_wait (struct task_struct *p) | 1907 | static inline int security_task_wait (struct task_struct *p) |
@@ -2032,9 +2054,9 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff * skb) | |||
2032 | return security_ops->netlink_send(sk, skb); | 2054 | return security_ops->netlink_send(sk, skb); |
2033 | } | 2055 | } |
2034 | 2056 | ||
2035 | static inline int security_netlink_recv(struct sk_buff * skb) | 2057 | static inline int security_netlink_recv(struct sk_buff * skb, int cap) |
2036 | { | 2058 | { |
2037 | return security_ops->netlink_recv(skb); | 2059 | return security_ops->netlink_recv(skb, cap); |
2038 | } | 2060 | } |
2039 | 2061 | ||
2040 | /* prototypes */ | 2062 | /* prototypes */ |
@@ -2490,6 +2512,9 @@ static inline int security_task_getsid (struct task_struct *p) | |||
2490 | return 0; | 2512 | return 0; |
2491 | } | 2513 | } |
2492 | 2514 | ||
2515 | static inline void security_task_getsecid (struct task_struct *p, u32 *secid) | ||
2516 | { } | ||
2517 | |||
2493 | static inline int security_task_setgroups (struct group_info *group_info) | 2518 | static inline int security_task_setgroups (struct group_info *group_info) |
2494 | { | 2519 | { |
2495 | return 0; | 2520 | return 0; |
@@ -2505,6 +2530,11 @@ static inline int security_task_setioprio (struct task_struct *p, int ioprio) | |||
2505 | return 0; | 2530 | return 0; |
2506 | } | 2531 | } |
2507 | 2532 | ||
2533 | static inline int security_task_getioprio (struct task_struct *p) | ||
2534 | { | ||
2535 | return 0; | ||
2536 | } | ||
2537 | |||
2508 | static inline int security_task_setrlimit (unsigned int resource, | 2538 | static inline int security_task_setrlimit (unsigned int resource, |
2509 | struct rlimit *new_rlim) | 2539 | struct rlimit *new_rlim) |
2510 | { | 2540 | { |
@@ -2529,7 +2559,8 @@ static inline int security_task_movememory (struct task_struct *p) | |||
2529 | } | 2559 | } |
2530 | 2560 | ||
2531 | static inline int security_task_kill (struct task_struct *p, | 2561 | static inline int security_task_kill (struct task_struct *p, |
2532 | struct siginfo *info, int sig) | 2562 | struct siginfo *info, int sig, |
2563 | u32 secid) | ||
2533 | { | 2564 | { |
2534 | return 0; | 2565 | return 0; |
2535 | } | 2566 | } |
@@ -2670,9 +2701,9 @@ static inline int security_netlink_send (struct sock *sk, struct sk_buff *skb) | |||
2670 | return cap_netlink_send (sk, skb); | 2701 | return cap_netlink_send (sk, skb); |
2671 | } | 2702 | } |
2672 | 2703 | ||
2673 | static inline int security_netlink_recv (struct sk_buff *skb) | 2704 | static inline int security_netlink_recv (struct sk_buff *skb, int cap) |
2674 | { | 2705 | { |
2675 | return cap_netlink_recv (skb); | 2706 | return cap_netlink_recv (skb, cap); |
2676 | } | 2707 | } |
2677 | 2708 | ||
2678 | static inline struct dentry *securityfs_create_dir(const char *name, | 2709 | static inline struct dentry *securityfs_create_dir(const char *name, |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 7bc5c7c12b54..46000936f8f1 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -38,9 +38,17 @@ typedef struct { | |||
38 | * These macros triggered gcc-3.x compile-time problems. We think these are | 38 | * These macros triggered gcc-3.x compile-time problems. We think these are |
39 | * OK now. Be cautious. | 39 | * OK now. Be cautious. |
40 | */ | 40 | */ |
41 | #define SEQLOCK_UNLOCKED { 0, SPIN_LOCK_UNLOCKED } | 41 | #define __SEQLOCK_UNLOCKED(lockname) \ |
42 | #define seqlock_init(x) do { *(x) = (seqlock_t) SEQLOCK_UNLOCKED; } while (0) | 42 | { 0, __SPIN_LOCK_UNLOCKED(lockname) } |
43 | 43 | ||
44 | #define SEQLOCK_UNLOCKED \ | ||
45 | __SEQLOCK_UNLOCKED(old_style_seqlock_init) | ||
46 | |||
47 | #define seqlock_init(x) \ | ||
48 | do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0) | ||
49 | |||
50 | #define DEFINE_SEQLOCK(x) \ | ||
51 | seqlock_t x = __SEQLOCK_UNLOCKED(x) | ||
44 | 52 | ||
45 | /* Lock out other writers and update the count. | 53 | /* Lock out other writers and update the count. |
46 | * Acts like a normal spin_lock/unlock. | 54 | * Acts like a normal spin_lock/unlock. |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 951c4e858274..86501a3de2ac 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -216,16 +216,18 @@ struct uart_port { | |||
216 | unsigned char __iomem *membase; /* read/write[bwl] */ | 216 | unsigned char __iomem *membase; /* read/write[bwl] */ |
217 | unsigned int irq; /* irq number */ | 217 | unsigned int irq; /* irq number */ |
218 | unsigned int uartclk; /* base uart clock */ | 218 | unsigned int uartclk; /* base uart clock */ |
219 | unsigned char fifosize; /* tx fifo size */ | 219 | unsigned int fifosize; /* tx fifo size */ |
220 | unsigned char x_char; /* xon/xoff char */ | 220 | unsigned char x_char; /* xon/xoff char */ |
221 | unsigned char regshift; /* reg offset shift */ | 221 | unsigned char regshift; /* reg offset shift */ |
222 | unsigned char iotype; /* io access style */ | 222 | unsigned char iotype; /* io access style */ |
223 | unsigned char unused1; | ||
223 | 224 | ||
224 | #define UPIO_PORT (0) | 225 | #define UPIO_PORT (0) |
225 | #define UPIO_HUB6 (1) | 226 | #define UPIO_HUB6 (1) |
226 | #define UPIO_MEM (2) | 227 | #define UPIO_MEM (2) |
227 | #define UPIO_MEM32 (3) | 228 | #define UPIO_MEM32 (3) |
228 | #define UPIO_AU (4) /* Au1x00 type IO */ | 229 | #define UPIO_AU (4) /* Au1x00 type IO */ |
230 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ | ||
229 | 231 | ||
230 | unsigned int read_status_mask; /* driver specific */ | 232 | unsigned int read_status_mask; /* driver specific */ |
231 | unsigned int ignore_status_mask; /* driver specific */ | 233 | unsigned int ignore_status_mask; /* driver specific */ |
@@ -336,7 +338,6 @@ struct uart_driver { | |||
336 | struct module *owner; | 338 | struct module *owner; |
337 | const char *driver_name; | 339 | const char *driver_name; |
338 | const char *dev_name; | 340 | const char *dev_name; |
339 | const char *devfs_name; | ||
340 | int major; | 341 | int major; |
341 | int minor; | 342 | int minor; |
342 | int nr; | 343 | int nr; |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 1e4ce7225eee..117135e33d67 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -9,32 +9,6 @@ | |||
9 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * These values of sa_flags are used only by the kernel as part of the | ||
13 | * irq handling routines. | ||
14 | * | ||
15 | * SA_INTERRUPT is also used by the irq handling routines. | ||
16 | * SA_SHIRQ is for shared interrupt support on PCI and EISA. | ||
17 | * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur | ||
18 | */ | ||
19 | #define SA_SAMPLE_RANDOM SA_RESTART | ||
20 | #define SA_SHIRQ 0x04000000 | ||
21 | #define SA_PROBEIRQ 0x08000000 | ||
22 | |||
23 | /* | ||
24 | * As above, these correspond to the IORESOURCE_IRQ_* defines in | ||
25 | * linux/ioport.h to select the interrupt line behaviour. When | ||
26 | * requesting an interrupt without specifying a SA_TRIGGER, the | ||
27 | * setting should be assumed to be "as already configured", which | ||
28 | * may be as per machine or firmware initialisation. | ||
29 | */ | ||
30 | #define SA_TRIGGER_LOW 0x00000008 | ||
31 | #define SA_TRIGGER_HIGH 0x00000004 | ||
32 | #define SA_TRIGGER_FALLING 0x00000002 | ||
33 | #define SA_TRIGGER_RISING 0x00000001 | ||
34 | #define SA_TRIGGER_MASK (SA_TRIGGER_HIGH|SA_TRIGGER_LOW|\ | ||
35 | SA_TRIGGER_RISING|SA_TRIGGER_FALLING) | ||
36 | |||
37 | /* | ||
38 | * Real Time signals may be queued. | 12 | * Real Time signals may be queued. |
39 | */ | 13 | */ |
40 | 14 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 16eef03ce0eb..0bf31b83578c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -171,7 +171,15 @@ enum { | |||
171 | 171 | ||
172 | enum { | 172 | enum { |
173 | SKB_GSO_TCPV4 = 1 << 0, | 173 | SKB_GSO_TCPV4 = 1 << 0, |
174 | SKB_GSO_UDPV4 = 1 << 1, | 174 | SKB_GSO_UDP = 1 << 1, |
175 | |||
176 | /* This indicates the skb is from an untrusted source. */ | ||
177 | SKB_GSO_DODGY = 1 << 2, | ||
178 | |||
179 | /* This indicates the tcp segment has CWR set. */ | ||
180 | SKB_GSO_TCP_ECN = 1 << 3, | ||
181 | |||
182 | SKB_GSO_TCPV6 = 1 << 4, | ||
175 | }; | 183 | }; |
176 | 184 | ||
177 | /** | 185 | /** |
@@ -596,9 +604,12 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_) | |||
596 | return list_->qlen; | 604 | return list_->qlen; |
597 | } | 605 | } |
598 | 606 | ||
607 | extern struct lock_class_key skb_queue_lock_key; | ||
608 | |||
599 | static inline void skb_queue_head_init(struct sk_buff_head *list) | 609 | static inline void skb_queue_head_init(struct sk_buff_head *list) |
600 | { | 610 | { |
601 | spin_lock_init(&list->lock); | 611 | spin_lock_init(&list->lock); |
612 | lockdep_set_class(&list->lock, &skb_queue_lock_key); | ||
602 | list->prev = list->next = (struct sk_buff *)list; | 613 | list->prev = list->next = (struct sk_buff *)list; |
603 | list->qlen = 0; | 614 | list->qlen = 0; |
604 | } | 615 | } |
@@ -1298,8 +1309,7 @@ extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | |||
1298 | extern void skb_split(struct sk_buff *skb, | 1309 | extern void skb_split(struct sk_buff *skb, |
1299 | struct sk_buff *skb1, const u32 len); | 1310 | struct sk_buff *skb1, const u32 len); |
1300 | 1311 | ||
1301 | extern void skb_release_data(struct sk_buff *skb); | 1312 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); |
1302 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg); | ||
1303 | 1313 | ||
1304 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 1314 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
1305 | int len, void *buffer) | 1315 | int len, void *buffer) |
@@ -1445,5 +1455,10 @@ static inline void skb_init_secmark(struct sk_buff *skb) | |||
1445 | { } | 1455 | { } |
1446 | #endif | 1456 | #endif |
1447 | 1457 | ||
1458 | static inline int skb_is_gso(const struct sk_buff *skb) | ||
1459 | { | ||
1460 | return skb_shinfo(skb)->gso_size; | ||
1461 | } | ||
1462 | |||
1448 | #endif /* __KERNEL__ */ | 1463 | #endif /* __KERNEL__ */ |
1449 | #endif /* _LINUX_SKBUFF_H */ | 1464 | #endif /* _LINUX_SKBUFF_H */ |
diff --git a/include/linux/smp.h b/include/linux/smp.h index c93c3fe4308c..837e8bce1349 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -125,4 +125,6 @@ static inline void smp_send_reschedule(int cpu) { } | |||
125 | #define put_cpu() preempt_enable() | 125 | #define put_cpu() preempt_enable() |
126 | #define put_cpu_no_resched() preempt_enable_no_resched() | 126 | #define put_cpu_no_resched() preempt_enable_no_resched() |
127 | 127 | ||
128 | void smp_setup_processor_id(void); | ||
129 | |||
128 | #endif /* __LINUX_SMP_H */ | 130 | #endif /* __LINUX_SMP_H */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index e928c0dcc297..c8bb68099eb9 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -642,10 +642,14 @@ struct spi_board_info { | |||
642 | u16 bus_num; | 642 | u16 bus_num; |
643 | u16 chip_select; | 643 | u16 chip_select; |
644 | 644 | ||
645 | /* mode becomes spi_device.mode, and is essential for chips | ||
646 | * where the default of SPI_CS_HIGH = 0 is wrong. | ||
647 | */ | ||
648 | u8 mode; | ||
649 | |||
645 | /* ... may need additional spi_device chip config data here. | 650 | /* ... may need additional spi_device chip config data here. |
646 | * avoid stuff protocol drivers can set; but include stuff | 651 | * avoid stuff protocol drivers can set; but include stuff |
647 | * needed to behave without being bound to a driver: | 652 | * needed to behave without being bound to a driver: |
648 | * - chipselect polarity | ||
649 | * - quirks like clock rate mattering when not selected | 653 | * - quirks like clock rate mattering when not selected |
650 | */ | 654 | */ |
651 | }; | 655 | }; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index ae23beef9cc9..31473db92d3b 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -82,14 +82,40 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | |||
82 | /* | 82 | /* |
83 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): | 83 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): |
84 | */ | 84 | */ |
85 | #if defined(CONFIG_SMP) | 85 | #ifdef CONFIG_SMP |
86 | # include <asm/spinlock.h> | 86 | # include <asm/spinlock.h> |
87 | #else | 87 | #else |
88 | # include <linux/spinlock_up.h> | 88 | # include <linux/spinlock_up.h> |
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | #define spin_lock_init(lock) do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) | 91 | #ifdef CONFIG_DEBUG_SPINLOCK |
92 | #define rwlock_init(lock) do { *(lock) = RW_LOCK_UNLOCKED; } while (0) | 92 | extern void __spin_lock_init(spinlock_t *lock, const char *name, |
93 | struct lock_class_key *key); | ||
94 | # define spin_lock_init(lock) \ | ||
95 | do { \ | ||
96 | static struct lock_class_key __key; \ | ||
97 | \ | ||
98 | __spin_lock_init((lock), #lock, &__key); \ | ||
99 | } while (0) | ||
100 | |||
101 | #else | ||
102 | # define spin_lock_init(lock) \ | ||
103 | do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) | ||
104 | #endif | ||
105 | |||
106 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
107 | extern void __rwlock_init(rwlock_t *lock, const char *name, | ||
108 | struct lock_class_key *key); | ||
109 | # define rwlock_init(lock) \ | ||
110 | do { \ | ||
111 | static struct lock_class_key __key; \ | ||
112 | \ | ||
113 | __rwlock_init((lock), #lock, &__key); \ | ||
114 | } while (0) | ||
115 | #else | ||
116 | # define rwlock_init(lock) \ | ||
117 | do { *(lock) = RW_LOCK_UNLOCKED; } while (0) | ||
118 | #endif | ||
93 | 119 | ||
94 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) | 120 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) |
95 | 121 | ||
@@ -113,7 +139,6 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | |||
113 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) | 139 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) |
114 | extern int _raw_spin_trylock(spinlock_t *lock); | 140 | extern int _raw_spin_trylock(spinlock_t *lock); |
115 | extern void _raw_spin_unlock(spinlock_t *lock); | 141 | extern void _raw_spin_unlock(spinlock_t *lock); |
116 | |||
117 | extern void _raw_read_lock(rwlock_t *lock); | 142 | extern void _raw_read_lock(rwlock_t *lock); |
118 | extern int _raw_read_trylock(rwlock_t *lock); | 143 | extern int _raw_read_trylock(rwlock_t *lock); |
119 | extern void _raw_read_unlock(rwlock_t *lock); | 144 | extern void _raw_read_unlock(rwlock_t *lock); |
@@ -121,17 +146,17 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | |||
121 | extern int _raw_write_trylock(rwlock_t *lock); | 146 | extern int _raw_write_trylock(rwlock_t *lock); |
122 | extern void _raw_write_unlock(rwlock_t *lock); | 147 | extern void _raw_write_unlock(rwlock_t *lock); |
123 | #else | 148 | #else |
124 | # define _raw_spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) | ||
125 | # define _raw_spin_trylock(lock) __raw_spin_trylock(&(lock)->raw_lock) | ||
126 | # define _raw_spin_lock(lock) __raw_spin_lock(&(lock)->raw_lock) | 149 | # define _raw_spin_lock(lock) __raw_spin_lock(&(lock)->raw_lock) |
127 | # define _raw_spin_lock_flags(lock, flags) \ | 150 | # define _raw_spin_lock_flags(lock, flags) \ |
128 | __raw_spin_lock_flags(&(lock)->raw_lock, *(flags)) | 151 | __raw_spin_lock_flags(&(lock)->raw_lock, *(flags)) |
152 | # define _raw_spin_trylock(lock) __raw_spin_trylock(&(lock)->raw_lock) | ||
153 | # define _raw_spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) | ||
129 | # define _raw_read_lock(rwlock) __raw_read_lock(&(rwlock)->raw_lock) | 154 | # define _raw_read_lock(rwlock) __raw_read_lock(&(rwlock)->raw_lock) |
130 | # define _raw_write_lock(rwlock) __raw_write_lock(&(rwlock)->raw_lock) | ||
131 | # define _raw_read_unlock(rwlock) __raw_read_unlock(&(rwlock)->raw_lock) | ||
132 | # define _raw_write_unlock(rwlock) __raw_write_unlock(&(rwlock)->raw_lock) | ||
133 | # define _raw_read_trylock(rwlock) __raw_read_trylock(&(rwlock)->raw_lock) | 155 | # define _raw_read_trylock(rwlock) __raw_read_trylock(&(rwlock)->raw_lock) |
156 | # define _raw_read_unlock(rwlock) __raw_read_unlock(&(rwlock)->raw_lock) | ||
157 | # define _raw_write_lock(rwlock) __raw_write_lock(&(rwlock)->raw_lock) | ||
134 | # define _raw_write_trylock(rwlock) __raw_write_trylock(&(rwlock)->raw_lock) | 158 | # define _raw_write_trylock(rwlock) __raw_write_trylock(&(rwlock)->raw_lock) |
159 | # define _raw_write_unlock(rwlock) __raw_write_unlock(&(rwlock)->raw_lock) | ||
135 | #endif | 160 | #endif |
136 | 161 | ||
137 | #define read_can_lock(rwlock) __raw_read_can_lock(&(rwlock)->raw_lock) | 162 | #define read_can_lock(rwlock) __raw_read_can_lock(&(rwlock)->raw_lock) |
@@ -147,6 +172,13 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | |||
147 | #define write_trylock(lock) __cond_lock(_write_trylock(lock)) | 172 | #define write_trylock(lock) __cond_lock(_write_trylock(lock)) |
148 | 173 | ||
149 | #define spin_lock(lock) _spin_lock(lock) | 174 | #define spin_lock(lock) _spin_lock(lock) |
175 | |||
176 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
177 | # define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass) | ||
178 | #else | ||
179 | # define spin_lock_nested(lock, subclass) _spin_lock(lock) | ||
180 | #endif | ||
181 | |||
150 | #define write_lock(lock) _write_lock(lock) | 182 | #define write_lock(lock) _write_lock(lock) |
151 | #define read_lock(lock) _read_lock(lock) | 183 | #define read_lock(lock) _read_lock(lock) |
152 | 184 | ||
@@ -172,21 +204,18 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | |||
172 | /* | 204 | /* |
173 | * We inline the unlock functions in the nondebug case: | 205 | * We inline the unlock functions in the nondebug case: |
174 | */ | 206 | */ |
175 | #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP) | 207 | #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || \ |
208 | !defined(CONFIG_SMP) | ||
176 | # define spin_unlock(lock) _spin_unlock(lock) | 209 | # define spin_unlock(lock) _spin_unlock(lock) |
177 | # define read_unlock(lock) _read_unlock(lock) | 210 | # define read_unlock(lock) _read_unlock(lock) |
178 | # define write_unlock(lock) _write_unlock(lock) | 211 | # define write_unlock(lock) _write_unlock(lock) |
179 | #else | ||
180 | # define spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) | ||
181 | # define read_unlock(lock) __raw_read_unlock(&(lock)->raw_lock) | ||
182 | # define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock) | ||
183 | #endif | ||
184 | |||
185 | #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP) | ||
186 | # define spin_unlock_irq(lock) _spin_unlock_irq(lock) | 212 | # define spin_unlock_irq(lock) _spin_unlock_irq(lock) |
187 | # define read_unlock_irq(lock) _read_unlock_irq(lock) | 213 | # define read_unlock_irq(lock) _read_unlock_irq(lock) |
188 | # define write_unlock_irq(lock) _write_unlock_irq(lock) | 214 | # define write_unlock_irq(lock) _write_unlock_irq(lock) |
189 | #else | 215 | #else |
216 | # define spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) | ||
217 | # define read_unlock(lock) __raw_read_unlock(&(lock)->raw_lock) | ||
218 | # define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock) | ||
190 | # define spin_unlock_irq(lock) \ | 219 | # define spin_unlock_irq(lock) \ |
191 | do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) | 220 | do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) |
192 | # define read_unlock_irq(lock) \ | 221 | # define read_unlock_irq(lock) \ |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 78e6989ffb54..b2c4f8299464 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -20,6 +20,8 @@ int in_lock_functions(unsigned long addr); | |||
20 | #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) | 20 | #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) |
21 | 21 | ||
22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(spinlock_t); | 22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(spinlock_t); |
23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | ||
24 | __acquires(spinlock_t); | ||
23 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(rwlock_t); | 25 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(rwlock_t); |
24 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(rwlock_t); | 26 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(rwlock_t); |
25 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(spinlock_t); | 27 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(spinlock_t); |
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index cd81cee566f4..67faa044c5f5 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
@@ -49,6 +49,7 @@ | |||
49 | do { local_irq_restore(flags); __UNLOCK(lock); } while (0) | 49 | do { local_irq_restore(flags); __UNLOCK(lock); } while (0) |
50 | 50 | ||
51 | #define _spin_lock(lock) __LOCK(lock) | 51 | #define _spin_lock(lock) __LOCK(lock) |
52 | #define _spin_lock_nested(lock, subclass) __LOCK(lock) | ||
52 | #define _read_lock(lock) __LOCK(lock) | 53 | #define _read_lock(lock) __LOCK(lock) |
53 | #define _write_lock(lock) __LOCK(lock) | 54 | #define _write_lock(lock) __LOCK(lock) |
54 | #define _spin_lock_bh(lock) __LOCK_BH(lock) | 55 | #define _spin_lock_bh(lock) __LOCK_BH(lock) |
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h index 9cb51e070390..dc5fb69e4de9 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h | |||
@@ -9,6 +9,8 @@ | |||
9 | * Released under the General Public License (GPL). | 9 | * Released under the General Public License (GPL). |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/lockdep.h> | ||
13 | |||
12 | #if defined(CONFIG_SMP) | 14 | #if defined(CONFIG_SMP) |
13 | # include <asm/spinlock_types.h> | 15 | # include <asm/spinlock_types.h> |
14 | #else | 16 | #else |
@@ -24,6 +26,9 @@ typedef struct { | |||
24 | unsigned int magic, owner_cpu; | 26 | unsigned int magic, owner_cpu; |
25 | void *owner; | 27 | void *owner; |
26 | #endif | 28 | #endif |
29 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
30 | struct lockdep_map dep_map; | ||
31 | #endif | ||
27 | } spinlock_t; | 32 | } spinlock_t; |
28 | 33 | ||
29 | #define SPINLOCK_MAGIC 0xdead4ead | 34 | #define SPINLOCK_MAGIC 0xdead4ead |
@@ -37,31 +42,53 @@ typedef struct { | |||
37 | unsigned int magic, owner_cpu; | 42 | unsigned int magic, owner_cpu; |
38 | void *owner; | 43 | void *owner; |
39 | #endif | 44 | #endif |
45 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
46 | struct lockdep_map dep_map; | ||
47 | #endif | ||
40 | } rwlock_t; | 48 | } rwlock_t; |
41 | 49 | ||
42 | #define RWLOCK_MAGIC 0xdeaf1eed | 50 | #define RWLOCK_MAGIC 0xdeaf1eed |
43 | 51 | ||
44 | #define SPINLOCK_OWNER_INIT ((void *)-1L) | 52 | #define SPINLOCK_OWNER_INIT ((void *)-1L) |
45 | 53 | ||
54 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
55 | # define SPIN_DEP_MAP_INIT(lockname) .dep_map = { .name = #lockname } | ||
56 | #else | ||
57 | # define SPIN_DEP_MAP_INIT(lockname) | ||
58 | #endif | ||
59 | |||
60 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
61 | # define RW_DEP_MAP_INIT(lockname) .dep_map = { .name = #lockname } | ||
62 | #else | ||
63 | # define RW_DEP_MAP_INIT(lockname) | ||
64 | #endif | ||
65 | |||
46 | #ifdef CONFIG_DEBUG_SPINLOCK | 66 | #ifdef CONFIG_DEBUG_SPINLOCK |
47 | # define SPIN_LOCK_UNLOCKED \ | 67 | # define __SPIN_LOCK_UNLOCKED(lockname) \ |
48 | (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ | 68 | (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ |
49 | .magic = SPINLOCK_MAGIC, \ | 69 | .magic = SPINLOCK_MAGIC, \ |
50 | .owner = SPINLOCK_OWNER_INIT, \ | 70 | .owner = SPINLOCK_OWNER_INIT, \ |
51 | .owner_cpu = -1 } | 71 | .owner_cpu = -1, \ |
52 | #define RW_LOCK_UNLOCKED \ | 72 | SPIN_DEP_MAP_INIT(lockname) } |
73 | #define __RW_LOCK_UNLOCKED(lockname) \ | ||
53 | (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ | 74 | (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ |
54 | .magic = RWLOCK_MAGIC, \ | 75 | .magic = RWLOCK_MAGIC, \ |
55 | .owner = SPINLOCK_OWNER_INIT, \ | 76 | .owner = SPINLOCK_OWNER_INIT, \ |
56 | .owner_cpu = -1 } | 77 | .owner_cpu = -1, \ |
78 | RW_DEP_MAP_INIT(lockname) } | ||
57 | #else | 79 | #else |
58 | # define SPIN_LOCK_UNLOCKED \ | 80 | # define __SPIN_LOCK_UNLOCKED(lockname) \ |
59 | (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED } | 81 | (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ |
60 | #define RW_LOCK_UNLOCKED \ | 82 | SPIN_DEP_MAP_INIT(lockname) } |
61 | (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED } | 83 | #define __RW_LOCK_UNLOCKED(lockname) \ |
84 | (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ | ||
85 | RW_DEP_MAP_INIT(lockname) } | ||
62 | #endif | 86 | #endif |
63 | 87 | ||
64 | #define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED | 88 | #define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) |
65 | #define DEFINE_RWLOCK(x) rwlock_t x = RW_LOCK_UNLOCKED | 89 | #define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) |
90 | |||
91 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | ||
92 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) | ||
66 | 93 | ||
67 | #endif /* __LINUX_SPINLOCK_TYPES_H */ | 94 | #endif /* __LINUX_SPINLOCK_TYPES_H */ |
diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h index 04135b0e198e..27644af20b7c 100644 --- a/include/linux/spinlock_types_up.h +++ b/include/linux/spinlock_types_up.h | |||
@@ -12,10 +12,14 @@ | |||
12 | * Released under the General Public License (GPL). | 12 | * Released under the General Public License (GPL). |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifdef CONFIG_DEBUG_SPINLOCK | 15 | #if defined(CONFIG_DEBUG_SPINLOCK) || \ |
16 | defined(CONFIG_DEBUG_LOCK_ALLOC) | ||
16 | 17 | ||
17 | typedef struct { | 18 | typedef struct { |
18 | volatile unsigned int slock; | 19 | volatile unsigned int slock; |
20 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
21 | struct lockdep_map dep_map; | ||
22 | #endif | ||
19 | } raw_spinlock_t; | 23 | } raw_spinlock_t; |
20 | 24 | ||
21 | #define __RAW_SPIN_LOCK_UNLOCKED { 1 } | 25 | #define __RAW_SPIN_LOCK_UNLOCKED { 1 } |
@@ -30,6 +34,9 @@ typedef struct { } raw_spinlock_t; | |||
30 | 34 | ||
31 | typedef struct { | 35 | typedef struct { |
32 | /* no debug version on UP */ | 36 | /* no debug version on UP */ |
37 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
38 | struct lockdep_map dep_map; | ||
39 | #endif | ||
33 | } raw_rwlock_t; | 40 | } raw_rwlock_t; |
34 | 41 | ||
35 | #define __RAW_RW_LOCK_UNLOCKED { } | 42 | #define __RAW_RW_LOCK_UNLOCKED { } |
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index 31accf2f0b13..ea54c4c9a4ec 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h | |||
@@ -18,7 +18,6 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifdef CONFIG_DEBUG_SPINLOCK | 20 | #ifdef CONFIG_DEBUG_SPINLOCK |
21 | |||
22 | #define __raw_spin_is_locked(x) ((x)->slock == 0) | 21 | #define __raw_spin_is_locked(x) ((x)->slock == 0) |
23 | 22 | ||
24 | static inline void __raw_spin_lock(raw_spinlock_t *lock) | 23 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h new file mode 100644 index 000000000000..9cc81e572224 --- /dev/null +++ b/include/linux/stacktrace.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __LINUX_STACKTRACE_H | ||
2 | #define __LINUX_STACKTRACE_H | ||
3 | |||
4 | #ifdef CONFIG_STACKTRACE | ||
5 | struct stack_trace { | ||
6 | unsigned int nr_entries, max_entries; | ||
7 | unsigned long *entries; | ||
8 | }; | ||
9 | |||
10 | extern void save_stack_trace(struct stack_trace *trace, | ||
11 | struct task_struct *task, int all_contexts, | ||
12 | unsigned int skip); | ||
13 | |||
14 | extern void print_stack_trace(struct stack_trace *trace, int spaces); | ||
15 | #else | ||
16 | # define save_stack_trace(trace, task, all, skip) do { } while (0) | ||
17 | # define print_stack_trace(trace) do { } while (0) | ||
18 | #endif | ||
19 | |||
20 | #endif | ||
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild new file mode 100644 index 000000000000..0d1d768a27bf --- /dev/null +++ b/include/linux/sunrpc/Kbuild | |||
@@ -0,0 +1 @@ | |||
unifdef-y := debug.h | |||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 503564384545..7b27c09b5604 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -159,7 +159,9 @@ struct svc_rqst { | |||
159 | * determine what device number | 159 | * determine what device number |
160 | * to report (real or virtual) | 160 | * to report (real or virtual) |
161 | */ | 161 | */ |
162 | 162 | int rq_sendfile_ok; /* turned off in gss privacy | |
163 | * to prevent encrypting page | ||
164 | * cache pages */ | ||
163 | wait_queue_head_t rq_wait; /* synchronization */ | 165 | wait_queue_head_t rq_wait; /* synchronization */ |
164 | }; | 166 | }; |
165 | 167 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index c41e2d6d1acc..5e59184c9096 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -189,7 +189,7 @@ extern long vm_total_pages; | |||
189 | 189 | ||
190 | #ifdef CONFIG_NUMA | 190 | #ifdef CONFIG_NUMA |
191 | extern int zone_reclaim_mode; | 191 | extern int zone_reclaim_mode; |
192 | extern int zone_reclaim_interval; | 192 | extern int sysctl_min_unmapped_ratio; |
193 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); | 193 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); |
194 | #else | 194 | #else |
195 | #define zone_reclaim_mode 0 | 195 | #define zone_reclaim_mode 0 |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 46e4d8f2771f..e4b1a4d4dcf3 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -188,7 +188,7 @@ enum | |||
188 | VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */ | 188 | VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */ |
189 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ | 189 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ |
190 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ | 190 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ |
191 | VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ | 191 | VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */ |
192 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ | 192 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ |
193 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ | 193 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ |
194 | }; | 194 | }; |
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild new file mode 100644 index 000000000000..5251a505b2f1 --- /dev/null +++ b/include/linux/tc_act/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y += tc_gact.h tc_ipt.h tc_mirred.h tc_pedit.h | |||
diff --git a/include/linux/tc_ematch/Kbuild b/include/linux/tc_ematch/Kbuild new file mode 100644 index 000000000000..381e93018df6 --- /dev/null +++ b/include/linux/tc_ematch/Kbuild | |||
@@ -0,0 +1 @@ | |||
headers-y := tc_em_cmp.h tc_em_meta.h tc_em_nbyte.h tc_em_text.h | |||
diff --git a/include/linux/tty.h b/include/linux/tty.h index cb35ca50a0a6..e421d5e34818 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -5,16 +5,6 @@ | |||
5 | * 'tty.h' defines some structures used by tty_io.c and some defines. | 5 | * 'tty.h' defines some structures used by tty_io.c and some defines. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* | ||
9 | * These constants are also useful for user-level apps (e.g., VC | ||
10 | * resizing). | ||
11 | */ | ||
12 | #define MIN_NR_CONSOLES 1 /* must be at least 1 */ | ||
13 | #define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ | ||
14 | #define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */ | ||
15 | /* Note: the ioctl VT_GETSTATE does not work for | ||
16 | consoles 16 and higher (since it returns a short) */ | ||
17 | |||
18 | #ifdef __KERNEL__ | 8 | #ifdef __KERNEL__ |
19 | #include <linux/fs.h> | 9 | #include <linux/fs.h> |
20 | #include <linux/major.h> | 10 | #include <linux/major.h> |
@@ -22,7 +12,6 @@ | |||
22 | #include <linux/workqueue.h> | 12 | #include <linux/workqueue.h> |
23 | #include <linux/tty_driver.h> | 13 | #include <linux/tty_driver.h> |
24 | #include <linux/tty_ldisc.h> | 14 | #include <linux/tty_ldisc.h> |
25 | #include <linux/screen_info.h> | ||
26 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
27 | 16 | ||
28 | #include <asm/system.h> | 17 | #include <asm/system.h> |
@@ -57,7 +46,6 @@ struct tty_buffer { | |||
57 | unsigned char *flag_buf_ptr; | 46 | unsigned char *flag_buf_ptr; |
58 | int used; | 47 | int used; |
59 | int size; | 48 | int size; |
60 | int active; | ||
61 | int commit; | 49 | int commit; |
62 | int read; | 50 | int read; |
63 | /* Data points here */ | 51 | /* Data points here */ |
@@ -259,7 +247,6 @@ struct tty_struct { | |||
259 | #define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ | 247 | #define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ |
260 | #define TTY_PUSH 6 /* n_tty private */ | 248 | #define TTY_PUSH 6 /* n_tty private */ |
261 | #define TTY_CLOSING 7 /* ->close() in progress */ | 249 | #define TTY_CLOSING 7 /* ->close() in progress */ |
262 | #define TTY_DONT_FLIP 8 /* Defer buffer flip */ | ||
263 | #define TTY_LDISC 9 /* Line discipline attached */ | 250 | #define TTY_LDISC 9 /* Line discipline attached */ |
264 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ | 251 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ |
265 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ | 252 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ |
@@ -272,7 +259,6 @@ struct tty_struct { | |||
272 | extern void tty_write_flush(struct tty_struct *); | 259 | extern void tty_write_flush(struct tty_struct *); |
273 | 260 | ||
274 | extern struct termios tty_std_termios; | 261 | extern struct termios tty_std_termios; |
275 | extern int fg_console, last_console, want_console; | ||
276 | 262 | ||
277 | extern int kmsg_redirect; | 263 | extern int kmsg_redirect; |
278 | 264 | ||
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index b368b296d035..58c961c9e170 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -157,7 +157,6 @@ struct tty_driver { | |||
157 | struct cdev cdev; | 157 | struct cdev cdev; |
158 | struct module *owner; | 158 | struct module *owner; |
159 | const char *driver_name; | 159 | const char *driver_name; |
160 | const char *devfs_name; | ||
161 | const char *name; | 160 | const char *name; |
162 | int name_base; /* offset of printed name */ | 161 | int name_base; /* offset of printed name */ |
163 | int major; /* major device number */ | 162 | int major; /* major device number */ |
@@ -242,8 +241,15 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op); | |||
242 | * is also a promise, if the above case is true, not to signal | 241 | * is also a promise, if the above case is true, not to signal |
243 | * overruns, either.) | 242 | * overruns, either.) |
244 | * | 243 | * |
245 | * TTY_DRIVER_NO_DEVFS --- if set, do not create devfs entries. This | 244 | * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need |
246 | * is only used by tty_register_driver(). | 245 | * to be registered with a call to tty_register_driver() when the |
246 | * device is found in the system and unregistered with a call to | ||
247 | * tty_unregister_device() so the devices will be show up | ||
248 | * properly in sysfs. If not set, driver->num entries will be | ||
249 | * created by the tty core in sysfs when tty_register_driver() is | ||
250 | * called. This is to be used by drivers that have tty devices | ||
251 | * that can appear and disappear while the main tty driver is | ||
252 | * registered with the tty core. | ||
247 | * | 253 | * |
248 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead | 254 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead |
249 | * use dynamic memory keyed through the devpts filesystem. This | 255 | * use dynamic memory keyed through the devpts filesystem. This |
@@ -252,7 +258,7 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op); | |||
252 | #define TTY_DRIVER_INSTALLED 0x0001 | 258 | #define TTY_DRIVER_INSTALLED 0x0001 |
253 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 | 259 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 |
254 | #define TTY_DRIVER_REAL_RAW 0x0004 | 260 | #define TTY_DRIVER_REAL_RAW 0x0004 |
255 | #define TTY_DRIVER_NO_DEVFS 0x0008 | 261 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 |
256 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 | 262 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 |
257 | 263 | ||
258 | /* tty driver types */ | 264 | /* tty driver types */ |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 31548303ee37..eb677cf56106 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -12,7 +12,7 @@ static inline int tty_insert_flip_char(struct tty_struct *tty, | |||
12 | unsigned char ch, char flag) | 12 | unsigned char ch, char flag) |
13 | { | 13 | { |
14 | struct tty_buffer *tb = tty->buf.tail; | 14 | struct tty_buffer *tb = tty->buf.tail; |
15 | if (tb && tb->active && tb->used < tb->size) { | 15 | if (tb && tb->used < tb->size) { |
16 | tb->flag_buf_ptr[tb->used] = flag; | 16 | tb->flag_buf_ptr[tb->used] = flag; |
17 | tb->char_buf_ptr[tb->used++] = ch; | 17 | tb->char_buf_ptr[tb->used++] = ch; |
18 | return 1; | 18 | return 1; |
diff --git a/include/linux/types.h b/include/linux/types.h index a5e46e783ffa..3f235660a3cd 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -177,8 +177,15 @@ typedef __u64 __bitwise __be64; | |||
177 | 177 | ||
178 | #ifdef __KERNEL__ | 178 | #ifdef __KERNEL__ |
179 | typedef unsigned __bitwise__ gfp_t; | 179 | typedef unsigned __bitwise__ gfp_t; |
180 | |||
181 | #ifdef CONFIG_RESOURCES_64BIT | ||
182 | typedef u64 resource_size_t; | ||
183 | #else | ||
184 | typedef u32 resource_size_t; | ||
180 | #endif | 185 | #endif |
181 | 186 | ||
187 | #endif /* __KERNEL__ */ | ||
188 | |||
182 | struct ustat { | 189 | struct ustat { |
183 | __kernel_daddr_t f_tfree; | 190 | __kernel_daddr_t f_tfree; |
184 | __kernel_ino_t f_tinode; | 191 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/udp.h b/include/linux/udp.h index bdd39be09406..90223f057d50 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -46,7 +46,7 @@ struct udp_sock { | |||
46 | unsigned int corkflag; /* Cork is required */ | 46 | unsigned int corkflag; /* Cork is required */ |
47 | __u16 encap_type; /* Is this an Encapsulation socket? */ | 47 | __u16 encap_type; /* Is this an Encapsulation socket? */ |
48 | /* | 48 | /* |
49 | * Following member retains the infomation to create a UDP header | 49 | * Following member retains the information to create a UDP header |
50 | * when the socket is uncorked. | 50 | * when the socket is uncorked. |
51 | */ | 51 | */ |
52 | __u16 len; /* total length of pending frames */ | 52 | __u16 len; /* total length of pending frames */ |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 914f911325be..fc62887c5206 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -966,7 +966,7 @@ extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, | |||
966 | extern struct inode_operations ufs_file_inode_operations; | 966 | extern struct inode_operations ufs_file_inode_operations; |
967 | extern const struct file_operations ufs_file_operations; | 967 | extern const struct file_operations ufs_file_operations; |
968 | 968 | ||
969 | extern struct address_space_operations ufs_aops; | 969 | extern const struct address_space_operations ufs_aops; |
970 | 970 | ||
971 | /* ialloc.c */ | 971 | /* ialloc.c */ |
972 | extern void ufs_free_inode (struct inode *inode); | 972 | extern void ufs_free_inode (struct inode *inode); |
@@ -993,7 +993,7 @@ extern void ufs_panic (struct super_block *, const char *, const char *, ...) __ | |||
993 | extern struct inode_operations ufs_fast_symlink_inode_operations; | 993 | extern struct inode_operations ufs_fast_symlink_inode_operations; |
994 | 994 | ||
995 | /* truncate.c */ | 995 | /* truncate.c */ |
996 | extern void ufs_truncate (struct inode *); | 996 | extern int ufs_truncate (struct inode *, loff_t); |
997 | 997 | ||
998 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) | 998 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) |
999 | { | 999 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 8dead32e7ebf..c944e8f06a4a 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -48,7 +48,7 @@ struct ep_device; | |||
48 | * @urb_list: urbs queued to this endpoint; maintained by usbcore | 48 | * @urb_list: urbs queued to this endpoint; maintained by usbcore |
49 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) | 49 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) |
50 | * with one or more transfer descriptors (TDs) per urb | 50 | * with one or more transfer descriptors (TDs) per urb |
51 | * @kobj: kobject for sysfs info | 51 | * @ep_dev: ep_device for sysfs info |
52 | * @extra: descriptors following this endpoint in the configuration | 52 | * @extra: descriptors following this endpoint in the configuration |
53 | * @extralen: how many bytes of "extra" are valid | 53 | * @extralen: how many bytes of "extra" are valid |
54 | * | 54 | * |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h new file mode 100644 index 000000000000..91c983eef899 --- /dev/null +++ b/include/linux/usb/serial.h | |||
@@ -0,0 +1,300 @@ | |||
1 | /* | ||
2 | * USB Serial Converter stuff | ||
3 | * | ||
4 | * Copyright (C) 1999 - 2005 | ||
5 | * Greg Kroah-Hartman (greg@kroah.com) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; version 2 of the License. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | |||
14 | #ifndef __LINUX_USB_SERIAL_H | ||
15 | #define __LINUX_USB_SERIAL_H | ||
16 | |||
17 | #include <linux/kref.h> | ||
18 | #include <linux/mutex.h> | ||
19 | |||
20 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | ||
21 | #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ | ||
22 | |||
23 | #define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */ | ||
24 | |||
25 | /* parity check flag */ | ||
26 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | ||
27 | |||
28 | /** | ||
29 | * usb_serial_port: structure for the specific ports of a device. | ||
30 | * @serial: pointer back to the struct usb_serial owner of this port. | ||
31 | * @tty: pointer to the corresponding tty for this port. | ||
32 | * @lock: spinlock to grab when updating portions of this structure. | ||
33 | * @mutex: mutex used to synchronize serial_open() and serial_close() | ||
34 | * access for this port. | ||
35 | * @number: the number of the port (the minor number). | ||
36 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. | ||
37 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. | ||
38 | * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe | ||
39 | * for this port. | ||
40 | * @interrupt_out_buffer: pointer to the interrupt out buffer for this port. | ||
41 | * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes. | ||
42 | * @interrupt_out_urb: pointer to the interrupt out struct urb for this port. | ||
43 | * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe | ||
44 | * for this port. | ||
45 | * @bulk_in_buffer: pointer to the bulk in buffer for this port. | ||
46 | * @read_urb: pointer to the bulk in struct urb for this port. | ||
47 | * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this | ||
48 | * port. | ||
49 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. | ||
50 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. | ||
51 | * @write_urb: pointer to the bulk out struct urb for this port. | ||
52 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | ||
53 | * port. | ||
54 | * @write_wait: a wait_queue_head_t used by the port. | ||
55 | * @work: work queue entry for the line discipline waking up. | ||
56 | * @open_count: number of times this port has been opened. | ||
57 | * | ||
58 | * This structure is used by the usb-serial core and drivers for the specific | ||
59 | * ports of a device. | ||
60 | */ | ||
61 | struct usb_serial_port { | ||
62 | struct usb_serial * serial; | ||
63 | struct tty_struct * tty; | ||
64 | spinlock_t lock; | ||
65 | struct mutex mutex; | ||
66 | unsigned char number; | ||
67 | |||
68 | unsigned char * interrupt_in_buffer; | ||
69 | struct urb * interrupt_in_urb; | ||
70 | __u8 interrupt_in_endpointAddress; | ||
71 | |||
72 | unsigned char * interrupt_out_buffer; | ||
73 | int interrupt_out_size; | ||
74 | struct urb * interrupt_out_urb; | ||
75 | __u8 interrupt_out_endpointAddress; | ||
76 | |||
77 | unsigned char * bulk_in_buffer; | ||
78 | int bulk_in_size; | ||
79 | struct urb * read_urb; | ||
80 | __u8 bulk_in_endpointAddress; | ||
81 | |||
82 | unsigned char * bulk_out_buffer; | ||
83 | int bulk_out_size; | ||
84 | struct urb * write_urb; | ||
85 | int write_urb_busy; | ||
86 | __u8 bulk_out_endpointAddress; | ||
87 | |||
88 | wait_queue_head_t write_wait; | ||
89 | struct work_struct work; | ||
90 | int open_count; | ||
91 | struct device dev; | ||
92 | }; | ||
93 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) | ||
94 | |||
95 | /* get and set the port private data pointer helper functions */ | ||
96 | static inline void *usb_get_serial_port_data (struct usb_serial_port *port) | ||
97 | { | ||
98 | return dev_get_drvdata(&port->dev); | ||
99 | } | ||
100 | |||
101 | static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data) | ||
102 | { | ||
103 | dev_set_drvdata(&port->dev, data); | ||
104 | } | ||
105 | |||
106 | /** | ||
107 | * usb_serial - structure used by the usb-serial core for a device | ||
108 | * @dev: pointer to the struct usb_device for this device | ||
109 | * @type: pointer to the struct usb_serial_driver for this device | ||
110 | * @interface: pointer to the struct usb_interface for this device | ||
111 | * @minor: the starting minor number for this device | ||
112 | * @num_ports: the number of ports this device has | ||
113 | * @num_interrupt_in: number of interrupt in endpoints we have | ||
114 | * @num_interrupt_out: number of interrupt out endpoints we have | ||
115 | * @num_bulk_in: number of bulk in endpoints we have | ||
116 | * @num_bulk_out: number of bulk out endpoints we have | ||
117 | * @port: array of struct usb_serial_port structures for the different ports. | ||
118 | * @private: place to put any driver specific information that is needed. The | ||
119 | * usb-serial driver is required to manage this data, the usb-serial core | ||
120 | * will not touch this. Use usb_get_serial_data() and | ||
121 | * usb_set_serial_data() to access this. | ||
122 | */ | ||
123 | struct usb_serial { | ||
124 | struct usb_device * dev; | ||
125 | struct usb_serial_driver * type; | ||
126 | struct usb_interface * interface; | ||
127 | unsigned char minor; | ||
128 | unsigned char num_ports; | ||
129 | unsigned char num_port_pointers; | ||
130 | char num_interrupt_in; | ||
131 | char num_interrupt_out; | ||
132 | char num_bulk_in; | ||
133 | char num_bulk_out; | ||
134 | struct usb_serial_port * port[MAX_NUM_PORTS]; | ||
135 | struct kref kref; | ||
136 | void * private; | ||
137 | }; | ||
138 | #define to_usb_serial(d) container_of(d, struct usb_serial, kref) | ||
139 | |||
140 | #define NUM_DONT_CARE (-1) | ||
141 | |||
142 | /* get and set the serial private data pointer helper functions */ | ||
143 | static inline void *usb_get_serial_data (struct usb_serial *serial) | ||
144 | { | ||
145 | return serial->private; | ||
146 | } | ||
147 | |||
148 | static inline void usb_set_serial_data (struct usb_serial *serial, void *data) | ||
149 | { | ||
150 | serial->private = data; | ||
151 | } | ||
152 | |||
153 | /** | ||
154 | * usb_serial_driver - describes a usb serial driver | ||
155 | * @description: pointer to a string that describes this driver. This string used | ||
156 | * in the syslog messages when a device is inserted or removed. | ||
157 | * @id_table: pointer to a list of usb_device_id structures that define all | ||
158 | * of the devices this structure can support. | ||
159 | * @num_interrupt_in: the number of interrupt in endpoints this device will | ||
160 | * have. | ||
161 | * @num_interrupt_out: the number of interrupt out endpoints this device will | ||
162 | * have. | ||
163 | * @num_bulk_in: the number of bulk in endpoints this device will have. | ||
164 | * @num_bulk_out: the number of bulk out endpoints this device will have. | ||
165 | * @num_ports: the number of different ports this device will have. | ||
166 | * @calc_num_ports: pointer to a function to determine how many ports this | ||
167 | * device has dynamically. It will be called after the probe() | ||
168 | * callback is called, but before attach() | ||
169 | * @probe: pointer to the driver's probe function. | ||
170 | * This will be called when the device is inserted into the system, | ||
171 | * but before the device has been fully initialized by the usb_serial | ||
172 | * subsystem. Use this function to download any firmware to the device, | ||
173 | * or any other early initialization that might be needed. | ||
174 | * Return 0 to continue on with the initialization sequence. Anything | ||
175 | * else will abort it. | ||
176 | * @attach: pointer to the driver's attach function. | ||
177 | * This will be called when the struct usb_serial structure is fully set | ||
178 | * set up. Do any local initialization of the device, or any private | ||
179 | * memory structure allocation at this point in time. | ||
180 | * @shutdown: pointer to the driver's shutdown function. This will be | ||
181 | * called when the device is removed from the system. | ||
182 | * | ||
183 | * This structure is defines a USB Serial driver. It provides all of | ||
184 | * the information that the USB serial core code needs. If the function | ||
185 | * pointers are defined, then the USB serial core code will call them when | ||
186 | * the corresponding tty port functions are called. If they are not | ||
187 | * called, the generic serial function will be used instead. | ||
188 | * | ||
189 | * The driver.owner field should be set to the module owner of this driver. | ||
190 | * The driver.name field should be set to the name of this driver (remember | ||
191 | * it will show up in sysfs, so it needs to be short and to the point. | ||
192 | * Useing the module name is a good idea.) | ||
193 | */ | ||
194 | struct usb_serial_driver { | ||
195 | const char *description; | ||
196 | const struct usb_device_id *id_table; | ||
197 | char num_interrupt_in; | ||
198 | char num_interrupt_out; | ||
199 | char num_bulk_in; | ||
200 | char num_bulk_out; | ||
201 | char num_ports; | ||
202 | |||
203 | struct list_head driver_list; | ||
204 | struct device_driver driver; | ||
205 | |||
206 | int (*probe) (struct usb_serial *serial, const struct usb_device_id *id); | ||
207 | int (*attach) (struct usb_serial *serial); | ||
208 | int (*calc_num_ports) (struct usb_serial *serial); | ||
209 | |||
210 | void (*shutdown) (struct usb_serial *serial); | ||
211 | |||
212 | int (*port_probe) (struct usb_serial_port *port); | ||
213 | int (*port_remove) (struct usb_serial_port *port); | ||
214 | |||
215 | /* serial function calls */ | ||
216 | int (*open) (struct usb_serial_port *port, struct file * filp); | ||
217 | void (*close) (struct usb_serial_port *port, struct file * filp); | ||
218 | int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); | ||
219 | int (*write_room) (struct usb_serial_port *port); | ||
220 | int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); | ||
221 | void (*set_termios) (struct usb_serial_port *port, struct termios * old); | ||
222 | void (*break_ctl) (struct usb_serial_port *port, int break_state); | ||
223 | int (*chars_in_buffer) (struct usb_serial_port *port); | ||
224 | void (*throttle) (struct usb_serial_port *port); | ||
225 | void (*unthrottle) (struct usb_serial_port *port); | ||
226 | int (*tiocmget) (struct usb_serial_port *port, struct file *file); | ||
227 | int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); | ||
228 | |||
229 | void (*read_int_callback)(struct urb *urb, struct pt_regs *regs); | ||
230 | void (*write_int_callback)(struct urb *urb, struct pt_regs *regs); | ||
231 | void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs); | ||
232 | void (*write_bulk_callback)(struct urb *urb, struct pt_regs *regs); | ||
233 | }; | ||
234 | #define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver) | ||
235 | |||
236 | extern int usb_serial_register(struct usb_serial_driver *driver); | ||
237 | extern void usb_serial_deregister(struct usb_serial_driver *driver); | ||
238 | extern void usb_serial_port_softint(struct usb_serial_port *port); | ||
239 | |||
240 | extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); | ||
241 | extern void usb_serial_disconnect(struct usb_interface *iface); | ||
242 | |||
243 | extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); | ||
244 | extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); | ||
245 | |||
246 | /* USB Serial console functions */ | ||
247 | #ifdef CONFIG_USB_SERIAL_CONSOLE | ||
248 | extern void usb_serial_console_init (int debug, int minor); | ||
249 | extern void usb_serial_console_exit (void); | ||
250 | extern void usb_serial_console_disconnect(struct usb_serial *serial); | ||
251 | #else | ||
252 | static inline void usb_serial_console_init (int debug, int minor) { } | ||
253 | static inline void usb_serial_console_exit (void) { } | ||
254 | static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | ||
255 | #endif | ||
256 | |||
257 | /* Functions needed by other parts of the usbserial core */ | ||
258 | extern struct usb_serial *usb_serial_get_by_index (unsigned int minor); | ||
259 | extern void usb_serial_put(struct usb_serial *serial); | ||
260 | extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); | ||
261 | extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); | ||
262 | extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); | ||
263 | extern int usb_serial_generic_write_room (struct usb_serial_port *port); | ||
264 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); | ||
265 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *regs); | ||
266 | extern void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs); | ||
267 | extern void usb_serial_generic_shutdown (struct usb_serial *serial); | ||
268 | extern int usb_serial_generic_register (int debug); | ||
269 | extern void usb_serial_generic_deregister (void); | ||
270 | |||
271 | extern int usb_serial_bus_register (struct usb_serial_driver *device); | ||
272 | extern void usb_serial_bus_deregister (struct usb_serial_driver *device); | ||
273 | |||
274 | extern struct usb_serial_driver usb_serial_generic_device; | ||
275 | extern struct bus_type usb_serial_bus_type; | ||
276 | extern struct tty_driver *usb_serial_tty_driver; | ||
277 | |||
278 | static inline void usb_serial_debug_data(int debug, | ||
279 | struct device *dev, | ||
280 | const char *function, int size, | ||
281 | const unsigned char *data) | ||
282 | { | ||
283 | int i; | ||
284 | |||
285 | if (debug) { | ||
286 | dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size); | ||
287 | for (i = 0; i < size; ++i) | ||
288 | printk ("%.2x ", data[i]); | ||
289 | printk ("\n"); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | /* Use our own dbg macro */ | ||
294 | #undef dbg | ||
295 | #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) | ||
296 | |||
297 | |||
298 | |||
299 | #endif /* ifdef __LINUX_USB_SERIAL_H */ | ||
300 | |||
diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h index a2aacfc7af2f..c720d107ff29 100644 --- a/include/linux/usb_ch9.h +++ b/include/linux/usb_ch9.h | |||
@@ -51,6 +51,9 @@ | |||
51 | #define USB_RECIP_INTERFACE 0x01 | 51 | #define USB_RECIP_INTERFACE 0x01 |
52 | #define USB_RECIP_ENDPOINT 0x02 | 52 | #define USB_RECIP_ENDPOINT 0x02 |
53 | #define USB_RECIP_OTHER 0x03 | 53 | #define USB_RECIP_OTHER 0x03 |
54 | /* From Wireless USB 1.0 */ | ||
55 | #define USB_RECIP_PORT 0x04 | ||
56 | #define USB_RECIP_RPIPE 0x05 | ||
54 | 57 | ||
55 | /* | 58 | /* |
56 | * Standard requests, for the bRequest field of a SETUP packet. | 59 | * Standard requests, for the bRequest field of a SETUP packet. |
@@ -73,7 +76,9 @@ | |||
73 | 76 | ||
74 | #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ | 77 | #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ |
75 | #define USB_REQ_GET_ENCRYPTION 0x0E | 78 | #define USB_REQ_GET_ENCRYPTION 0x0E |
79 | #define USB_REQ_RPIPE_ABORT 0x0E | ||
76 | #define USB_REQ_SET_HANDSHAKE 0x0F | 80 | #define USB_REQ_SET_HANDSHAKE 0x0F |
81 | #define USB_REQ_RPIPE_RESET 0x0F | ||
77 | #define USB_REQ_GET_HANDSHAKE 0x10 | 82 | #define USB_REQ_GET_HANDSHAKE 0x10 |
78 | #define USB_REQ_SET_CONNECTION 0x11 | 83 | #define USB_REQ_SET_CONNECTION 0x11 |
79 | #define USB_REQ_SET_SECURITY_DATA 0x12 | 84 | #define USB_REQ_SET_SECURITY_DATA 0x12 |
@@ -159,6 +164,8 @@ struct usb_ctrlrequest { | |||
159 | #define USB_DT_BOS 0x0f | 164 | #define USB_DT_BOS 0x0f |
160 | #define USB_DT_DEVICE_CAPABILITY 0x10 | 165 | #define USB_DT_DEVICE_CAPABILITY 0x10 |
161 | #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 | 166 | #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 |
167 | #define USB_DT_WIRE_ADAPTER 0x21 | ||
168 | #define USB_DT_RPIPE 0x22 | ||
162 | 169 | ||
163 | /* conventional codes for class-specific descriptors */ | 170 | /* conventional codes for class-specific descriptors */ |
164 | #define USB_DT_CS_DEVICE 0x21 | 171 | #define USB_DT_CS_DEVICE 0x21 |
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index 1d78870ed8af..e17186dbcdca 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h | |||
@@ -872,9 +872,9 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config, | |||
872 | /* utility wrapping a simple endpoint selection policy */ | 872 | /* utility wrapping a simple endpoint selection policy */ |
873 | 873 | ||
874 | extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, | 874 | extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, |
875 | struct usb_endpoint_descriptor *) __init; | 875 | struct usb_endpoint_descriptor *) __devinit; |
876 | 876 | ||
877 | extern void usb_ep_autoconfig_reset (struct usb_gadget *) __init; | 877 | extern void usb_ep_autoconfig_reset (struct usb_gadget *) __devinit; |
878 | 878 | ||
879 | #endif /* __KERNEL__ */ | 879 | #endif /* __KERNEL__ */ |
880 | 880 | ||
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 608487a62c98..f38f43f20fae 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -43,6 +43,8 @@ | |||
43 | /* Need delay after Command phase */ \ | 43 | /* Need delay after Command phase */ \ |
44 | US_FLAG(NO_WP_DETECT, 0x00000200) \ | 44 | US_FLAG(NO_WP_DETECT, 0x00000200) \ |
45 | /* Don't check for write-protect */ \ | 45 | /* Don't check for write-protect */ \ |
46 | US_FLAG(MAX_SECTORS_64, 0x00000400) \ | ||
47 | /* Sets max_sectors to 64 */ | ||
46 | 48 | ||
47 | #define US_FLAG(name, value) US_FL_##name = value , | 49 | #define US_FLAG(name, value) US_FL_##name = value , |
48 | enum { US_DO_ALL_FLAGS }; | 50 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index dc7c621e4647..46919f9f5eb3 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h | |||
@@ -1,4 +1,4 @@ | |||
1 | #include <linux/version.h> | 1 | #include <linux/utsrelease.h> |
2 | #include <linux/module.h> | 2 | #include <linux/module.h> |
3 | 3 | ||
4 | /* Simply sanity version stamp for modules. */ | 4 | /* Simply sanity version stamp for modules. */ |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h new file mode 100644 index 000000000000..1ab806c47514 --- /dev/null +++ b/include/linux/vmstat.h | |||
@@ -0,0 +1,220 @@ | |||
1 | #ifndef _LINUX_VMSTAT_H | ||
2 | #define _LINUX_VMSTAT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/percpu.h> | ||
6 | #include <linux/config.h> | ||
7 | #include <linux/mmzone.h> | ||
8 | #include <asm/atomic.h> | ||
9 | |||
10 | #ifdef CONFIG_VM_EVENT_COUNTERS | ||
11 | /* | ||
12 | * Light weight per cpu counter implementation. | ||
13 | * | ||
14 | * Counters should only be incremented and no critical kernel component | ||
15 | * should rely on the counter values. | ||
16 | * | ||
17 | * Counters are handled completely inline. On many platforms the code | ||
18 | * generated will simply be the increment of a global address. | ||
19 | */ | ||
20 | |||
21 | #define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH | ||
22 | |||
23 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | ||
24 | FOR_ALL_ZONES(PGALLOC), | ||
25 | PGFREE, PGACTIVATE, PGDEACTIVATE, | ||
26 | PGFAULT, PGMAJFAULT, | ||
27 | FOR_ALL_ZONES(PGREFILL), | ||
28 | FOR_ALL_ZONES(PGSTEAL), | ||
29 | FOR_ALL_ZONES(PGSCAN_KSWAPD), | ||
30 | FOR_ALL_ZONES(PGSCAN_DIRECT), | ||
31 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | ||
32 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | ||
33 | NR_VM_EVENT_ITEMS | ||
34 | }; | ||
35 | |||
36 | struct vm_event_state { | ||
37 | unsigned long event[NR_VM_EVENT_ITEMS]; | ||
38 | }; | ||
39 | |||
40 | DECLARE_PER_CPU(struct vm_event_state, vm_event_states); | ||
41 | |||
42 | static inline void __count_vm_event(enum vm_event_item item) | ||
43 | { | ||
44 | __get_cpu_var(vm_event_states.event[item])++; | ||
45 | } | ||
46 | |||
47 | static inline void count_vm_event(enum vm_event_item item) | ||
48 | { | ||
49 | get_cpu_var(vm_event_states.event[item])++; | ||
50 | put_cpu(); | ||
51 | } | ||
52 | |||
53 | static inline void __count_vm_events(enum vm_event_item item, long delta) | ||
54 | { | ||
55 | __get_cpu_var(vm_event_states.event[item]) += delta; | ||
56 | } | ||
57 | |||
58 | static inline void count_vm_events(enum vm_event_item item, long delta) | ||
59 | { | ||
60 | get_cpu_var(vm_event_states.event[item]) += delta; | ||
61 | put_cpu(); | ||
62 | } | ||
63 | |||
64 | extern void all_vm_events(unsigned long *); | ||
65 | extern void vm_events_fold_cpu(int cpu); | ||
66 | |||
67 | #else | ||
68 | |||
69 | /* Disable counters */ | ||
70 | #define get_cpu_vm_events(e) 0L | ||
71 | #define count_vm_event(e) do { } while (0) | ||
72 | #define count_vm_events(e,d) do { } while (0) | ||
73 | #define __count_vm_event(e) do { } while (0) | ||
74 | #define __count_vm_events(e,d) do { } while (0) | ||
75 | #define vm_events_fold_cpu(x) do { } while (0) | ||
76 | |||
77 | #endif /* CONFIG_VM_EVENT_COUNTERS */ | ||
78 | |||
79 | #define __count_zone_vm_events(item, zone, delta) \ | ||
80 | __count_vm_events(item##_DMA + zone_idx(zone), delta) | ||
81 | |||
82 | /* | ||
83 | * Zone based page accounting with per cpu differentials. | ||
84 | */ | ||
85 | extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; | ||
86 | |||
87 | static inline void zone_page_state_add(long x, struct zone *zone, | ||
88 | enum zone_stat_item item) | ||
89 | { | ||
90 | atomic_long_add(x, &zone->vm_stat[item]); | ||
91 | atomic_long_add(x, &vm_stat[item]); | ||
92 | } | ||
93 | |||
94 | static inline unsigned long global_page_state(enum zone_stat_item item) | ||
95 | { | ||
96 | long x = atomic_long_read(&vm_stat[item]); | ||
97 | #ifdef CONFIG_SMP | ||
98 | if (x < 0) | ||
99 | x = 0; | ||
100 | #endif | ||
101 | return x; | ||
102 | } | ||
103 | |||
104 | static inline unsigned long zone_page_state(struct zone *zone, | ||
105 | enum zone_stat_item item) | ||
106 | { | ||
107 | long x = atomic_long_read(&zone->vm_stat[item]); | ||
108 | #ifdef CONFIG_SMP | ||
109 | if (x < 0) | ||
110 | x = 0; | ||
111 | #endif | ||
112 | return x; | ||
113 | } | ||
114 | |||
115 | #ifdef CONFIG_NUMA | ||
116 | /* | ||
117 | * Determine the per node value of a stat item. This function | ||
118 | * is called frequently in a NUMA machine, so try to be as | ||
119 | * frugal as possible. | ||
120 | */ | ||
121 | static inline unsigned long node_page_state(int node, | ||
122 | enum zone_stat_item item) | ||
123 | { | ||
124 | struct zone *zones = NODE_DATA(node)->node_zones; | ||
125 | |||
126 | return | ||
127 | #ifndef CONFIG_DMA_IS_NORMAL | ||
128 | #if !defined(CONFIG_DMA_IS_DMA32) && BITS_PER_LONG >= 64 | ||
129 | zone_page_state(&zones[ZONE_DMA32], item) + | ||
130 | #endif | ||
131 | zone_page_state(&zones[ZONE_NORMAL], item) + | ||
132 | #endif | ||
133 | #ifdef CONFIG_HIGHMEM | ||
134 | zone_page_state(&zones[ZONE_HIGHMEM], item) + | ||
135 | #endif | ||
136 | zone_page_state(&zones[ZONE_DMA], item); | ||
137 | } | ||
138 | |||
139 | extern void zone_statistics(struct zonelist *, struct zone *); | ||
140 | |||
141 | #else | ||
142 | |||
143 | #define node_page_state(node, item) global_page_state(item) | ||
144 | #define zone_statistics(_zl,_z) do { } while (0) | ||
145 | |||
146 | #endif /* CONFIG_NUMA */ | ||
147 | |||
148 | #define __add_zone_page_state(__z, __i, __d) \ | ||
149 | __mod_zone_page_state(__z, __i, __d) | ||
150 | #define __sub_zone_page_state(__z, __i, __d) \ | ||
151 | __mod_zone_page_state(__z, __i,-(__d)) | ||
152 | |||
153 | #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) | ||
154 | #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) | ||
155 | |||
156 | static inline void zap_zone_vm_stats(struct zone *zone) | ||
157 | { | ||
158 | memset(zone->vm_stat, 0, sizeof(zone->vm_stat)); | ||
159 | } | ||
160 | |||
161 | extern void inc_zone_state(struct zone *, enum zone_stat_item); | ||
162 | |||
163 | #ifdef CONFIG_SMP | ||
164 | void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int); | ||
165 | void __inc_zone_page_state(struct page *, enum zone_stat_item); | ||
166 | void __dec_zone_page_state(struct page *, enum zone_stat_item); | ||
167 | |||
168 | void mod_zone_page_state(struct zone *, enum zone_stat_item, int); | ||
169 | void inc_zone_page_state(struct page *, enum zone_stat_item); | ||
170 | void dec_zone_page_state(struct page *, enum zone_stat_item); | ||
171 | |||
172 | extern void inc_zone_state(struct zone *, enum zone_stat_item); | ||
173 | |||
174 | void refresh_cpu_vm_stats(int); | ||
175 | void refresh_vm_stats(void); | ||
176 | |||
177 | #else /* CONFIG_SMP */ | ||
178 | |||
179 | /* | ||
180 | * We do not maintain differentials in a single processor configuration. | ||
181 | * The functions directly modify the zone and global counters. | ||
182 | */ | ||
183 | static inline void __mod_zone_page_state(struct zone *zone, | ||
184 | enum zone_stat_item item, int delta) | ||
185 | { | ||
186 | zone_page_state_add(delta, zone, item); | ||
187 | } | ||
188 | |||
189 | static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) | ||
190 | { | ||
191 | atomic_long_inc(&zone->vm_stat[item]); | ||
192 | atomic_long_inc(&vm_stat[item]); | ||
193 | } | ||
194 | |||
195 | static inline void __inc_zone_page_state(struct page *page, | ||
196 | enum zone_stat_item item) | ||
197 | { | ||
198 | __inc_zone_state(page_zone(page), item); | ||
199 | } | ||
200 | |||
201 | static inline void __dec_zone_page_state(struct page *page, | ||
202 | enum zone_stat_item item) | ||
203 | { | ||
204 | atomic_long_dec(&page_zone(page)->vm_stat[item]); | ||
205 | atomic_long_dec(&vm_stat[item]); | ||
206 | } | ||
207 | |||
208 | /* | ||
209 | * We only use atomic operations to update counters. So there is no need to | ||
210 | * disable interrupts. | ||
211 | */ | ||
212 | #define inc_zone_page_state __inc_zone_page_state | ||
213 | #define dec_zone_page_state __dec_zone_page_state | ||
214 | #define mod_zone_page_state __mod_zone_page_state | ||
215 | |||
216 | static inline void refresh_cpu_vm_stats(int cpu) { } | ||
217 | static inline void refresh_vm_stats(void) { } | ||
218 | #endif | ||
219 | |||
220 | #endif /* _LINUX_VMSTAT_H */ | ||
diff --git a/include/linux/vt.h b/include/linux/vt.h index 9f95b0bea5b3..8ab334a48222 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
@@ -1,6 +1,16 @@ | |||
1 | #ifndef _LINUX_VT_H | 1 | #ifndef _LINUX_VT_H |
2 | #define _LINUX_VT_H | 2 | #define _LINUX_VT_H |
3 | 3 | ||
4 | /* | ||
5 | * These constants are also useful for user-level apps (e.g., VC | ||
6 | * resizing). | ||
7 | */ | ||
8 | #define MIN_NR_CONSOLES 1 /* must be at least 1 */ | ||
9 | #define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ | ||
10 | #define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */ | ||
11 | /* Note: the ioctl VT_GETSTATE does not work for | ||
12 | consoles 16 and higher (since it returns a short) */ | ||
13 | |||
4 | /* 0x56 is 'V', to avoid collision with termios and kd */ | 14 | /* 0x56 is 'V', to avoid collision with termios and kd */ |
5 | 15 | ||
6 | #define VT_OPENQRY 0x5600 /* find available vt */ | 16 | #define VT_OPENQRY 0x5600 /* find available vt */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 940d0261a545..918a29763aea 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | extern void kd_mksound(unsigned int hz, unsigned int ticks); | 27 | extern void kd_mksound(unsigned int hz, unsigned int ticks); |
28 | extern int kbd_rate(struct kbd_repeat *rep); | 28 | extern int kbd_rate(struct kbd_repeat *rep); |
29 | extern int fg_console, last_console, want_console; | ||
29 | 30 | ||
30 | /* console.c */ | 31 | /* console.c */ |
31 | 32 | ||
diff --git a/include/linux/wait.h b/include/linux/wait.h index 544e855c7c02..b3b9048421d8 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -68,7 +68,7 @@ struct task_struct; | |||
68 | wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk) | 68 | wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk) |
69 | 69 | ||
70 | #define __WAIT_QUEUE_HEAD_INITIALIZER(name) { \ | 70 | #define __WAIT_QUEUE_HEAD_INITIALIZER(name) { \ |
71 | .lock = SPIN_LOCK_UNLOCKED, \ | 71 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ |
72 | .task_list = { &(name).task_list, &(name).task_list } } | 72 | .task_list = { &(name).task_list, &(name).task_list } } |
73 | 73 | ||
74 | #define DECLARE_WAIT_QUEUE_HEAD(name) \ | 74 | #define DECLARE_WAIT_QUEUE_HEAD(name) \ |
@@ -77,11 +77,7 @@ struct task_struct; | |||
77 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ | 77 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ |
78 | { .flags = word, .bit_nr = bit, } | 78 | { .flags = word, .bit_nr = bit, } |
79 | 79 | ||
80 | static inline void init_waitqueue_head(wait_queue_head_t *q) | 80 | extern void init_waitqueue_head(wait_queue_head_t *q); |
81 | { | ||
82 | spin_lock_init(&q->lock); | ||
83 | INIT_LIST_HEAD(&q->task_list); | ||
84 | } | ||
85 | 81 | ||
86 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) | 82 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) |
87 | { | 83 | { |
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 1192ed8f4fe8..011bcfeb9f09 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h | |||
@@ -28,6 +28,9 @@ struct watchdog_info { | |||
28 | #define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int) | 28 | #define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int) |
29 | #define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int) | 29 | #define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int) |
30 | #define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int) | 30 | #define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int) |
31 | #define WDIOC_SETPRETIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 8, int) | ||
32 | #define WDIOC_GETPRETIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 9, int) | ||
33 | #define WDIOC_GETTIMELEFT _IOR(WATCHDOG_IOCTL_BASE, 10, int) | ||
31 | 34 | ||
32 | #define WDIOF_UNKNOWN -1 /* Unknown flag error */ | 35 | #define WDIOF_UNKNOWN -1 /* Unknown flag error */ |
33 | #define WDIOS_UNKNOWN -1 /* Unknown status error */ | 36 | #define WDIOS_UNKNOWN -1 /* Unknown status error */ |
@@ -38,9 +41,10 @@ struct watchdog_info { | |||
38 | #define WDIOF_EXTERN2 0x0008 /* External relay 2 */ | 41 | #define WDIOF_EXTERN2 0x0008 /* External relay 2 */ |
39 | #define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */ | 42 | #define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */ |
40 | #define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */ | 43 | #define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */ |
41 | #define WDIOF_POWEROVER 0x0040 /* Power over voltage */ | 44 | #define WDIOF_POWEROVER 0x0040 /* Power over voltage */ |
42 | #define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */ | 45 | #define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */ |
43 | #define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */ | 46 | #define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */ |
47 | #define WDIOF_PRETIMEOUT 0x0200 /* Pretimeout (in seconds), get/set */ | ||
44 | #define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */ | 48 | #define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */ |
45 | 49 | ||
46 | #define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */ | 50 | #define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 957c21c16d62..9bca3539a1e5 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -63,6 +63,8 @@ extern void destroy_workqueue(struct workqueue_struct *wq); | |||
63 | 63 | ||
64 | extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); | 64 | extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); |
65 | extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct work_struct *work, unsigned long delay)); | 65 | extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct work_struct *work, unsigned long delay)); |
66 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | ||
67 | struct work_struct *work, unsigned long delay); | ||
66 | extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); | 68 | extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); |
67 | 69 | ||
68 | extern int FASTCALL(schedule_work(struct work_struct *work)); | 70 | extern int FASTCALL(schedule_work(struct work_struct *work)); |
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h index ad9c171bfa07..3c43b95f4c0d 100644 --- a/include/media/tuner-types.h +++ b/include/media/tuner-types.h | |||
@@ -20,6 +20,7 @@ struct tuner_range { | |||
20 | 20 | ||
21 | struct tuner_params { | 21 | struct tuner_params { |
22 | enum param_type type; | 22 | enum param_type type; |
23 | |||
23 | /* Many Philips based tuners have a comment like this in their | 24 | /* Many Philips based tuners have a comment like this in their |
24 | * datasheet: | 25 | * datasheet: |
25 | * | 26 | * |
@@ -39,6 +40,60 @@ struct tuner_params { | |||
39 | * static unless the control byte was sent first. | 40 | * static unless the control byte was sent first. |
40 | */ | 41 | */ |
41 | unsigned int cb_first_if_lower_freq:1; | 42 | unsigned int cb_first_if_lower_freq:1; |
43 | /* Set to 1 if this tuner uses a tda9887 */ | ||
44 | unsigned int has_tda9887:1; | ||
45 | /* Many Philips tuners use tda9887 PORT1 to select the FM radio | ||
46 | sensitivity. If this setting is 1, then set PORT1 to 1 to | ||
47 | get proper FM reception. */ | ||
48 | unsigned int port1_fm_high_sensitivity:1; | ||
49 | /* Some Philips tuners use tda9887 PORT2 to select the FM radio | ||
50 | sensitivity. If this setting is 1, then set PORT2 to 1 to | ||
51 | get proper FM reception. */ | ||
52 | unsigned int port2_fm_high_sensitivity:1; | ||
53 | /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners | ||
54 | use Intercarrier mode. If this setting is 1, then the tuner | ||
55 | needs to be set to intercarrier mode. */ | ||
56 | unsigned int intercarrier_mode:1; | ||
57 | /* This setting sets the default value for PORT1. | ||
58 | 0 means inactive, 1 means active. Note: the actual bit | ||
59 | value written to the tda9887 is inverted. So a 0 here | ||
60 | means a 1 in the B6 bit. */ | ||
61 | unsigned int port1_active:1; | ||
62 | /* This setting sets the default value for PORT2. | ||
63 | 0 means inactive, 1 means active. Note: the actual bit | ||
64 | value written to the tda9887 is inverted. So a 0 here | ||
65 | means a 1 in the B7 bit. */ | ||
66 | unsigned int port2_active:1; | ||
67 | /* Sometimes PORT1 is inverted when the SECAM-L' standard is selected. | ||
68 | Set this bit to 1 if this is needed. */ | ||
69 | unsigned int port1_invert_for_secam_lc:1; | ||
70 | /* Sometimes PORT2 is inverted when the SECAM-L' standard is selected. | ||
71 | Set this bit to 1 if this is needed. */ | ||
72 | unsigned int port2_invert_for_secam_lc:1; | ||
73 | /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */ | ||
74 | unsigned int port1_set_for_fm_mono:1; | ||
75 | /* Default tda9887 TOP value in dB for the low band. Default is 0. | ||
76 | Range: -16:+15 */ | ||
77 | signed int default_top_low:5; | ||
78 | /* Default tda9887 TOP value in dB for the mid band. Default is 0. | ||
79 | Range: -16:+15 */ | ||
80 | signed int default_top_mid:5; | ||
81 | /* Default tda9887 TOP value in dB for the high band. Default is 0. | ||
82 | Range: -16:+15 */ | ||
83 | signed int default_top_high:5; | ||
84 | /* Default tda9887 TOP value in dB for SECAM-L/L' for the low band. | ||
85 | Default is 0. Several tuners require a different TOP value for | ||
86 | the SECAM-L/L' standards. Range: -16:+15 */ | ||
87 | signed int default_top_secam_low:5; | ||
88 | /* Default tda9887 TOP value in dB for SECAM-L/L' for the mid band. | ||
89 | Default is 0. Several tuners require a different TOP value for | ||
90 | the SECAM-L/L' standards. Range: -16:+15 */ | ||
91 | signed int default_top_secam_mid:5; | ||
92 | /* Default tda9887 TOP value in dB for SECAM-L/L' for the high band. | ||
93 | Default is 0. Several tuners require a different TOP value for | ||
94 | the SECAM-L/L' standards. Range: -16:+15 */ | ||
95 | signed int default_top_secam_high:5; | ||
96 | |||
42 | 97 | ||
43 | unsigned int count; | 98 | unsigned int count; |
44 | struct tuner_range *ranges; | 99 | struct tuner_range *ranges; |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index a1b473190e65..62dae1a8c441 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -314,7 +314,6 @@ void *priv; | |||
314 | /* for videodev.c intenal usage -- please don't touch */ | 314 | /* for videodev.c intenal usage -- please don't touch */ |
315 | int users; /* video_exclusive_{open|close} ... */ | 315 | int users; /* video_exclusive_{open|close} ... */ |
316 | struct mutex lock; /* ... helper function uses these */ | 316 | struct mutex lock; /* ... helper function uses these */ |
317 | char devfs_name[64]; /* devfs */ | ||
318 | struct class_device class_dev; /* sysfs */ | 317 | struct class_device class_dev; /* sysfs */ |
319 | }; | 318 | }; |
320 | 319 | ||
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild new file mode 100644 index 000000000000..e1da2a5b2a57 --- /dev/null +++ b/include/mtd/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | unifdef-y := mtd-abi.h | ||
2 | header-y := inftl-user.h jffs2-user.h mtd-user.h nftl-user.h | ||
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index 31329fce1ff5..1da3f7fa7993 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -133,7 +133,7 @@ struct nand_ecclayout { | |||
133 | }; | 133 | }; |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * struct mtd_ecc_stats - error correction status | 136 | * struct mtd_ecc_stats - error correction stats |
137 | * | 137 | * |
138 | * @corrected: number of corrected bits | 138 | * @corrected: number of corrected bits |
139 | * @failed: number of uncorrectable errors | 139 | * @failed: number of uncorrectable errors |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 795f81f9ec7f..2fec827c8801 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -53,14 +53,23 @@ struct unix_address { | |||
53 | struct unix_skb_parms { | 53 | struct unix_skb_parms { |
54 | struct ucred creds; /* Skb credentials */ | 54 | struct ucred creds; /* Skb credentials */ |
55 | struct scm_fp_list *fp; /* Passed files */ | 55 | struct scm_fp_list *fp; /* Passed files */ |
56 | #ifdef CONFIG_SECURITY_NETWORK | ||
57 | char *secdata; /* Security context */ | ||
58 | u32 seclen; /* Security length */ | ||
59 | #endif | ||
56 | }; | 60 | }; |
57 | 61 | ||
58 | #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) | 62 | #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) |
59 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) | 63 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) |
64 | #define UNIXSECDATA(skb) (&UNIXCB((skb)).secdata) | ||
65 | #define UNIXSECLEN(skb) (&UNIXCB((skb)).seclen) | ||
60 | 66 | ||
61 | #define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) | 67 | #define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) |
62 | #define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) | 68 | #define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) |
63 | #define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) | 69 | #define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) |
70 | #define unix_state_wlock_nested(s) \ | ||
71 | spin_lock_nested(&unix_sk(s)->lock, \ | ||
72 | SINGLE_DEPTH_NESTING) | ||
64 | #define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock) | 73 | #define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock) |
65 | 74 | ||
66 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 7cd528e9d668..69374cd1a857 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -182,14 +182,26 @@ typedef struct { | |||
182 | 182 | ||
183 | typedef struct ax25_route { | 183 | typedef struct ax25_route { |
184 | struct ax25_route *next; | 184 | struct ax25_route *next; |
185 | atomic_t ref; | 185 | atomic_t refcount; |
186 | ax25_address callsign; | 186 | ax25_address callsign; |
187 | struct net_device *dev; | 187 | struct net_device *dev; |
188 | ax25_digi *digipeat; | 188 | ax25_digi *digipeat; |
189 | char ip_mode; | 189 | char ip_mode; |
190 | struct timer_list timer; | ||
191 | } ax25_route; | 190 | } ax25_route; |
192 | 191 | ||
192 | static inline void ax25_hold_route(ax25_route *ax25_rt) | ||
193 | { | ||
194 | atomic_inc(&ax25_rt->refcount); | ||
195 | } | ||
196 | |||
197 | extern void __ax25_put_route(ax25_route *ax25_rt); | ||
198 | |||
199 | static inline void ax25_put_route(ax25_route *ax25_rt) | ||
200 | { | ||
201 | if (atomic_dec_and_test(&ax25_rt->refcount)) | ||
202 | __ax25_put_route(ax25_rt); | ||
203 | } | ||
204 | |||
193 | typedef struct { | 205 | typedef struct { |
194 | char slave; /* slave_mode? */ | 206 | char slave; /* slave_mode? */ |
195 | struct timer_list slave_timer; /* timeout timer */ | 207 | struct timer_list slave_timer; /* timeout timer */ |
@@ -348,17 +360,11 @@ extern int ax25_check_iframes_acked(ax25_cb *, unsigned short); | |||
348 | extern void ax25_rt_device_down(struct net_device *); | 360 | extern void ax25_rt_device_down(struct net_device *); |
349 | extern int ax25_rt_ioctl(unsigned int, void __user *); | 361 | extern int ax25_rt_ioctl(unsigned int, void __user *); |
350 | extern struct file_operations ax25_route_fops; | 362 | extern struct file_operations ax25_route_fops; |
363 | extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); | ||
351 | extern int ax25_rt_autobind(ax25_cb *, ax25_address *); | 364 | extern int ax25_rt_autobind(ax25_cb *, ax25_address *); |
352 | extern ax25_route *ax25_rt_find_route(ax25_route *, ax25_address *, | ||
353 | struct net_device *); | ||
354 | extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); | 365 | extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); |
355 | extern void ax25_rt_free(void); | 366 | extern void ax25_rt_free(void); |
356 | 367 | ||
357 | static inline void ax25_put_route(ax25_route *ax25_rt) | ||
358 | { | ||
359 | atomic_dec(&ax25_rt->ref); | ||
360 | } | ||
361 | |||
362 | /* ax25_std_in.c */ | 368 | /* ax25_std_in.c */ |
363 | extern int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int); | 369 | extern int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int); |
364 | 370 | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 911ceb5cd263..771d17783c18 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -175,6 +175,6 @@ extern int hci_sock_cleanup(void); | |||
175 | extern int bt_sysfs_init(void); | 175 | extern int bt_sysfs_init(void); |
176 | extern void bt_sysfs_cleanup(void); | 176 | extern void bt_sysfs_cleanup(void); |
177 | 177 | ||
178 | extern struct class bt_class; | 178 | extern struct class *bt_class; |
179 | 179 | ||
180 | #endif /* __BLUETOOTH_H */ | 180 | #endif /* __BLUETOOTH_H */ |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index b06a2d2f63d2..b2bdb1aa0429 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -54,7 +54,8 @@ | |||
54 | /* HCI device quirks */ | 54 | /* HCI device quirks */ |
55 | enum { | 55 | enum { |
56 | HCI_QUIRK_RESET_ON_INIT, | 56 | HCI_QUIRK_RESET_ON_INIT, |
57 | HCI_QUIRK_RAW_DEVICE | 57 | HCI_QUIRK_RAW_DEVICE, |
58 | HCI_QUIRK_FIXUP_BUFFER_SIZE | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | /* HCI device flags */ | 61 | /* HCI device flags */ |
@@ -100,9 +101,10 @@ enum { | |||
100 | #define HCIINQUIRY _IOR('H', 240, int) | 101 | #define HCIINQUIRY _IOR('H', 240, int) |
101 | 102 | ||
102 | /* HCI timeouts */ | 103 | /* HCI timeouts */ |
103 | #define HCI_CONN_TIMEOUT (HZ * 40) | 104 | #define HCI_CONNECT_TIMEOUT (40000) /* 40 seconds */ |
104 | #define HCI_DISCONN_TIMEOUT (HZ * 2) | 105 | #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ |
105 | #define HCI_CONN_IDLE_TIMEOUT (HZ * 60) | 106 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ |
107 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ | ||
106 | 108 | ||
107 | /* HCI Packet types */ | 109 | /* HCI Packet types */ |
108 | #define HCI_COMMAND_PKT 0x01 | 110 | #define HCI_COMMAND_PKT 0x01 |
@@ -144,7 +146,7 @@ enum { | |||
144 | #define LMP_TACCURACY 0x10 | 146 | #define LMP_TACCURACY 0x10 |
145 | #define LMP_RSWITCH 0x20 | 147 | #define LMP_RSWITCH 0x20 |
146 | #define LMP_HOLD 0x40 | 148 | #define LMP_HOLD 0x40 |
147 | #define LMP_SNIF 0x80 | 149 | #define LMP_SNIFF 0x80 |
148 | 150 | ||
149 | #define LMP_PARK 0x01 | 151 | #define LMP_PARK 0x01 |
150 | #define LMP_RSSI 0x02 | 152 | #define LMP_RSSI 0x02 |
@@ -159,13 +161,21 @@ enum { | |||
159 | #define LMP_PSCHEME 0x02 | 161 | #define LMP_PSCHEME 0x02 |
160 | #define LMP_PCONTROL 0x04 | 162 | #define LMP_PCONTROL 0x04 |
161 | 163 | ||
164 | #define LMP_SNIFF_SUBR 0x02 | ||
165 | |||
166 | /* Connection modes */ | ||
167 | #define HCI_CM_ACTIVE 0x0000 | ||
168 | #define HCI_CM_HOLD 0x0001 | ||
169 | #define HCI_CM_SNIFF 0x0002 | ||
170 | #define HCI_CM_PARK 0x0003 | ||
171 | |||
162 | /* Link policies */ | 172 | /* Link policies */ |
163 | #define HCI_LP_RSWITCH 0x0001 | 173 | #define HCI_LP_RSWITCH 0x0001 |
164 | #define HCI_LP_HOLD 0x0002 | 174 | #define HCI_LP_HOLD 0x0002 |
165 | #define HCI_LP_SNIFF 0x0004 | 175 | #define HCI_LP_SNIFF 0x0004 |
166 | #define HCI_LP_PARK 0x0008 | 176 | #define HCI_LP_PARK 0x0008 |
167 | 177 | ||
168 | /* Link mode */ | 178 | /* Link modes */ |
169 | #define HCI_LM_ACCEPT 0x8000 | 179 | #define HCI_LM_ACCEPT 0x8000 |
170 | #define HCI_LM_MASTER 0x0001 | 180 | #define HCI_LM_MASTER 0x0001 |
171 | #define HCI_LM_AUTH 0x0002 | 181 | #define HCI_LM_AUTH 0x0002 |
@@ -191,7 +201,7 @@ struct hci_rp_read_loc_version { | |||
191 | } __attribute__ ((packed)); | 201 | } __attribute__ ((packed)); |
192 | 202 | ||
193 | #define OCF_READ_LOCAL_FEATURES 0x0003 | 203 | #define OCF_READ_LOCAL_FEATURES 0x0003 |
194 | struct hci_rp_read_loc_features { | 204 | struct hci_rp_read_local_features { |
195 | __u8 status; | 205 | __u8 status; |
196 | __u8 features[8]; | 206 | __u8 features[8]; |
197 | } __attribute__ ((packed)); | 207 | } __attribute__ ((packed)); |
@@ -375,17 +385,32 @@ struct hci_cp_change_conn_link_key { | |||
375 | } __attribute__ ((packed)); | 385 | } __attribute__ ((packed)); |
376 | 386 | ||
377 | #define OCF_READ_REMOTE_FEATURES 0x001B | 387 | #define OCF_READ_REMOTE_FEATURES 0x001B |
378 | struct hci_cp_read_rmt_features { | 388 | struct hci_cp_read_remote_features { |
379 | __le16 handle; | 389 | __le16 handle; |
380 | } __attribute__ ((packed)); | 390 | } __attribute__ ((packed)); |
381 | 391 | ||
382 | #define OCF_READ_REMOTE_VERSION 0x001D | 392 | #define OCF_READ_REMOTE_VERSION 0x001D |
383 | struct hci_cp_read_rmt_version { | 393 | struct hci_cp_read_remote_version { |
384 | __le16 handle; | 394 | __le16 handle; |
385 | } __attribute__ ((packed)); | 395 | } __attribute__ ((packed)); |
386 | 396 | ||
387 | /* Link Policy */ | 397 | /* Link Policy */ |
388 | #define OGF_LINK_POLICY 0x02 | 398 | #define OGF_LINK_POLICY 0x02 |
399 | |||
400 | #define OCF_SNIFF_MODE 0x0003 | ||
401 | struct hci_cp_sniff_mode { | ||
402 | __le16 handle; | ||
403 | __le16 max_interval; | ||
404 | __le16 min_interval; | ||
405 | __le16 attempt; | ||
406 | __le16 timeout; | ||
407 | } __attribute__ ((packed)); | ||
408 | |||
409 | #define OCF_EXIT_SNIFF_MODE 0x0004 | ||
410 | struct hci_cp_exit_sniff_mode { | ||
411 | __le16 handle; | ||
412 | } __attribute__ ((packed)); | ||
413 | |||
389 | #define OCF_ROLE_DISCOVERY 0x0009 | 414 | #define OCF_ROLE_DISCOVERY 0x0009 |
390 | struct hci_cp_role_discovery { | 415 | struct hci_cp_role_discovery { |
391 | __le16 handle; | 416 | __le16 handle; |
@@ -406,7 +431,7 @@ struct hci_rp_read_link_policy { | |||
406 | __le16 policy; | 431 | __le16 policy; |
407 | } __attribute__ ((packed)); | 432 | } __attribute__ ((packed)); |
408 | 433 | ||
409 | #define OCF_SWITCH_ROLE 0x000B | 434 | #define OCF_SWITCH_ROLE 0x000B |
410 | struct hci_cp_switch_role { | 435 | struct hci_cp_switch_role { |
411 | bdaddr_t bdaddr; | 436 | bdaddr_t bdaddr; |
412 | __u8 role; | 437 | __u8 role; |
@@ -422,6 +447,14 @@ struct hci_rp_write_link_policy { | |||
422 | __le16 handle; | 447 | __le16 handle; |
423 | } __attribute__ ((packed)); | 448 | } __attribute__ ((packed)); |
424 | 449 | ||
450 | #define OCF_SNIFF_SUBRATE 0x0011 | ||
451 | struct hci_cp_sniff_subrate { | ||
452 | __le16 handle; | ||
453 | __le16 max_latency; | ||
454 | __le16 min_remote_timeout; | ||
455 | __le16 min_local_timeout; | ||
456 | } __attribute__ ((packed)); | ||
457 | |||
425 | /* Status params */ | 458 | /* Status params */ |
426 | #define OGF_STATUS_PARAM 0x05 | 459 | #define OGF_STATUS_PARAM 0x05 |
427 | 460 | ||
@@ -581,15 +614,15 @@ struct hci_ev_link_key_notify { | |||
581 | __u8 key_type; | 614 | __u8 key_type; |
582 | } __attribute__ ((packed)); | 615 | } __attribute__ ((packed)); |
583 | 616 | ||
584 | #define HCI_EV_RMT_FEATURES 0x0B | 617 | #define HCI_EV_REMOTE_FEATURES 0x0B |
585 | struct hci_ev_rmt_features { | 618 | struct hci_ev_remote_features { |
586 | __u8 status; | 619 | __u8 status; |
587 | __le16 handle; | 620 | __le16 handle; |
588 | __u8 features[8]; | 621 | __u8 features[8]; |
589 | } __attribute__ ((packed)); | 622 | } __attribute__ ((packed)); |
590 | 623 | ||
591 | #define HCI_EV_RMT_VERSION 0x0C | 624 | #define HCI_EV_REMOTE_VERSION 0x0C |
592 | struct hci_ev_rmt_version { | 625 | struct hci_ev_remote_version { |
593 | __u8 status; | 626 | __u8 status; |
594 | __le16 handle; | 627 | __le16 handle; |
595 | __u8 lmp_ver; | 628 | __u8 lmp_ver; |
@@ -610,6 +643,16 @@ struct hci_ev_pscan_rep_mode { | |||
610 | __u8 pscan_rep_mode; | 643 | __u8 pscan_rep_mode; |
611 | } __attribute__ ((packed)); | 644 | } __attribute__ ((packed)); |
612 | 645 | ||
646 | #define HCI_EV_SNIFF_SUBRATE 0x2E | ||
647 | struct hci_ev_sniff_subrate { | ||
648 | __u8 status; | ||
649 | __le16 handle; | ||
650 | __le16 max_tx_latency; | ||
651 | __le16 max_rx_latency; | ||
652 | __le16 max_remote_timeout; | ||
653 | __le16 max_local_timeout; | ||
654 | } __attribute__ ((packed)); | ||
655 | |||
613 | /* Internal events generated by Bluetooth stack */ | 656 | /* Internal events generated by Bluetooth stack */ |
614 | #define HCI_EV_STACK_INTERNAL 0xFD | 657 | #define HCI_EV_STACK_INTERNAL 0xFD |
615 | struct hci_ev_stack_internal { | 658 | struct hci_ev_stack_internal { |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index bb9f81dc8723..d84855fe7336 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -31,10 +31,7 @@ | |||
31 | #define HCI_PROTO_L2CAP 0 | 31 | #define HCI_PROTO_L2CAP 0 |
32 | #define HCI_PROTO_SCO 1 | 32 | #define HCI_PROTO_SCO 1 |
33 | 33 | ||
34 | #define HCI_INIT_TIMEOUT (HZ * 10) | ||
35 | |||
36 | /* HCI Core structures */ | 34 | /* HCI Core structures */ |
37 | |||
38 | struct inquiry_data { | 35 | struct inquiry_data { |
39 | bdaddr_t bdaddr; | 36 | bdaddr_t bdaddr; |
40 | __u8 pscan_rep_mode; | 37 | __u8 pscan_rep_mode; |
@@ -81,6 +78,10 @@ struct hci_dev { | |||
81 | __u16 link_policy; | 78 | __u16 link_policy; |
82 | __u16 link_mode; | 79 | __u16 link_mode; |
83 | 80 | ||
81 | __u32 idle_timeout; | ||
82 | __u16 sniff_min_interval; | ||
83 | __u16 sniff_max_interval; | ||
84 | |||
84 | unsigned long quirks; | 85 | unsigned long quirks; |
85 | 86 | ||
86 | atomic_t cmd_cnt; | 87 | atomic_t cmd_cnt; |
@@ -123,7 +124,8 @@ struct hci_dev { | |||
123 | 124 | ||
124 | atomic_t promisc; | 125 | atomic_t promisc; |
125 | 126 | ||
126 | struct class_device class_dev; | 127 | struct device *parent; |
128 | struct device dev; | ||
127 | 129 | ||
128 | struct module *owner; | 130 | struct module *owner; |
129 | 131 | ||
@@ -145,18 +147,24 @@ struct hci_conn { | |||
145 | bdaddr_t dst; | 147 | bdaddr_t dst; |
146 | __u16 handle; | 148 | __u16 handle; |
147 | __u16 state; | 149 | __u16 state; |
150 | __u8 mode; | ||
148 | __u8 type; | 151 | __u8 type; |
149 | __u8 out; | 152 | __u8 out; |
150 | __u8 dev_class[3]; | 153 | __u8 dev_class[3]; |
154 | __u8 features[8]; | ||
155 | __u16 interval; | ||
156 | __u16 link_policy; | ||
151 | __u32 link_mode; | 157 | __u32 link_mode; |
158 | __u8 power_save; | ||
152 | unsigned long pend; | 159 | unsigned long pend; |
153 | 160 | ||
154 | unsigned int sent; | 161 | unsigned int sent; |
155 | 162 | ||
156 | struct sk_buff_head data_q; | 163 | struct sk_buff_head data_q; |
157 | 164 | ||
158 | struct timer_list timer; | 165 | struct timer_list disc_timer; |
159 | 166 | struct timer_list idle_timer; | |
167 | |||
160 | struct hci_dev *hdev; | 168 | struct hci_dev *hdev; |
161 | void *l2cap_data; | 169 | void *l2cap_data; |
162 | void *sco_data; | 170 | void *sco_data; |
@@ -211,7 +219,8 @@ void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data); | |||
211 | enum { | 219 | enum { |
212 | HCI_CONN_AUTH_PEND, | 220 | HCI_CONN_AUTH_PEND, |
213 | HCI_CONN_ENCRYPT_PEND, | 221 | HCI_CONN_ENCRYPT_PEND, |
214 | HCI_CONN_RSWITCH_PEND | 222 | HCI_CONN_RSWITCH_PEND, |
223 | HCI_CONN_MODE_CHANGE_PEND, | ||
215 | }; | 224 | }; |
216 | 225 | ||
217 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | 226 | static inline void hci_conn_hash_init(struct hci_dev *hdev) |
@@ -286,31 +295,27 @@ int hci_conn_encrypt(struct hci_conn *conn); | |||
286 | int hci_conn_change_link_key(struct hci_conn *conn); | 295 | int hci_conn_change_link_key(struct hci_conn *conn); |
287 | int hci_conn_switch_role(struct hci_conn *conn, uint8_t role); | 296 | int hci_conn_switch_role(struct hci_conn *conn, uint8_t role); |
288 | 297 | ||
289 | static inline void hci_conn_set_timer(struct hci_conn *conn, unsigned long timeout) | 298 | void hci_conn_enter_active_mode(struct hci_conn *conn); |
290 | { | 299 | void hci_conn_enter_sniff_mode(struct hci_conn *conn); |
291 | mod_timer(&conn->timer, jiffies + timeout); | ||
292 | } | ||
293 | |||
294 | static inline void hci_conn_del_timer(struct hci_conn *conn) | ||
295 | { | ||
296 | del_timer(&conn->timer); | ||
297 | } | ||
298 | 300 | ||
299 | static inline void hci_conn_hold(struct hci_conn *conn) | 301 | static inline void hci_conn_hold(struct hci_conn *conn) |
300 | { | 302 | { |
301 | atomic_inc(&conn->refcnt); | 303 | atomic_inc(&conn->refcnt); |
302 | hci_conn_del_timer(conn); | 304 | del_timer(&conn->disc_timer); |
303 | } | 305 | } |
304 | 306 | ||
305 | static inline void hci_conn_put(struct hci_conn *conn) | 307 | static inline void hci_conn_put(struct hci_conn *conn) |
306 | { | 308 | { |
307 | if (atomic_dec_and_test(&conn->refcnt)) { | 309 | if (atomic_dec_and_test(&conn->refcnt)) { |
310 | unsigned long timeo; | ||
308 | if (conn->type == ACL_LINK) { | 311 | if (conn->type == ACL_LINK) { |
309 | unsigned long timeo = (conn->out) ? | 312 | timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT); |
310 | HCI_DISCONN_TIMEOUT : HCI_DISCONN_TIMEOUT * 2; | 313 | if (!conn->out) |
311 | hci_conn_set_timer(conn, timeo); | 314 | timeo *= 2; |
315 | del_timer(&conn->idle_timer); | ||
312 | } else | 316 | } else |
313 | hci_conn_set_timer(conn, HZ / 100); | 317 | timeo = msecs_to_jiffies(10); |
318 | mod_timer(&conn->disc_timer, jiffies + timeo); | ||
314 | } | 319 | } |
315 | } | 320 | } |
316 | 321 | ||
@@ -408,11 +413,13 @@ static inline int hci_recv_frame(struct sk_buff *skb) | |||
408 | int hci_register_sysfs(struct hci_dev *hdev); | 413 | int hci_register_sysfs(struct hci_dev *hdev); |
409 | void hci_unregister_sysfs(struct hci_dev *hdev); | 414 | void hci_unregister_sysfs(struct hci_dev *hdev); |
410 | 415 | ||
411 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->class_dev.dev = (pdev)) | 416 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev)) |
412 | 417 | ||
413 | /* ----- LMP capabilities ----- */ | 418 | /* ----- LMP capabilities ----- */ |
414 | #define lmp_rswitch_capable(dev) (dev->features[0] & LMP_RSWITCH) | 419 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) |
415 | #define lmp_encrypt_capable(dev) (dev->features[0] & LMP_ENCRYPT) | 420 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) |
421 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | ||
422 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | ||
416 | 423 | ||
417 | /* ----- HCI protocols ----- */ | 424 | /* ----- HCI protocols ----- */ |
418 | struct hci_proto { | 425 | struct hci_proto { |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index 7a483ab4022f..00ad810eb883 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -104,6 +104,7 @@ struct ieee80211softmac_assoc_info { | |||
104 | */ | 104 | */ |
105 | u8 static_essid:1, | 105 | u8 static_essid:1, |
106 | associating:1, | 106 | associating:1, |
107 | assoc_wait:1, | ||
107 | bssvalid:1, | 108 | bssvalid:1, |
108 | bssfixed:1; | 109 | bssfixed:1; |
109 | 110 | ||
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index a398ae5e30f9..ab29dafb1a6a 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -146,7 +146,7 @@ static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, | |||
146 | struct rt6_info *rt = (struct rt6_info *) dst; | 146 | struct rt6_info *rt = (struct rt6_info *) dst; |
147 | 147 | ||
148 | write_lock(&sk->sk_dst_lock); | 148 | write_lock(&sk->sk_dst_lock); |
149 | __sk_dst_set(sk, dst); | 149 | sk_setup_caps(sk, dst); |
150 | np->daddr_cache = daddr; | 150 | np->daddr_cache = daddr; |
151 | np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; | 151 | np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; |
152 | write_unlock(&sk->sk_dst_lock); | 152 | write_unlock(&sk->sk_dst_lock); |
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index 0575c59a5c96..bca19ca7bdd4 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h | |||
@@ -160,7 +160,7 @@ typedef struct { | |||
160 | int irq, irq2; /* Interrupts used */ | 160 | int irq, irq2; /* Interrupts used */ |
161 | int dma, dma2; /* DMA channel(s) used */ | 161 | int dma, dma2; /* DMA channel(s) used */ |
162 | int fifo_size; /* FIFO size */ | 162 | int fifo_size; /* FIFO size */ |
163 | int irqflags; /* interrupt flags (ie, SA_SHIRQ|SA_INTERRUPT) */ | 163 | int irqflags; /* interrupt flags (ie, IRQF_SHARED|IRQF_DISABLED) */ |
164 | int direction; /* Link direction, used by some FIR drivers */ | 164 | int direction; /* Link direction, used by some FIR drivers */ |
165 | int enabled; /* Powered on? */ | 165 | int enabled; /* Powered on? */ |
166 | int suspended; /* Suspended by APM */ | 166 | int suspended; /* Suspended by APM */ |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 75b5b9333fc7..1925c65e617b 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -169,17 +169,23 @@ psched_tod_diff(int delta_sec, int bound) | |||
169 | 169 | ||
170 | #define PSCHED_TADD2(tv, delta, tv_res) \ | 170 | #define PSCHED_TADD2(tv, delta, tv_res) \ |
171 | ({ \ | 171 | ({ \ |
172 | int __delta = (tv).tv_usec + (delta); \ | 172 | int __delta = (delta); \ |
173 | (tv_res).tv_sec = (tv).tv_sec; \ | 173 | (tv_res) = (tv); \ |
174 | if (__delta > USEC_PER_SEC) { (tv_res).tv_sec++; __delta -= USEC_PER_SEC; } \ | 174 | while(__delta >= USEC_PER_SEC){ \ |
175 | (tv_res).tv_sec++; \ | ||
176 | __delta -= USEC_PER_SEC; \ | ||
177 | } \ | ||
175 | (tv_res).tv_usec = __delta; \ | 178 | (tv_res).tv_usec = __delta; \ |
176 | }) | 179 | }) |
177 | 180 | ||
178 | #define PSCHED_TADD(tv, delta) \ | 181 | #define PSCHED_TADD(tv, delta) \ |
179 | ({ \ | 182 | ({ \ |
180 | (tv).tv_usec += (delta); \ | 183 | int __delta = (delta); \ |
181 | if ((tv).tv_usec > USEC_PER_SEC) { (tv).tv_sec++; \ | 184 | while(__delta >= USEC_PER_SEC){ \ |
182 | (tv).tv_usec -= USEC_PER_SEC; } \ | 185 | (tv).tv_sec++; \ |
186 | __delta -= USEC_PER_SEC; \ | ||
187 | } \ | ||
188 | (tv).tv_usec = __delta; \ | ||
183 | }) | 189 | }) |
184 | 190 | ||
185 | /* Set/check that time is in the "past perfect"; | 191 | /* Set/check that time is in the "past perfect"; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 3b6dc15c68a5..c643bce64e55 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -36,7 +36,9 @@ | |||
36 | struct net_protocol { | 36 | struct net_protocol { |
37 | int (*handler)(struct sk_buff *skb); | 37 | int (*handler)(struct sk_buff *skb); |
38 | void (*err_handler)(struct sk_buff *skb, u32 info); | 38 | void (*err_handler)(struct sk_buff *skb, u32 info); |
39 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); | 39 | int (*gso_send_check)(struct sk_buff *skb); |
40 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
41 | int features); | ||
40 | int no_policy; | 42 | int no_policy; |
41 | }; | 43 | }; |
42 | 44 | ||
@@ -49,11 +51,18 @@ struct inet6_protocol | |||
49 | struct inet6_skb_parm *opt, | 51 | struct inet6_skb_parm *opt, |
50 | int type, int code, int offset, | 52 | int type, int code, int offset, |
51 | __u32 info); | 53 | __u32 info); |
54 | |||
55 | int (*gso_send_check)(struct sk_buff *skb); | ||
56 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
57 | int features); | ||
58 | |||
52 | unsigned int flags; /* INET6_PROTO_xxx */ | 59 | unsigned int flags; /* INET6_PROTO_xxx */ |
53 | }; | 60 | }; |
54 | 61 | ||
55 | #define INET6_PROTO_NOPOLICY 0x1 | 62 | #define INET6_PROTO_NOPOLICY 0x1 |
56 | #define INET6_PROTO_FINAL 0x2 | 63 | #define INET6_PROTO_FINAL 0x2 |
64 | /* This should be set for any extension header which is compatible with GSO. */ | ||
65 | #define INET6_PROTO_GSO_EXTHDR 0x4 | ||
57 | #endif | 66 | #endif |
58 | 67 | ||
59 | /* This is used to register socket interfaces for IP protocols. */ | 68 | /* This is used to register socket interfaces for IP protocols. */ |
diff --git a/include/net/scm.h b/include/net/scm.h index 540619cb7160..02daa097cdcd 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -19,6 +19,10 @@ struct scm_cookie | |||
19 | { | 19 | { |
20 | struct ucred creds; /* Skb credentials */ | 20 | struct ucred creds; /* Skb credentials */ |
21 | struct scm_fp_list *fp; /* Passed files */ | 21 | struct scm_fp_list *fp; /* Passed files */ |
22 | #ifdef CONFIG_SECURITY_NETWORK | ||
23 | char *secdata; /* Security context */ | ||
24 | u32 seclen; /* Security length */ | ||
25 | #endif | ||
22 | unsigned long seq; /* Connection seqno */ | 26 | unsigned long seq; /* Connection seqno */ |
23 | }; | 27 | }; |
24 | 28 | ||
@@ -48,6 +52,17 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | |||
48 | return __scm_send(sock, msg, scm); | 52 | return __scm_send(sock, msg, scm); |
49 | } | 53 | } |
50 | 54 | ||
55 | #ifdef CONFIG_SECURITY_NETWORK | ||
56 | static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) | ||
57 | { | ||
58 | if (test_bit(SOCK_PASSSEC, &sock->flags) && scm->secdata != NULL) | ||
59 | put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, scm->seclen, scm->secdata); | ||
60 | } | ||
61 | #else | ||
62 | static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) | ||
63 | { } | ||
64 | #endif /* CONFIG_SECURITY_NETWORK */ | ||
65 | |||
51 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | 66 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, |
52 | struct scm_cookie *scm, int flags) | 67 | struct scm_cookie *scm, int flags) |
53 | { | 68 | { |
@@ -62,6 +77,8 @@ static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | |||
62 | if (test_bit(SOCK_PASSCRED, &sock->flags)) | 77 | if (test_bit(SOCK_PASSCRED, &sock->flags)) |
63 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds); | 78 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds); |
64 | 79 | ||
80 | scm_passec(sock, msg, scm); | ||
81 | |||
65 | if (!scm->fp) | 82 | if (!scm->fp) |
66 | return; | 83 | return; |
67 | 84 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index 2d8d6adf1616..324b3ea233d6 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/timer.h> | 44 | #include <linux/timer.h> |
45 | #include <linux/cache.h> | 45 | #include <linux/cache.h> |
46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
47 | #include <linux/lockdep.h> | ||
47 | #include <linux/netdevice.h> | 48 | #include <linux/netdevice.h> |
48 | #include <linux/skbuff.h> /* struct sk_buff */ | 49 | #include <linux/skbuff.h> /* struct sk_buff */ |
49 | #include <linux/security.h> | 50 | #include <linux/security.h> |
@@ -78,14 +79,17 @@ typedef struct { | |||
78 | spinlock_t slock; | 79 | spinlock_t slock; |
79 | struct sock_iocb *owner; | 80 | struct sock_iocb *owner; |
80 | wait_queue_head_t wq; | 81 | wait_queue_head_t wq; |
82 | /* | ||
83 | * We express the mutex-alike socket_lock semantics | ||
84 | * to the lock validator by explicitly managing | ||
85 | * the slock as a lock variant (in addition to | ||
86 | * the slock itself): | ||
87 | */ | ||
88 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
89 | struct lockdep_map dep_map; | ||
90 | #endif | ||
81 | } socket_lock_t; | 91 | } socket_lock_t; |
82 | 92 | ||
83 | #define sock_lock_init(__sk) \ | ||
84 | do { spin_lock_init(&((__sk)->sk_lock.slock)); \ | ||
85 | (__sk)->sk_lock.owner = NULL; \ | ||
86 | init_waitqueue_head(&((__sk)->sk_lock.wq)); \ | ||
87 | } while(0) | ||
88 | |||
89 | struct sock; | 93 | struct sock; |
90 | struct proto; | 94 | struct proto; |
91 | 95 | ||
@@ -140,6 +144,7 @@ struct sock_common { | |||
140 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings | 144 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings |
141 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets | 145 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets |
142 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) | 146 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) |
147 | * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) | ||
143 | * @sk_lingertime: %SO_LINGER l_linger setting | 148 | * @sk_lingertime: %SO_LINGER l_linger setting |
144 | * @sk_backlog: always used with the per-socket spinlock held | 149 | * @sk_backlog: always used with the per-socket spinlock held |
145 | * @sk_callback_lock: used with the callbacks in the end of this struct | 150 | * @sk_callback_lock: used with the callbacks in the end of this struct |
@@ -211,6 +216,7 @@ struct sock { | |||
211 | gfp_t sk_allocation; | 216 | gfp_t sk_allocation; |
212 | int sk_sndbuf; | 217 | int sk_sndbuf; |
213 | int sk_route_caps; | 218 | int sk_route_caps; |
219 | int sk_gso_type; | ||
214 | int sk_rcvlowat; | 220 | int sk_rcvlowat; |
215 | unsigned long sk_flags; | 221 | unsigned long sk_flags; |
216 | unsigned long sk_lingertime; | 222 | unsigned long sk_lingertime; |
@@ -383,7 +389,6 @@ enum sock_flags { | |||
383 | SOCK_USE_WRITE_QUEUE, /* whether to call sk->sk_write_space in sock_wfree */ | 389 | SOCK_USE_WRITE_QUEUE, /* whether to call sk->sk_write_space in sock_wfree */ |
384 | SOCK_DBG, /* %SO_DEBUG setting */ | 390 | SOCK_DBG, /* %SO_DEBUG setting */ |
385 | SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */ | 391 | SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */ |
386 | SOCK_NO_LARGESEND, /* whether to sent large segments or not */ | ||
387 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ | 392 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ |
388 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ | 393 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ |
389 | }; | 394 | }; |
@@ -746,6 +751,9 @@ extern void FASTCALL(release_sock(struct sock *sk)); | |||
746 | 751 | ||
747 | /* BH context may only use the following locking interface. */ | 752 | /* BH context may only use the following locking interface. */ |
748 | #define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) | 753 | #define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) |
754 | #define bh_lock_sock_nested(__sk) \ | ||
755 | spin_lock_nested(&((__sk)->sk_lock.slock), \ | ||
756 | SINGLE_DEPTH_NESTING) | ||
749 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 757 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
750 | 758 | ||
751 | extern struct sock *sk_alloc(int family, | 759 | extern struct sock *sk_alloc(int family, |
@@ -1026,15 +1034,20 @@ extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); | |||
1026 | 1034 | ||
1027 | extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); | 1035 | extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); |
1028 | 1036 | ||
1037 | static inline int sk_can_gso(const struct sock *sk) | ||
1038 | { | ||
1039 | return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); | ||
1040 | } | ||
1041 | |||
1029 | static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) | 1042 | static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) |
1030 | { | 1043 | { |
1031 | __sk_dst_set(sk, dst); | 1044 | __sk_dst_set(sk, dst); |
1032 | sk->sk_route_caps = dst->dev->features; | 1045 | sk->sk_route_caps = dst->dev->features; |
1033 | if (sk->sk_route_caps & NETIF_F_GSO) | 1046 | if (sk->sk_route_caps & NETIF_F_GSO) |
1034 | sk->sk_route_caps |= NETIF_F_TSO; | 1047 | sk->sk_route_caps |= NETIF_F_GSO_MASK; |
1035 | if (sk->sk_route_caps & NETIF_F_TSO) { | 1048 | if (sk_can_gso(sk)) { |
1036 | if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len) | 1049 | if (dst->header_len) |
1037 | sk->sk_route_caps &= ~NETIF_F_TSO; | 1050 | sk->sk_route_caps &= ~NETIF_F_GSO_MASK; |
1038 | else | 1051 | else |
1039 | sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM; | 1052 | sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM; |
1040 | } | 1053 | } |
diff --git a/include/net/tcp.h b/include/net/tcp.h index ca3d38dfc00b..0720bddff1e9 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -751,7 +751,7 @@ static inline int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight) | |||
751 | if (in_flight >= tp->snd_cwnd) | 751 | if (in_flight >= tp->snd_cwnd) |
752 | return 1; | 752 | return 1; |
753 | 753 | ||
754 | if (!(sk->sk_route_caps & NETIF_F_TSO)) | 754 | if (!sk_can_gso(sk)) |
755 | return 0; | 755 | return 0; |
756 | 756 | ||
757 | left = tp->snd_cwnd - in_flight; | 757 | left = tp->snd_cwnd - in_flight; |
@@ -1086,7 +1086,8 @@ extern struct request_sock_ops tcp_request_sock_ops; | |||
1086 | 1086 | ||
1087 | extern int tcp_v4_destroy_sock(struct sock *sk); | 1087 | extern int tcp_v4_destroy_sock(struct sock *sk); |
1088 | 1088 | ||
1089 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg); | 1089 | extern int tcp_v4_gso_send_check(struct sk_buff *skb); |
1090 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); | ||
1090 | 1091 | ||
1091 | #ifdef CONFIG_PROC_FS | 1092 | #ifdef CONFIG_PROC_FS |
1092 | extern int tcp4_proc_init(void); | 1093 | extern int tcp4_proc_init(void); |
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index c6b84397448d..4629d77173f2 100644 --- a/include/net/tcp_ecn.h +++ b/include/net/tcp_ecn.h | |||
@@ -31,10 +31,9 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp, | |||
31 | struct sk_buff *skb) | 31 | struct sk_buff *skb) |
32 | { | 32 | { |
33 | tp->ecn_flags = 0; | 33 | tp->ecn_flags = 0; |
34 | if (sysctl_tcp_ecn && !(sk->sk_route_caps & NETIF_F_TSO)) { | 34 | if (sysctl_tcp_ecn) { |
35 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; | 35 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; |
36 | tp->ecn_flags = TCP_ECN_OK; | 36 | tp->ecn_flags = TCP_ECN_OK; |
37 | sock_set_flag(sk, SOCK_NO_LARGESEND); | ||
38 | } | 37 | } |
39 | } | 38 | } |
40 | 39 | ||
@@ -56,6 +55,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp, | |||
56 | if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) { | 55 | if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) { |
57 | tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; | 56 | tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; |
58 | skb->h.th->cwr = 1; | 57 | skb->h.th->cwr = 1; |
58 | skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN; | ||
59 | } | 59 | } |
60 | } else { | 60 | } else { |
61 | /* ACK or retransmitted segment: clear ECT|CE */ | 61 | /* ACK or retransmitted segment: clear ECT|CE */ |
diff --git a/include/rdma/Kbuild b/include/rdma/Kbuild new file mode 100644 index 000000000000..eb710ba9b1a0 --- /dev/null +++ b/include/rdma/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y := ib_user_mad.h | |||
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild new file mode 100644 index 000000000000..14a033d73314 --- /dev/null +++ b/include/scsi/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y += scsi.h | ||
2 | unifdef-y := scsi_ioctl.h sg.h | ||
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 253797c60095..55ebf035e620 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -47,10 +47,19 @@ enum iscsi_uevent_e { | |||
47 | ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13, | 47 | ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13, |
48 | ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14, | 48 | ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14, |
49 | 49 | ||
50 | ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, | ||
51 | |||
50 | /* up events */ | 52 | /* up events */ |
51 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 53 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
52 | ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, | 54 | ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, |
53 | ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3, | 55 | ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3, |
56 | ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4, | ||
57 | }; | ||
58 | |||
59 | enum iscsi_tgt_dscvr { | ||
60 | ISCSI_TGT_DSCVR_SEND_TARGETS = 1, | ||
61 | ISCSI_TGT_DSCVR_ISNS = 2, | ||
62 | ISCSI_TGT_DSCVR_SLP = 3, | ||
54 | }; | 63 | }; |
55 | 64 | ||
56 | struct iscsi_uevent { | 65 | struct iscsi_uevent { |
@@ -116,6 +125,17 @@ struct iscsi_uevent { | |||
116 | struct msg_transport_disconnect { | 125 | struct msg_transport_disconnect { |
117 | uint64_t ep_handle; | 126 | uint64_t ep_handle; |
118 | } ep_disconnect; | 127 | } ep_disconnect; |
128 | struct msg_tgt_dscvr { | ||
129 | enum iscsi_tgt_dscvr type; | ||
130 | uint32_t host_no; | ||
131 | /* | ||
132 | * enable = 1 to establish a new connection | ||
133 | * with the server. enable = 0 to disconnect | ||
134 | * from the server. Used primarily to switch | ||
135 | * from one iSNS server to another. | ||
136 | */ | ||
137 | uint32_t enable; | ||
138 | } tgt_dscvr; | ||
119 | } u; | 139 | } u; |
120 | union { | 140 | union { |
121 | /* messages k -> u */ | 141 | /* messages k -> u */ |
@@ -138,6 +158,10 @@ struct iscsi_uevent { | |||
138 | uint32_t cid; | 158 | uint32_t cid; |
139 | uint32_t error; /* enum iscsi_err */ | 159 | uint32_t error; /* enum iscsi_err */ |
140 | } connerror; | 160 | } connerror; |
161 | struct msg_session_destroyed { | ||
162 | uint32_t host_no; | ||
163 | uint32_t sid; | ||
164 | } d_session; | ||
141 | struct msg_transport_connect_ret { | 165 | struct msg_transport_connect_ret { |
142 | uint64_t handle; | 166 | uint64_t handle; |
143 | } ep_connect_ret; | 167 | } ep_connect_ret; |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index cbf7e58bd6f9..ba2760802ded 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -157,6 +157,11 @@ struct iscsi_conn { | |||
157 | int max_xmit_dlength; /* target_max_recv_dsl */ | 157 | int max_xmit_dlength; /* target_max_recv_dsl */ |
158 | int hdrdgst_en; | 158 | int hdrdgst_en; |
159 | int datadgst_en; | 159 | int datadgst_en; |
160 | int ifmarker_en; | ||
161 | int ofmarker_en; | ||
162 | /* values userspace uses to id a conn */ | ||
163 | int persistent_port; | ||
164 | char *persistent_address; | ||
160 | 165 | ||
161 | /* MIB-statistics */ | 166 | /* MIB-statistics */ |
162 | uint64_t txdata_octets; | 167 | uint64_t txdata_octets; |
@@ -196,8 +201,8 @@ struct iscsi_session { | |||
196 | int pdu_inorder_en; | 201 | int pdu_inorder_en; |
197 | int dataseq_inorder_en; | 202 | int dataseq_inorder_en; |
198 | int erl; | 203 | int erl; |
199 | int ifmarker_en; | 204 | int tpgt; |
200 | int ofmarker_en; | 205 | char *targetname; |
201 | 206 | ||
202 | /* control data */ | 207 | /* control data */ |
203 | struct iscsi_transport *tt; | 208 | struct iscsi_transport *tt; |
@@ -240,6 +245,10 @@ iscsi_session_setup(struct iscsi_transport *, struct scsi_transport_template *, | |||
240 | extern void iscsi_session_teardown(struct iscsi_cls_session *); | 245 | extern void iscsi_session_teardown(struct iscsi_cls_session *); |
241 | extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *); | 246 | extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *); |
242 | extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); | 247 | extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); |
248 | extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn, | ||
249 | enum iscsi_param param, char *buf, int buflen); | ||
250 | extern int iscsi_session_get_param(struct iscsi_cls_session *cls_session, | ||
251 | enum iscsi_param param, char *buf); | ||
243 | 252 | ||
244 | #define session_to_cls(_sess) \ | 253 | #define session_to_cls(_sess) \ |
245 | hostdata_session(_sess->host->hostdata) | 254 | hostdata_session(_sess->host->hostdata) |
@@ -255,6 +264,8 @@ extern void iscsi_conn_stop(struct iscsi_cls_conn *, int); | |||
255 | extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, | 264 | extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, |
256 | int); | 265 | int); |
257 | extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); | 266 | extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); |
267 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, | ||
268 | enum iscsi_param param, char *buf); | ||
258 | 269 | ||
259 | /* | 270 | /* |
260 | * pdu and task processing | 271 | * pdu and task processing |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index e46cd404bd7d..371f70d9aa92 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -143,7 +143,7 @@ struct scsi_cmnd { | |||
143 | 143 | ||
144 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); | 144 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); |
145 | extern void scsi_put_command(struct scsi_cmnd *); | 145 | extern void scsi_put_command(struct scsi_cmnd *); |
146 | extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); | 146 | extern void scsi_io_completion(struct scsi_cmnd *, unsigned int); |
147 | extern void scsi_finish_command(struct scsi_cmnd *cmd); | 147 | extern void scsi_finish_command(struct scsi_cmnd *cmd); |
148 | extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd); | 148 | extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd); |
149 | 149 | ||
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index a42efd6e4be8..b3dd90f3e858 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -542,6 +542,9 @@ struct Scsi_Host { | |||
542 | */ | 542 | */ |
543 | unsigned ordered_tag:1; | 543 | unsigned ordered_tag:1; |
544 | 544 | ||
545 | /* task mgmt function in progress */ | ||
546 | unsigned tmf_in_progress:1; | ||
547 | |||
545 | /* | 548 | /* |
546 | * Optional work queue to be utilized by the transport | 549 | * Optional work queue to be utilized by the transport |
547 | */ | 550 | */ |
@@ -619,7 +622,8 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost) | |||
619 | { | 622 | { |
620 | return shost->shost_state == SHOST_RECOVERY || | 623 | return shost->shost_state == SHOST_RECOVERY || |
621 | shost->shost_state == SHOST_CANCEL_RECOVERY || | 624 | shost->shost_state == SHOST_CANCEL_RECOVERY || |
622 | shost->shost_state == SHOST_DEL_RECOVERY; | 625 | shost->shost_state == SHOST_DEL_RECOVERY || |
626 | shost->tmf_in_progress; | ||
623 | } | 627 | } |
624 | 628 | ||
625 | extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); | 629 | extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index b684426a5900..5a3df1d7085f 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -34,6 +34,7 @@ struct iscsi_cls_conn; | |||
34 | struct iscsi_conn; | 34 | struct iscsi_conn; |
35 | struct iscsi_cmd_task; | 35 | struct iscsi_cmd_task; |
36 | struct iscsi_mgmt_task; | 36 | struct iscsi_mgmt_task; |
37 | struct sockaddr; | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * struct iscsi_transport - iSCSI Transport template | 40 | * struct iscsi_transport - iSCSI Transport template |
@@ -46,7 +47,12 @@ struct iscsi_mgmt_task; | |||
46 | * @bind_conn: associate this connection with existing iSCSI session | 47 | * @bind_conn: associate this connection with existing iSCSI session |
47 | * and specified transport descriptor | 48 | * and specified transport descriptor |
48 | * @destroy_conn: destroy inactive iSCSI connection | 49 | * @destroy_conn: destroy inactive iSCSI connection |
49 | * @set_param: set iSCSI Data-Path operational parameter | 50 | * @set_param: set iSCSI parameter. Return 0 on success, -ENODATA |
51 | * when param is not supported, and a -Exx value on other | ||
52 | * error. | ||
53 | * @get_param get iSCSI parameter. Must return number of bytes | ||
54 | * copied to buffer on success, -ENODATA when param | ||
55 | * is not supported, and a -Exx value on other error | ||
50 | * @start_conn: set connection to be operational | 56 | * @start_conn: set connection to be operational |
51 | * @stop_conn: suspend/recover/terminate connection | 57 | * @stop_conn: suspend/recover/terminate connection |
52 | * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. | 58 | * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. |
@@ -97,15 +103,11 @@ struct iscsi_transport { | |||
97 | void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); | 103 | void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); |
98 | void (*destroy_conn) (struct iscsi_cls_conn *conn); | 104 | void (*destroy_conn) (struct iscsi_cls_conn *conn); |
99 | int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, | 105 | int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, |
100 | uint32_t value); | 106 | char *buf, int buflen); |
101 | int (*get_conn_param) (struct iscsi_cls_conn *conn, | 107 | int (*get_conn_param) (struct iscsi_cls_conn *conn, |
102 | enum iscsi_param param, uint32_t *value); | 108 | enum iscsi_param param, char *buf); |
103 | int (*get_session_param) (struct iscsi_cls_session *session, | 109 | int (*get_session_param) (struct iscsi_cls_session *session, |
104 | enum iscsi_param param, uint32_t *value); | 110 | enum iscsi_param param, char *buf); |
105 | int (*get_conn_str_param) (struct iscsi_cls_conn *conn, | ||
106 | enum iscsi_param param, char *buf); | ||
107 | int (*get_session_str_param) (struct iscsi_cls_session *session, | ||
108 | enum iscsi_param param, char *buf); | ||
109 | int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 111 | int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
110 | char *data, uint32_t data_size); | 112 | char *data, uint32_t data_size); |
111 | void (*get_stats) (struct iscsi_cls_conn *conn, | 113 | void (*get_stats) (struct iscsi_cls_conn *conn, |
@@ -127,6 +129,8 @@ struct iscsi_transport { | |||
127 | uint64_t *ep_handle); | 129 | uint64_t *ep_handle); |
128 | int (*ep_poll) (uint64_t ep_handle, int timeout_ms); | 130 | int (*ep_poll) (uint64_t ep_handle, int timeout_ms); |
129 | void (*ep_disconnect) (uint64_t ep_handle); | 131 | void (*ep_disconnect) (uint64_t ep_handle); |
132 | int (*tgt_dscvr) (enum iscsi_tgt_dscvr type, uint32_t host_no, | ||
133 | uint32_t enable, struct sockaddr *dst_addr); | ||
130 | }; | 134 | }; |
131 | 135 | ||
132 | /* | 136 | /* |
@@ -155,13 +159,6 @@ struct iscsi_cls_conn { | |||
155 | struct iscsi_transport *transport; | 159 | struct iscsi_transport *transport; |
156 | uint32_t cid; /* connection id */ | 160 | uint32_t cid; /* connection id */ |
157 | 161 | ||
158 | /* portal/group values we got during discovery */ | ||
159 | char *persistent_address; | ||
160 | int persistent_port; | ||
161 | /* portal/group values we are currently using */ | ||
162 | char *address; | ||
163 | int port; | ||
164 | |||
165 | int active; /* must be accessed with the connlock */ | 162 | int active; /* must be accessed with the connlock */ |
166 | struct device dev; /* sysfs transport/container device */ | 163 | struct device dev; /* sysfs transport/container device */ |
167 | struct mempool_zone *z_error; | 164 | struct mempool_zone *z_error; |
@@ -185,16 +182,11 @@ struct iscsi_cls_session { | |||
185 | struct list_head host_list; | 182 | struct list_head host_list; |
186 | struct iscsi_transport *transport; | 183 | struct iscsi_transport *transport; |
187 | 184 | ||
188 | /* iSCSI values used as unique id by userspace. */ | ||
189 | char *targetname; | ||
190 | int tpgt; | ||
191 | |||
192 | /* recovery fields */ | 185 | /* recovery fields */ |
193 | int recovery_tmo; | 186 | int recovery_tmo; |
194 | struct work_struct recovery_work; | 187 | struct work_struct recovery_work; |
195 | 188 | ||
196 | int target_id; | 189 | int target_id; |
197 | int channel; | ||
198 | 190 | ||
199 | int sid; /* session id */ | 191 | int sid; /* session id */ |
200 | void *dd_data; /* LLD private data */ | 192 | void *dd_data; /* LLD private data */ |
@@ -207,8 +199,10 @@ struct iscsi_cls_session { | |||
207 | #define iscsi_session_to_shost(_session) \ | 199 | #define iscsi_session_to_shost(_session) \ |
208 | dev_to_shost(_session->dev.parent) | 200 | dev_to_shost(_session->dev.parent) |
209 | 201 | ||
202 | #define starget_to_session(_stgt) \ | ||
203 | iscsi_dev_to_session(_stgt->dev.parent) | ||
204 | |||
210 | struct iscsi_host { | 205 | struct iscsi_host { |
211 | int next_target_id; | ||
212 | struct list_head sessions; | 206 | struct list_head sessions; |
213 | struct mutex mutex; | 207 | struct mutex mutex; |
214 | }; | 208 | }; |
@@ -216,8 +210,17 @@ struct iscsi_host { | |||
216 | /* | 210 | /* |
217 | * session and connection functions that can be used by HW iSCSI LLDs | 211 | * session and connection functions that can be used by HW iSCSI LLDs |
218 | */ | 212 | */ |
213 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, | ||
214 | struct iscsi_transport *transport); | ||
215 | extern int iscsi_add_session(struct iscsi_cls_session *session, | ||
216 | unsigned int target_id); | ||
217 | extern int iscsi_if_create_session_done(struct iscsi_cls_conn *conn); | ||
218 | extern int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn); | ||
219 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, | 219 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, |
220 | struct iscsi_transport *t, int channel); | 220 | struct iscsi_transport *t, |
221 | unsigned int target_id); | ||
222 | extern void iscsi_remove_session(struct iscsi_cls_session *session); | ||
223 | extern void iscsi_free_session(struct iscsi_cls_session *session); | ||
221 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); | 224 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); |
222 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, | 225 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, |
223 | uint32_t cid); | 226 | uint32_t cid); |
@@ -225,4 +228,5 @@ extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); | |||
225 | extern void iscsi_unblock_session(struct iscsi_cls_session *session); | 228 | extern void iscsi_unblock_session(struct iscsi_cls_session *session); |
226 | extern void iscsi_block_session(struct iscsi_cls_session *session); | 229 | extern void iscsi_block_session(struct iscsi_cls_session *session); |
227 | 230 | ||
231 | |||
228 | #endif | 232 | #endif |
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index 93cfb4bf4211..e3c503cd175e 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/transport_class.h> | 4 | #include <linux/transport_class.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/mutex.h> | ||
6 | 7 | ||
7 | struct scsi_transport_template; | 8 | struct scsi_transport_template; |
8 | struct sas_rphy; | 9 | struct sas_rphy; |
@@ -55,7 +56,6 @@ struct sas_phy { | |||
55 | enum sas_linkrate minimum_linkrate; | 56 | enum sas_linkrate minimum_linkrate; |
56 | enum sas_linkrate maximum_linkrate_hw; | 57 | enum sas_linkrate maximum_linkrate_hw; |
57 | enum sas_linkrate maximum_linkrate; | 58 | enum sas_linkrate maximum_linkrate; |
58 | u8 port_identifier; | ||
59 | 59 | ||
60 | /* internal state */ | 60 | /* internal state */ |
61 | unsigned int local_attached : 1; | 61 | unsigned int local_attached : 1; |
@@ -66,8 +66,8 @@ struct sas_phy { | |||
66 | u32 loss_of_dword_sync_count; | 66 | u32 loss_of_dword_sync_count; |
67 | u32 phy_reset_problem_count; | 67 | u32 phy_reset_problem_count; |
68 | 68 | ||
69 | /* the other end of the link */ | 69 | /* for the list of phys belonging to a port */ |
70 | struct sas_rphy *rphy; | 70 | struct list_head port_siblings; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | #define dev_to_phy(d) \ | 73 | #define dev_to_phy(d) \ |
@@ -124,6 +124,24 @@ struct sas_expander_device { | |||
124 | #define rphy_to_expander_device(r) \ | 124 | #define rphy_to_expander_device(r) \ |
125 | container_of((r), struct sas_expander_device, rphy) | 125 | container_of((r), struct sas_expander_device, rphy) |
126 | 126 | ||
127 | struct sas_port { | ||
128 | struct device dev; | ||
129 | |||
130 | u8 port_identifier; | ||
131 | int num_phys; | ||
132 | |||
133 | /* the other end of the link */ | ||
134 | struct sas_rphy *rphy; | ||
135 | |||
136 | struct mutex phy_list_mutex; | ||
137 | struct list_head phy_list; | ||
138 | }; | ||
139 | |||
140 | #define dev_to_sas_port(d) \ | ||
141 | container_of((d), struct sas_port, dev) | ||
142 | #define transport_class_to_sas_port(cdev) \ | ||
143 | dev_to_sas_port((cdev)->dev) | ||
144 | |||
127 | /* The functions by which the transport class and the driver communicate */ | 145 | /* The functions by which the transport class and the driver communicate */ |
128 | struct sas_function_template { | 146 | struct sas_function_template { |
129 | int (*get_linkerrors)(struct sas_phy *); | 147 | int (*get_linkerrors)(struct sas_phy *); |
@@ -133,6 +151,7 @@ struct sas_function_template { | |||
133 | }; | 151 | }; |
134 | 152 | ||
135 | 153 | ||
154 | void sas_remove_children(struct device *); | ||
136 | extern void sas_remove_host(struct Scsi_Host *); | 155 | extern void sas_remove_host(struct Scsi_Host *); |
137 | 156 | ||
138 | extern struct sas_phy *sas_phy_alloc(struct device *, int); | 157 | extern struct sas_phy *sas_phy_alloc(struct device *, int); |
@@ -141,13 +160,21 @@ extern int sas_phy_add(struct sas_phy *); | |||
141 | extern void sas_phy_delete(struct sas_phy *); | 160 | extern void sas_phy_delete(struct sas_phy *); |
142 | extern int scsi_is_sas_phy(const struct device *); | 161 | extern int scsi_is_sas_phy(const struct device *); |
143 | 162 | ||
144 | extern struct sas_rphy *sas_end_device_alloc(struct sas_phy *); | 163 | extern struct sas_rphy *sas_end_device_alloc(struct sas_port *); |
145 | extern struct sas_rphy *sas_expander_alloc(struct sas_phy *, enum sas_device_type); | 164 | extern struct sas_rphy *sas_expander_alloc(struct sas_port *, enum sas_device_type); |
146 | void sas_rphy_free(struct sas_rphy *); | 165 | void sas_rphy_free(struct sas_rphy *); |
147 | extern int sas_rphy_add(struct sas_rphy *); | 166 | extern int sas_rphy_add(struct sas_rphy *); |
148 | extern void sas_rphy_delete(struct sas_rphy *); | 167 | extern void sas_rphy_delete(struct sas_rphy *); |
149 | extern int scsi_is_sas_rphy(const struct device *); | 168 | extern int scsi_is_sas_rphy(const struct device *); |
150 | 169 | ||
170 | struct sas_port *sas_port_alloc(struct device *, int); | ||
171 | int sas_port_add(struct sas_port *); | ||
172 | void sas_port_free(struct sas_port *); | ||
173 | void sas_port_delete(struct sas_port *); | ||
174 | void sas_port_add_phy(struct sas_port *, struct sas_phy *); | ||
175 | void sas_port_delete_phy(struct sas_port *, struct sas_phy *); | ||
176 | int scsi_is_sas_port(const struct device *); | ||
177 | |||
151 | extern struct scsi_transport_template * | 178 | extern struct scsi_transport_template * |
152 | sas_attach_transport(struct sas_function_template *); | 179 | sas_attach_transport(struct sas_function_template *); |
153 | extern void sas_release_transport(struct scsi_transport_template *); | 180 | extern void sas_release_transport(struct scsi_transport_template *); |
diff --git a/include/sound/Kbuild b/include/sound/Kbuild new file mode 100644 index 000000000000..3a5a3df61496 --- /dev/null +++ b/include/sound/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y := asound_fm.h hdsp.h hdspm.h sfnt_info.h sscape_ioctl.h | ||
2 | unifdef-y := asequencer.h asound.h emu10k1.h sb16_csp.h | ||
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 446afc3ea27f..758f8bf133c7 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -265,6 +265,7 @@ | |||
265 | 265 | ||
266 | /* specific - Analog Devices */ | 266 | /* specific - Analog Devices */ |
267 | #define AC97_AD_TEST 0x5a /* test register */ | 267 | #define AC97_AD_TEST 0x5a /* test register */ |
268 | #define AC97_AD_TEST2 0x5c /* undocumented test register 2 */ | ||
268 | #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ | 269 | #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ |
269 | #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ | 270 | #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ |
270 | #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ | 271 | #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ |
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h index 3bf5911fe827..3d9888492026 100644 --- a/include/sound/ak4xxx-adda.h +++ b/include/sound/ak4xxx-adda.h | |||
@@ -32,8 +32,8 @@ struct snd_akm4xxx; | |||
32 | struct snd_ak4xxx_ops { | 32 | struct snd_ak4xxx_ops { |
33 | void (*lock)(struct snd_akm4xxx *ak, int chip); | 33 | void (*lock)(struct snd_akm4xxx *ak, int chip); |
34 | void (*unlock)(struct snd_akm4xxx *ak, int chip); | 34 | void (*unlock)(struct snd_akm4xxx *ak, int chip); |
35 | void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); | 35 | void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, |
36 | // unsigned char (*read)(struct snd_akm4xxx *ak, int chip, unsigned char reg); | 36 | unsigned char val); |
37 | void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); | 37 | void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); |
38 | }; | 38 | }; |
39 | 39 | ||
@@ -41,29 +41,40 @@ struct snd_ak4xxx_ops { | |||
41 | 41 | ||
42 | struct snd_akm4xxx { | 42 | struct snd_akm4xxx { |
43 | struct snd_card *card; | 43 | struct snd_card *card; |
44 | unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ | 44 | unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ |
45 | unsigned int num_dacs; /* AK4524 or AK4528 DACs */ | 45 | unsigned int num_dacs; /* AK4524 or AK4528 DACs */ |
46 | unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ | 46 | unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ |
47 | unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image for IPGA (AK4528) */ | 47 | unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image |
48 | * for IPGA (AK4528) | ||
49 | */ | ||
48 | unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */ | 50 | unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */ |
49 | void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */ | 51 | void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */ |
50 | /* template should fill the following fields */ | 52 | /* template should fill the following fields */ |
51 | unsigned int idx_offset; /* control index offset */ | 53 | unsigned int idx_offset; /* control index offset */ |
52 | enum { | 54 | enum { |
53 | SND_AK4524, SND_AK4528, SND_AK4529, | 55 | SND_AK4524, SND_AK4528, SND_AK4529, |
54 | SND_AK4355, SND_AK4358, SND_AK4381 | 56 | SND_AK4355, SND_AK4358, SND_AK4381 |
55 | } type; | 57 | } type; |
58 | unsigned int *num_stereo; /* array of combined counts | ||
59 | * for the mixer | ||
60 | */ | ||
61 | char **channel_names; /* array of mixer channel names */ | ||
56 | struct snd_ak4xxx_ops ops; | 62 | struct snd_ak4xxx_ops ops; |
57 | }; | 63 | }; |
58 | 64 | ||
59 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); | 65 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, |
66 | unsigned char val); | ||
60 | void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state); | 67 | void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state); |
61 | void snd_akm4xxx_init(struct snd_akm4xxx *ak); | 68 | void snd_akm4xxx_init(struct snd_akm4xxx *ak); |
62 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak); | 69 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak); |
63 | 70 | ||
64 | #define snd_akm4xxx_get(ak,chip,reg) (ak)->images[(chip) * 16 + (reg)] | 71 | #define snd_akm4xxx_get(ak,chip,reg) \ |
65 | #define snd_akm4xxx_set(ak,chip,reg,val) ((ak)->images[(chip) * 16 + (reg)] = (val)) | 72 | (ak)->images[(chip) * 16 + (reg)] |
66 | #define snd_akm4xxx_get_ipga(ak,chip,reg) (ak)->ipga_gain[chip][(reg)-4] | 73 | #define snd_akm4xxx_set(ak,chip,reg,val) \ |
67 | #define snd_akm4xxx_set_ipga(ak,chip,reg,val) ((ak)->ipga_gain[chip][(reg)-4] = (val)) | 74 | ((ak)->images[(chip) * 16 + (reg)] = (val)) |
75 | #define snd_akm4xxx_get_ipga(ak,chip,reg) \ | ||
76 | (ak)->ipga_gain[chip][(reg)-4] | ||
77 | #define snd_akm4xxx_set_ipga(ak,chip,reg,val) \ | ||
78 | ((ak)->ipga_gain[chip][(reg)-4] = (val)) | ||
68 | 79 | ||
69 | #endif /* __SOUND_AK4XXX_ADDA_H */ | 80 | #endif /* __SOUND_AK4XXX_ADDA_H */ |
diff --git a/include/sound/core.h b/include/sound/core.h index 5d184be0ff72..bab3ff457e40 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -188,8 +188,6 @@ struct snd_minor { | |||
188 | int device; /* device number */ | 188 | int device; /* device number */ |
189 | const struct file_operations *f_ops; /* file operations */ | 189 | const struct file_operations *f_ops; /* file operations */ |
190 | void *private_data; /* private data for f_ops->open */ | 190 | void *private_data; /* private data for f_ops->open */ |
191 | char name[0]; /* device name (keep at the end of | ||
192 | structure) */ | ||
193 | }; | 191 | }; |
194 | 192 | ||
195 | /* sound.c */ | 193 | /* sound.c */ |
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h index 80b2979c0cba..685928e6f65a 100644 --- a/include/sound/cs46xx.h +++ b/include/sound/cs46xx.h | |||
@@ -1704,6 +1704,7 @@ struct snd_cs46xx { | |||
1704 | int acpi_port; | 1704 | int acpi_port; |
1705 | struct snd_kcontrol *eapd_switch; /* for amplifier hack */ | 1705 | struct snd_kcontrol *eapd_switch; /* for amplifier hack */ |
1706 | int accept_valid; /* accept mmap valid (for OSS) */ | 1706 | int accept_valid; /* accept mmap valid (for OSS) */ |
1707 | int in_suspend; | ||
1707 | 1708 | ||
1708 | struct gameport *gameport; | 1709 | struct gameport *gameport; |
1709 | 1710 | ||
diff --git a/include/sound/initval.h b/include/sound/initval.h index d29e3d31d149..2ae76efc696f 100644 --- a/include/sound/initval.h +++ b/include/sound/initval.h | |||
@@ -62,7 +62,8 @@ static int snd_legacy_find_free_irq(int *irq_table) | |||
62 | { | 62 | { |
63 | while (*irq_table != -1) { | 63 | while (*irq_table != -1) { |
64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, | 64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, |
65 | SA_INTERRUPT, "ALSA Test IRQ", (void *) irq_table)) { | 65 | IRQF_DISABLED | IRQF_PROBE_SHARED, "ALSA Test IRQ", |
66 | (void *) irq_table)) { | ||
66 | free_irq(*irq_table, (void *) irq_table); | 67 | free_irq(*irq_table, (void *) irq_table); |
67 | return *irq_table; | 68 | return *irq_table; |
68 | } | 69 | } |
diff --git a/include/video/Kbuild b/include/video/Kbuild new file mode 100644 index 000000000000..76a60737cc15 --- /dev/null +++ b/include/video/Kbuild | |||
@@ -0,0 +1 @@ | |||
unifdef-y := sisfb.h | |||