diff options
Diffstat (limited to 'include')
30 files changed, 179 insertions, 162 deletions
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/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/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-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-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-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-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/irq.h b/include/asm-powerpc/irq.h index e05754752028..d903a62959da 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -83,25 +83,24 @@ struct irq_host_ops { | |||
83 | int (*match)(struct irq_host *h, struct device_node *node); | 83 | int (*match)(struct irq_host *h, struct device_node *node); |
84 | 84 | ||
85 | /* Create or update a mapping between a virtual irq number and a hw | 85 | /* Create or update a mapping between a virtual irq number and a hw |
86 | * irq number. This can be called several times for the same mapping | 86 | * irq number. This is called only once for a given mapping. |
87 | * but with different flags, though unmap shall always be called | ||
88 | * before the virq->hw mapping is changed. | ||
89 | */ | 87 | */ |
90 | int (*map)(struct irq_host *h, unsigned int virq, | 88 | int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw); |
91 | irq_hw_number_t hw, unsigned int flags); | ||
92 | 89 | ||
93 | /* Dispose of such a mapping */ | 90 | /* Dispose of such a mapping */ |
94 | void (*unmap)(struct irq_host *h, unsigned int virq); | 91 | void (*unmap)(struct irq_host *h, unsigned int virq); |
95 | 92 | ||
96 | /* Translate device-tree interrupt specifier from raw format coming | 93 | /* Translate device-tree interrupt specifier from raw format coming |
97 | * from the firmware to a irq_hw_number_t (interrupt line number) and | 94 | * from the firmware to a irq_hw_number_t (interrupt line number) and |
98 | * trigger flags that can be passed to irq_create_mapping(). | 95 | * type (sense) that can be passed to set_irq_type(). In the absence |
99 | * If no translation is provided, raw format is assumed to be one cell | 96 | * of this callback, irq_create_of_mapping() and irq_of_parse_and_map() |
100 | * for interrupt line and default sense. | 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) | ||
101 | */ | 100 | */ |
102 | int (*xlate)(struct irq_host *h, struct device_node *ctrler, | 101 | int (*xlate)(struct irq_host *h, struct device_node *ctrler, |
103 | u32 *intspec, unsigned int intsize, | 102 | u32 *intspec, unsigned int intsize, |
104 | irq_hw_number_t *out_hwirq, unsigned int *out_flags); | 103 | irq_hw_number_t *out_hwirq, unsigned int *out_type); |
105 | }; | 104 | }; |
106 | 105 | ||
107 | struct irq_host { | 106 | struct irq_host { |
@@ -193,25 +192,14 @@ extern void irq_set_virq_count(unsigned int count); | |||
193 | * irq_create_mapping - Map a hardware interrupt into linux virq space | 192 | * irq_create_mapping - Map a hardware interrupt into linux virq space |
194 | * @host: host owning this hardware interrupt or NULL for default host | 193 | * @host: host owning this hardware interrupt or NULL for default host |
195 | * @hwirq: hardware irq number in that host space | 194 | * @hwirq: hardware irq number in that host space |
196 | * @flags: flags passed to the controller. contains the trigger type among | ||
197 | * others. Use IRQ_TYPE_* defined in include/linux/irq.h | ||
198 | * | 195 | * |
199 | * Only one mapping per hardware interrupt is permitted. Returns a linux | 196 | * Only one mapping per hardware interrupt is permitted. Returns a linux |
200 | * virq number. The flags can be used to provide sense information to the | 197 | * virq number. |
201 | * controller (typically extracted from the device-tree). If no information | 198 | * If the sense/trigger is to be specified, set_irq_type() should be called |
202 | * is passed, the controller defaults will apply (for example, xics can only | 199 | * on the number returned from that call. |
203 | * do edge so flags are irrelevant for some pseries specific irqs). | ||
204 | * | ||
205 | * The device-tree generally contains the trigger info in an encoding that is | ||
206 | * specific to a given type of controller. In that case, you can directly use | ||
207 | * host->ops->trigger_xlate() to translate that. | ||
208 | * | ||
209 | * It is recommended that new PICs that don't have existing OF bindings chose | ||
210 | * to use a representation of triggers identical to linux. | ||
211 | */ | 200 | */ |
212 | extern unsigned int irq_create_mapping(struct irq_host *host, | 201 | extern unsigned int irq_create_mapping(struct irq_host *host, |
213 | irq_hw_number_t hwirq, | 202 | irq_hw_number_t hwirq); |
214 | unsigned int flags); | ||
215 | 203 | ||
216 | 204 | ||
217 | /*** | 205 | /*** |
@@ -295,7 +283,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count); | |||
295 | * | 283 | * |
296 | * This function is identical to irq_create_mapping except that it takes | 284 | * This function is identical to irq_create_mapping except that it takes |
297 | * as input informations straight from the device-tree (typically the results | 285 | * as input informations straight from the device-tree (typically the results |
298 | * of the of_irq_map_*() functions | 286 | * of the of_irq_map_*() functions. |
299 | */ | 287 | */ |
300 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | 288 | extern unsigned int irq_create_of_mapping(struct device_node *controller, |
301 | u32 *intspec, unsigned int intsize); | 289 | u32 *intspec, unsigned int intsize); |
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/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/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/completion.h b/include/linux/completion.h index 251c41e3ddd5..268c5a4a2bd4 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -18,6 +18,9 @@ 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 | ||
@@ -28,7 +31,7 @@ struct completion { | |||
28 | */ | 31 | */ |
29 | #ifdef CONFIG_LOCKDEP | 32 | #ifdef CONFIG_LOCKDEP |
30 | # define DECLARE_COMPLETION_ONSTACK(work) \ | 33 | # define DECLARE_COMPLETION_ONSTACK(work) \ |
31 | struct completion work = ({ init_completion(&work); work; }) | 34 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) |
32 | #else | 35 | #else |
33 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) | 36 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) |
34 | #endif | 37 | #endif |
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/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/fb.h b/include/linux/fb.h index ffefeeeeca93..405f44e44e5d 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -377,7 +377,6 @@ 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/notifier.h> | 382 | #include <linux/notifier.h> |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 43aef9b230fd..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 */ |
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/lockdep.h b/include/linux/lockdep.h index 316e0fb8d7b1..c040a8c969aa 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -120,7 +120,7 @@ struct lock_class { | |||
120 | */ | 120 | */ |
121 | struct lockdep_map { | 121 | struct lockdep_map { |
122 | struct lock_class_key *key; | 122 | struct lock_class_key *key; |
123 | struct lock_class *class[MAX_LOCKDEP_SUBCLASSES]; | 123 | struct lock_class *class_cache; |
124 | const char *name; | 124 | const char *name; |
125 | }; | 125 | }; |
126 | 126 | ||
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/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/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/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/rwsem.h b/include/linux/rwsem.h index 658afb37c3f5..7b524b4109a0 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
@@ -61,12 +61,25 @@ extern void downgrade_write(struct rw_semaphore *sem); | |||
61 | 61 | ||
62 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 62 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
63 | /* | 63 | /* |
64 | * nested locking: | 64 | * nested locking. NOTE: rwsems are not allowed to recurse |
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.) | ||
65 | */ | 75 | */ |
66 | extern void down_read_nested(struct rw_semaphore *sem, int subclass); | 76 | extern void down_read_nested(struct rw_semaphore *sem, int subclass); |
67 | extern void down_write_nested(struct rw_semaphore *sem, int subclass); | 77 | extern void down_write_nested(struct rw_semaphore *sem, int subclass); |
68 | /* | 78 | /* |
69 | * Take/release a lock when not the owner will release it: | 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. ] | ||
70 | */ | 83 | */ |
71 | extern void down_read_non_owner(struct rw_semaphore *sem); | 84 | extern void down_read_non_owner(struct rw_semaphore *sem); |
72 | extern void up_read_non_owner(struct rw_semaphore *sem); | 85 | extern void up_read_non_owner(struct rw_semaphore *sem); |
diff --git a/include/linux/tty.h b/include/linux/tty.h index b3b807e4b050..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> |
@@ -270,7 +259,6 @@ struct tty_struct { | |||
270 | extern void tty_write_flush(struct tty_struct *); | 259 | extern void tty_write_flush(struct tty_struct *); |
271 | 260 | ||
272 | extern struct termios tty_std_termios; | 261 | extern struct termios tty_std_termios; |
273 | extern int fg_console, last_console, want_console; | ||
274 | 262 | ||
275 | extern int kmsg_redirect; | 263 | extern int kmsg_redirect; |
276 | 264 | ||
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 3e0daf54133e..1ab806c47514 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -57,7 +57,7 @@ static inline void __count_vm_events(enum vm_event_item item, long delta) | |||
57 | 57 | ||
58 | static inline void count_vm_events(enum vm_event_item item, long delta) | 58 | static inline void count_vm_events(enum vm_event_item item, long delta) |
59 | { | 59 | { |
60 | get_cpu_var(vm_event_states.event[item])++; | 60 | get_cpu_var(vm_event_states.event[item]) += delta; |
61 | put_cpu(); | 61 | put_cpu(); |
62 | } | 62 | } |
63 | 63 | ||
@@ -186,11 +186,16 @@ static inline void __mod_zone_page_state(struct zone *zone, | |||
186 | zone_page_state_add(delta, zone, item); | 186 | zone_page_state_add(delta, zone, item); |
187 | } | 187 | } |
188 | 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 | |||
189 | static inline void __inc_zone_page_state(struct page *page, | 195 | static inline void __inc_zone_page_state(struct page *page, |
190 | enum zone_stat_item item) | 196 | enum zone_stat_item item) |
191 | { | 197 | { |
192 | atomic_long_inc(&page_zone(page)->vm_stat[item]); | 198 | __inc_zone_state(page_zone(page), item); |
193 | atomic_long_inc(&vm_stat[item]); | ||
194 | } | 199 | } |
195 | 200 | ||
196 | static inline void __dec_zone_page_state(struct page *page, | 201 | static inline void __dec_zone_page_state(struct page *page, |
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 794be7af58ae..b3b9048421d8 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -77,17 +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 | /* | 80 | extern void init_waitqueue_head(wait_queue_head_t *q); |
81 | * lockdep: we want one lock-class for all waitqueue locks. | ||
82 | */ | ||
83 | extern struct lock_class_key waitqueue_lock_key; | ||
84 | |||
85 | static inline void init_waitqueue_head(wait_queue_head_t *q) | ||
86 | { | ||
87 | spin_lock_init(&q->lock); | ||
88 | lockdep_set_class(&q->lock, &waitqueue_lock_key); | ||
89 | INIT_LIST_HEAD(&q->task_list); | ||
90 | } | ||
91 | 81 | ||
92 | 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) |
93 | { | 83 | { |