aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c285
-rw-r--r--arch/blackfin/mach-common/entry.S23
-rw-r--r--arch/mips/mm/pg-r4k.c2
-rw-r--r--drivers/net/sky2.c3
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_wx.c2
-rw-r--r--fs/binfmt_flat.c6
-rw-r--r--fs/ocfs2/localalloc.c4
-rw-r--r--include/asm-blackfin/mach-bf533/bfin_serial_5xx.h11
-rw-r--r--include/asm-blackfin/mach-bf537/bfin_serial_5xx.h23
-rw-r--r--include/asm-blackfin/mach-bf537/portmux.h35
-rw-r--r--include/asm-blackfin/mach-bf561/bfin_serial_5xx.h11
-rw-r--r--include/asm-blackfin/portmux.h55
-rw-r--r--include/asm-blackfin/unistd.h56
-rw-r--r--include/asm-h8300/flat.h3
-rw-r--r--include/asm-m32r/flat.h3
-rw-r--r--include/asm-m68knommu/flat.h3
-rw-r--r--include/asm-mips/cmpxchg.h107
-rw-r--r--include/asm-mips/local.h69
-rw-r--r--include/asm-mips/system.h261
-rw-r--r--include/asm-sh/flat.h3
-rw-r--r--include/asm-v850/flat.h4
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c2
22 files changed, 571 insertions, 400 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index bafcfa52142b..5d488ef965ce 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -84,6 +84,7 @@
84#include <linux/err.h> 84#include <linux/err.h>
85#include <asm/blackfin.h> 85#include <asm/blackfin.h>
86#include <asm/gpio.h> 86#include <asm/gpio.h>
87#include <asm/portmux.h>
87#include <linux/irq.h> 88#include <linux/irq.h>
88 89
89#ifdef BF533_FAMILY 90#ifdef BF533_FAMILY
@@ -115,7 +116,11 @@ static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
115}; 116};
116#endif 117#endif
117 118
118static unsigned short reserved_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; 119static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
120static unsigned short reserved_peri_map[gpio_bank(MAX_BLACKFIN_GPIOS + 16)];
121char *str_ident = NULL;
122
123#define RESOURCE_LABEL_SIZE 16
119 124
120#ifdef CONFIG_PM 125#ifdef CONFIG_PM
121static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; 126static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
@@ -143,22 +148,100 @@ inline int check_gpio(unsigned short gpio)
143 return 0; 148 return 0;
144} 149}
145 150
151static void set_label(unsigned short ident, const char *label)
152{
153
154 if (label && str_ident) {
155 strncpy(str_ident + ident * RESOURCE_LABEL_SIZE, label,
156 RESOURCE_LABEL_SIZE);
157 str_ident[ident * RESOURCE_LABEL_SIZE +
158 RESOURCE_LABEL_SIZE - 1] = 0;
159 }
160}
161
162static char *get_label(unsigned short ident)
163{
164 if (!str_ident)
165 return "UNKNOWN";
166
167 return (str_ident[ident * RESOURCE_LABEL_SIZE] ?
168 (str_ident + ident * RESOURCE_LABEL_SIZE) : "UNKNOWN");
169}
170
171static int cmp_label(unsigned short ident, const char *label)
172{
173 if (label && str_ident)
174 return strncmp(str_ident + ident * RESOURCE_LABEL_SIZE,
175 label, strlen(label));
176 else
177 return -EINVAL;
178}
179
146#ifdef BF537_FAMILY 180#ifdef BF537_FAMILY
147static void port_setup(unsigned short gpio, unsigned short usage) 181static void port_setup(unsigned short gpio, unsigned short usage)
148{ 182{
149 if (usage == GPIO_USAGE) { 183 if (!check_gpio(gpio)) {
150 if (*port_fer[gpio_bank(gpio)] & gpio_bit(gpio)) 184 if (usage == GPIO_USAGE) {
151 printk(KERN_WARNING "bfin-gpio: Possible Conflict with Peripheral " 185 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
152 "usage and GPIO %d detected!\n", gpio); 186 } else
153 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); 187 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
154 } else 188 SSYNC();
155 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 189 }
156 SSYNC();
157} 190}
158#else 191#else
159# define port_setup(...) do { } while (0) 192# define port_setup(...) do { } while (0)
160#endif 193#endif
161 194
195#ifdef BF537_FAMILY
196
197#define PMUX_LUT_RES 0
198#define PMUX_LUT_OFFSET 1
199#define PMUX_LUT_ENTRIES 41
200#define PMUX_LUT_SIZE 2
201
202static unsigned short port_mux_lut[PMUX_LUT_ENTRIES][PMUX_LUT_SIZE] = {
203 {P_PPI0_D13, 11}, {P_PPI0_D14, 11}, {P_PPI0_D15, 11},
204 {P_SPORT1_TFS, 11}, {P_SPORT1_TSCLK, 11}, {P_SPORT1_DTPRI, 11},
205 {P_PPI0_D10, 10}, {P_PPI0_D11, 10}, {P_PPI0_D12, 10},
206 {P_SPORT1_RSCLK, 10}, {P_SPORT1_RFS, 10}, {P_SPORT1_DRPRI, 10},
207 {P_PPI0_D8, 9}, {P_PPI0_D9, 9}, {P_SPORT1_DRSEC, 9},
208 {P_SPORT1_DTSEC, 9}, {P_TMR2, 8}, {P_PPI0_FS3, 8}, {P_TMR3, 7},
209 {P_SPI0_SSEL4, 7}, {P_TMR4, 6}, {P_SPI0_SSEL5, 6}, {P_TMR5, 5},
210 {P_SPI0_SSEL6, 5}, {P_UART1_RX, 4}, {P_UART1_TX, 4}, {P_TMR6, 4},
211 {P_TMR7, 4}, {P_UART0_RX, 3}, {P_UART0_TX, 3}, {P_DMAR0, 3},
212 {P_DMAR1, 3}, {P_SPORT0_DTSEC, 1}, {P_SPORT0_DRSEC, 1},
213 {P_CAN0_RX, 1}, {P_CAN0_TX, 1}, {P_SPI0_SSEL7, 1},
214 {P_SPORT0_TFS, 0}, {P_SPORT0_DTPRI, 0}, {P_SPI0_SSEL2, 0},
215 {P_SPI0_SSEL3, 0}
216};
217
218static void portmux_setup(unsigned short per, unsigned short function)
219{
220 u16 y, muxreg, offset;
221
222 for (y = 0; y < PMUX_LUT_ENTRIES; y++) {
223 if (port_mux_lut[y][PMUX_LUT_RES] == per) {
224
225 /* SET PORTMUX REG */
226
227 offset = port_mux_lut[y][PMUX_LUT_OFFSET];
228 muxreg = bfin_read_PORT_MUX();
229
230 if (offset != 1) {
231 muxreg &= ~(1 << offset);
232 } else {
233 muxreg &= ~(3 << 1);
234 }
235
236 muxreg |= (function << offset);
237 bfin_write_PORT_MUX(muxreg);
238 }
239 }
240}
241
242#else
243# define portmux_setup(...) do { } while (0)
244#endif
162 245
163static void default_gpio(unsigned short gpio) 246static void default_gpio(unsigned short gpio)
164{ 247{
@@ -179,22 +262,15 @@ static void default_gpio(unsigned short gpio)
179 262
180static int __init bfin_gpio_init(void) 263static int __init bfin_gpio_init(void)
181{ 264{
182 int i;
183
184 printk(KERN_INFO "Blackfin GPIO Controller\n");
185 265
186 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) 266 str_ident = kzalloc(RESOURCE_LABEL_SIZE * 256, GFP_KERNEL);
187 reserved_map[gpio_bank(i)] = 0; 267 if (!str_ident)
268 return -ENOMEM;
188 269
189#if defined(BF537_FAMILY) && (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) 270 printk(KERN_INFO "Blackfin GPIO Controller\n");
190# if defined(CONFIG_BFIN_MAC_RMII)
191 reserved_map[gpio_bank(PORT_H)] = 0xC373;
192# else
193 reserved_map[gpio_bank(PORT_H)] = 0xFFFF;
194# endif
195#endif
196 271
197 return 0; 272 return 0;
273
198} 274}
199 275
200arch_initcall(bfin_gpio_init); 276arch_initcall(bfin_gpio_init);
@@ -223,7 +299,7 @@ arch_initcall(bfin_gpio_init);
223void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ 299void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
224{ \ 300{ \
225 unsigned long flags; \ 301 unsigned long flags; \
226 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ 302 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \
227 local_irq_save(flags); \ 303 local_irq_save(flags); \
228 if (arg) \ 304 if (arg) \
229 gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ 305 gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
@@ -243,7 +319,7 @@ SET_GPIO(both)
243#define SET_GPIO_SC(name) \ 319#define SET_GPIO_SC(name) \
244void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ 320void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
245{ \ 321{ \
246 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ 322 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \
247 if (arg) \ 323 if (arg) \
248 gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ 324 gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
249 else \ 325 else \
@@ -258,7 +334,7 @@ SET_GPIO_SC(maskb)
258void set_gpio_data(unsigned short gpio, unsigned short arg) 334void set_gpio_data(unsigned short gpio, unsigned short arg)
259{ 335{
260 unsigned long flags; 336 unsigned long flags;
261 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); 337 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
262 local_irq_save(flags); 338 local_irq_save(flags);
263 if (arg) 339 if (arg)
264 gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio); 340 gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
@@ -277,7 +353,7 @@ SET_GPIO_SC(data)
277void set_gpio_toggle(unsigned short gpio) 353void set_gpio_toggle(unsigned short gpio)
278{ 354{
279 unsigned long flags; 355 unsigned long flags;
280 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); 356 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
281 local_irq_save(flags); 357 local_irq_save(flags);
282 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); 358 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
283 bfin_read_CHIPID(); 359 bfin_read_CHIPID();
@@ -286,7 +362,7 @@ void set_gpio_toggle(unsigned short gpio)
286#else 362#else
287void set_gpio_toggle(unsigned short gpio) 363void set_gpio_toggle(unsigned short gpio)
288{ 364{
289 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); 365 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
290 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); 366 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
291} 367}
292#endif 368#endif
@@ -350,7 +426,7 @@ unsigned short get_gpio_data(unsigned short gpio)
350{ 426{
351 unsigned long flags; 427 unsigned long flags;
352 unsigned short ret; 428 unsigned short ret;
353 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); 429 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
354 local_irq_save(flags); 430 local_irq_save(flags);
355 ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)); 431 ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->data >> gpio_sub_n(gpio));
356 bfin_read_CHIPID(); 432 bfin_read_CHIPID();
@@ -494,13 +570,14 @@ u32 gpio_pm_setup(void)
494 gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir; 570 gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir;
495 gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge; 571 gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge;
496 gpio_bank_saved[bank].both = gpio_bankb[bank]->both; 572 gpio_bank_saved[bank].both = gpio_bankb[bank]->both;
497 gpio_bank_saved[bank].reserved = reserved_map[bank]; 573 gpio_bank_saved[bank].reserved =
574 reserved_gpio_map[bank];
498 575
499 gpio = i; 576 gpio = i;
500 577
501 while (mask) { 578 while (mask) {
502 if (mask & 1) { 579 if (mask & 1) {
503 reserved_map[gpio_bank(gpio)] |= 580 reserved_gpio_map[gpio_bank(gpio)] |=
504 gpio_bit(gpio); 581 gpio_bit(gpio);
505 bfin_gpio_wakeup_type(gpio, 582 bfin_gpio_wakeup_type(gpio,
506 wakeup_flags_map[gpio]); 583 wakeup_flags_map[gpio]);
@@ -540,7 +617,8 @@ void gpio_pm_restore(void)
540 gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge; 617 gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge;
541 gpio_bankb[bank]->both = gpio_bank_saved[bank].both; 618 gpio_bankb[bank]->both = gpio_bank_saved[bank].both;
542 619
543 reserved_map[bank] = gpio_bank_saved[bank].reserved; 620 reserved_gpio_map[bank] =
621 gpio_bank_saved[bank].reserved;
544 622
545 } 623 }
546 624
@@ -550,6 +628,141 @@ void gpio_pm_restore(void)
550 628
551#endif 629#endif
552 630
631
632
633
634int peripheral_request(unsigned short per, const char *label)
635{
636 unsigned long flags;
637 unsigned short ident = P_IDENT(per);
638
639 /*
640 * Don't cares are pins with only one dedicated function
641 */
642
643 if (per & P_DONTCARE)
644 return 0;
645
646 if (!(per & P_DEFINED))
647 return -ENODEV;
648
649 local_irq_save(flags);
650
651 if (!check_gpio(ident)) {
652
653 if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
654 printk(KERN_ERR
655 "%s: Peripheral %d is already reserved as GPIO by %s !\n",
656 __FUNCTION__, ident, get_label(ident));
657 dump_stack();
658 local_irq_restore(flags);
659 return -EBUSY;
660 }
661
662 }
663
664 if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) {
665
666 /*
667 * Pin functions like AMC address strobes my
668 * be requested and used by several drivers
669 */
670
671 if (!(per & P_MAYSHARE)) {
672
673 /*
674 * Allow that the identical pin function can
675 * be requested from the same driver twice
676 */
677
678 if (cmp_label(ident, label) == 0)
679 goto anyway;
680
681 printk(KERN_ERR
682 "%s: Peripheral %d function %d is already"
683 "reserved by %s !\n",
684 __FUNCTION__, ident, P_FUNCT2MUX(per),
685 get_label(ident));
686 dump_stack();
687 local_irq_restore(flags);
688 return -EBUSY;
689 }
690
691 }
692
693anyway:
694
695
696 portmux_setup(per, P_FUNCT2MUX(per));
697
698 port_setup(ident, PERIPHERAL_USAGE);
699
700 reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident);
701 local_irq_restore(flags);
702 set_label(ident, label);
703
704 return 0;
705}
706EXPORT_SYMBOL(peripheral_request);
707
708int peripheral_request_list(unsigned short per[], const char *label)
709{
710 u16 cnt;
711 int ret;
712
713 for (cnt = 0; per[cnt] != 0; cnt++) {
714 ret = peripheral_request(per[cnt], label);
715 if (ret < 0)
716 return ret;
717 }
718
719 return 0;
720}
721EXPORT_SYMBOL(peripheral_request_list);
722
723void peripheral_free(unsigned short per)
724{
725 unsigned long flags;
726 unsigned short ident = P_IDENT(per);
727
728 if (per & P_DONTCARE)
729 return;
730
731 if (!(per & P_DEFINED))
732 return;
733
734 if (check_gpio(ident) < 0)
735 return;
736
737 local_irq_save(flags);
738
739 if (unlikely(!(reserved_peri_map[gpio_bank(ident)]
740 & gpio_bit(ident)))) {
741 local_irq_restore(flags);
742 return;
743 }
744
745 if (!(per & P_MAYSHARE)) {
746 port_setup(ident, GPIO_USAGE);
747 }
748
749 reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
750
751 local_irq_restore(flags);
752}
753EXPORT_SYMBOL(peripheral_free);
754
755void peripheral_free_list(unsigned short per[])
756{
757 u16 cnt;
758
759 for (cnt = 0; per[cnt] != 0; cnt++) {
760 peripheral_free(per[cnt]);
761 }
762
763}
764EXPORT_SYMBOL(peripheral_free_list);
765
553/*********************************************************** 766/***********************************************************
554* 767*
555* FUNCTIONS: Blackfin GPIO Driver 768* FUNCTIONS: Blackfin GPIO Driver
@@ -574,13 +787,13 @@ int gpio_request(unsigned short gpio, const char *label)
574 787
575 local_irq_save(flags); 788 local_irq_save(flags);
576 789
577 if (unlikely(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 790 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
578 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved!\n", gpio); 791 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved!\n", gpio);
579 dump_stack(); 792 dump_stack();
580 local_irq_restore(flags); 793 local_irq_restore(flags);
581 return -EBUSY; 794 return -EBUSY;
582 } 795 }
583 reserved_map[gpio_bank(gpio)] |= gpio_bit(gpio); 796 reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio);
584 797
585 local_irq_restore(flags); 798 local_irq_restore(flags);
586 799
@@ -599,7 +812,7 @@ void gpio_free(unsigned short gpio)
599 812
600 local_irq_save(flags); 813 local_irq_save(flags);
601 814
602 if (unlikely(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { 815 if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
603 printk(KERN_ERR "bfin-gpio: GPIO %d wasn't reserved!\n", gpio); 816 printk(KERN_ERR "bfin-gpio: GPIO %d wasn't reserved!\n", gpio);
604 dump_stack(); 817 dump_stack();
605 local_irq_restore(flags); 818 local_irq_restore(flags);
@@ -608,7 +821,7 @@ void gpio_free(unsigned short gpio)
608 821
609 default_gpio(gpio); 822 default_gpio(gpio);
610 823
611 reserved_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); 824 reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
612 825
613 local_irq_restore(flags); 826 local_irq_restore(flags);
614} 827}
@@ -618,7 +831,7 @@ void gpio_direction_input(unsigned short gpio)
618{ 831{
619 unsigned long flags; 832 unsigned long flags;
620 833
621 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); 834 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
622 835
623 local_irq_save(flags); 836 local_irq_save(flags);
624 gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); 837 gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
@@ -631,7 +844,7 @@ void gpio_direction_output(unsigned short gpio)
631{ 844{
632 unsigned long flags; 845 unsigned long flags;
633 846
634 BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); 847 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
635 848
636 local_irq_save(flags); 849 local_irq_save(flags);
637 gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); 850 gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index d61bba98fb54..960458808344 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -815,7 +815,7 @@ _extable:
815 815
816ALIGN 816ALIGN
817ENTRY(_sys_call_table) 817ENTRY(_sys_call_table)
818 .long _sys_ni_syscall /* 0 - old "setup()" system call*/ 818 .long _sys_restart_syscall /* 0 */
819 .long _sys_exit 819 .long _sys_exit
820 .long _sys_fork 820 .long _sys_fork
821 .long _sys_read 821 .long _sys_read
@@ -978,13 +978,13 @@ ENTRY(_sys_call_table)
978 .long _sys_sched_get_priority_min /* 160 */ 978 .long _sys_sched_get_priority_min /* 160 */
979 .long _sys_sched_rr_get_interval 979 .long _sys_sched_rr_get_interval
980 .long _sys_nanosleep 980 .long _sys_nanosleep
981 .long _sys_ni_syscall /* sys_mremap */ 981 .long _sys_mremap
982 .long _sys_setresuid /* setresuid16 */ 982 .long _sys_setresuid /* setresuid16 */
983 .long _sys_getresuid /* getresuid16 */ /* 165 */ 983 .long _sys_getresuid /* getresuid16 */ /* 165 */
984 .long _sys_ni_syscall /* for vm86 */ 984 .long _sys_ni_syscall /* for vm86 */
985 .long _sys_ni_syscall /* old "query_module" */ 985 .long _sys_ni_syscall /* old "query_module" */
986 .long _sys_ni_syscall /* sys_poll */ 986 .long _sys_ni_syscall /* sys_poll */
987 .long _sys_ni_syscall /* sys_nfsservctl */ 987 .long _sys_nfsservctl
988 .long _sys_setresgid /* setresgid16 */ /* 170 */ 988 .long _sys_setresgid /* setresgid16 */ /* 170 */
989 .long _sys_getresgid /* getresgid16 */ 989 .long _sys_getresgid /* getresgid16 */
990 .long _sys_prctl 990 .long _sys_prctl
@@ -1040,7 +1040,7 @@ ENTRY(_sys_call_table)
1040 .long _sys_ni_syscall /* reserved for TUX */ 1040 .long _sys_ni_syscall /* reserved for TUX */
1041 .long _sys_ni_syscall 1041 .long _sys_ni_syscall
1042 .long _sys_gettid 1042 .long _sys_gettid
1043 .long _sys_ni_syscall /* 225 */ /* sys_readahead */ 1043 .long _sys_readahead /* 225 */
1044 .long _sys_setxattr 1044 .long _sys_setxattr
1045 .long _sys_lsetxattr 1045 .long _sys_lsetxattr
1046 .long _sys_fsetxattr 1046 .long _sys_fsetxattr
@@ -1157,6 +1157,21 @@ ENTRY(_sys_call_table)
1157 .long _sys_shmctl 1157 .long _sys_shmctl
1158 .long _sys_shmdt /* 340 */ 1158 .long _sys_shmdt /* 340 */
1159 .long _sys_shmget 1159 .long _sys_shmget
1160 .long _sys_splice
1161 .long _sys_sync_file_range
1162 .long _sys_tee
1163 .long _sys_vmsplice /* 345 */
1164 .long _sys_epoll_pwait
1165 .long _sys_utimensat
1166 .long _sys_signalfd
1167 .long _sys_timerfd
1168 .long _sys_eventfd /* 350 */
1169 .long _sys_pread64
1170 .long _sys_pwrite64
1171 .long _sys_fadvise64
1172 .long _sys_set_robust_list
1173 .long _sys_get_robust_list /* 355 */
1174 .long _sys_fallocate
1160 .rept NR_syscalls-(.-_sys_call_table)/4 1175 .rept NR_syscalls-(.-_sys_call_table)/4
1161 .long _sys_ni_syscall 1176 .long _sys_ni_syscall
1162 .endr 1177 .endr
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index dc795be62807..e47e9e9486bf 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -209,7 +209,7 @@ static inline void build_cdex_p(void)
209 } 209 }
210 210
211 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 211 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
212 build_insn_word(0x3c01a000); /* lui $at, 0xa000 */ 212 build_insn_word(0x8c200000); /* lw $zero, ($at) */
213 213
214 mi.c_format.opcode = cache_op; 214 mi.c_format.opcode = cache_op;
215 mi.c_format.rs = 4; /* $a0 */ 215 mi.c_format.rs = 4; /* $a0 */
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 162489b9f599..ea117fc3d5e3 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2163,9 +2163,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
2163 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; 2163 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
2164 prefetch(sky2->rx_ring + sky2->rx_next); 2164 prefetch(sky2->rx_ring + sky2->rx_next);
2165 2165
2166 if (length < ETH_ZLEN || length > sky2->rx_data_size)
2167 goto len_error;
2168
2169 /* This chip has hardware problems that generates bogus status. 2166 /* This chip has hardware problems that generates bogus status.
2170 * So do only marginal checking and expect higher level protocols 2167 * So do only marginal checking and expect higher level protocols
2171 * to handle crap frames. 2168 * to handle crap frames.
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
index d6d9413d7f23..6acfdc49dccd 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -444,7 +444,7 @@ static int bcm43xx_wx_set_xmitpower(struct net_device *net_dev,
444 u16 maxpower; 444 u16 maxpower;
445 445
446 if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) { 446 if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) {
447 printk(PFX KERN_ERR "TX power not in dBm.\n"); 447 printk(KERN_ERR PFX "TX power not in dBm.\n");
448 return -EOPNOTSUPP; 448 return -EOPNOTSUPP;
449 } 449 }
450 450
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 861141b4f6d6..fcb3405bb14e 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -742,6 +742,7 @@ static int load_flat_file(struct linux_binprm * bprm,
742 * __start to address 4 so that is okay). 742 * __start to address 4 so that is okay).
743 */ 743 */
744 if (rev > OLD_FLAT_VERSION) { 744 if (rev > OLD_FLAT_VERSION) {
745 unsigned long persistent = 0;
745 for (i=0; i < relocs; i++) { 746 for (i=0; i < relocs; i++) {
746 unsigned long addr, relval; 747 unsigned long addr, relval;
747 748
@@ -749,6 +750,8 @@ static int load_flat_file(struct linux_binprm * bprm,
749 relocated (of course, the address has to be 750 relocated (of course, the address has to be
750 relocated first). */ 751 relocated first). */
751 relval = ntohl(reloc[i]); 752 relval = ntohl(reloc[i]);
753 if (flat_set_persistent (relval, &persistent))
754 continue;
752 addr = flat_get_relocate_addr(relval); 755 addr = flat_get_relocate_addr(relval);
753 rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1); 756 rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1);
754 if (rp == (unsigned long *)RELOC_FAILED) { 757 if (rp == (unsigned long *)RELOC_FAILED) {
@@ -757,7 +760,8 @@ static int load_flat_file(struct linux_binprm * bprm,
757 } 760 }
758 761
759 /* Get the pointer's value. */ 762 /* Get the pointer's value. */
760 addr = flat_get_addr_from_rp(rp, relval, flags); 763 addr = flat_get_addr_from_rp(rp, relval, flags,
764 &persistent);
761 if (addr != 0) { 765 if (addr != 0) {
762 /* 766 /*
763 * Do the relocation. PIC relocs in the data section are 767 * Do the relocation. PIC relocs in the data section are
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
index de984d272576..d272847d5a07 100644
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -514,8 +514,10 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
514 ac->ac_bh = osb->local_alloc_bh; 514 ac->ac_bh = osb->local_alloc_bh;
515 status = 0; 515 status = 0;
516bail: 516bail:
517 if (status < 0 && local_alloc_inode) 517 if (status < 0 && local_alloc_inode) {
518 mutex_unlock(&local_alloc_inode->i_mutex);
518 iput(local_alloc_inode); 519 iput(local_alloc_inode);
520 }
519 521
520 mlog_exit(status); 522 mlog_exit(status);
521 return status; 523 return status;
diff --git a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
index e043cafa3c42..69b9f8e120e9 100644
--- a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
@@ -1,5 +1,6 @@
1#include <linux/serial.h> 1#include <linux/serial.h>
2#include <asm/dma.h> 2#include <asm/dma.h>
3#include <asm/portmux.h>
3 4
4#define NR_PORTS 1 5#define NR_PORTS 1
5 6
@@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
92 } 93 }
93}; 94};
94 95
96#define DRIVER_NAME "bfin-uart"
95 97
96int nr_ports = NR_PORTS; 98int nr_ports = NR_PORTS;
97static void bfin_serial_hw_init(struct bfin_serial_port *uart) 99static void bfin_serial_hw_init(struct bfin_serial_port *uart)
98{ 100{
99 101
102#ifdef CONFIG_SERIAL_BFIN_UART0
103 peripheral_request(P_UART0_TX, DRIVER_NAME);
104 peripheral_request(P_UART0_RX, DRIVER_NAME);
105#endif
106
100#ifdef CONFIG_SERIAL_BFIN_CTSRTS 107#ifdef CONFIG_SERIAL_BFIN_CTSRTS
101 if (uart->cts_pin >= 0) { 108 if (uart->cts_pin >= 0) {
102 gpio_request(uart->cts_pin, NULL); 109 gpio_request(uart->cts_pin, DRIVER_NAME);
103 gpio_direction_input(uart->cts_pin); 110 gpio_direction_input(uart->cts_pin);
104 } 111 }
105 if (uart->rts_pin >= 0) { 112 if (uart->rts_pin >= 0) {
106 gpio_request(uart->rts_pin, NULL); 113 gpio_request(uart->rts_pin, DRIVER_NAME);
107 gpio_direction_input(uart->rts_pin); 114 gpio_direction_input(uart->rts_pin);
108 } 115 }
109#endif 116#endif
diff --git a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
index 8f5d9c4d8d5b..6fb328f5186a 100644
--- a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
@@ -1,5 +1,6 @@
1#include <linux/serial.h> 1#include <linux/serial.h>
2#include <asm/dma.h> 2#include <asm/dma.h>
3#include <asm/portmux.h>
3 4
4#define NR_PORTS 2 5#define NR_PORTS 2
5 6
@@ -122,25 +123,29 @@ struct bfin_serial_res bfin_serial_resource[] = {
122 123
123int nr_ports = ARRAY_SIZE(bfin_serial_resource); 124int nr_ports = ARRAY_SIZE(bfin_serial_resource);
124 125
126#define DRIVER_NAME "bfin-uart"
127
125static void bfin_serial_hw_init(struct bfin_serial_port *uart) 128static void bfin_serial_hw_init(struct bfin_serial_port *uart)
126{ 129{
127 unsigned short val;
128 val = bfin_read16(BFIN_PORT_MUX);
129 val &= ~(PFDE | PFTE);
130 bfin_write16(BFIN_PORT_MUX, val);
131 130
132 val = bfin_read16(PORTF_FER); 131#ifdef CONFIG_SERIAL_BFIN_UART0
133 val |= 0xF; 132 peripheral_request(P_UART0_TX, DRIVER_NAME);
134 bfin_write16(PORTF_FER, val); 133 peripheral_request(P_UART0_RX, DRIVER_NAME);
134#endif
135
136#ifdef CONFIG_SERIAL_BFIN_UART1
137 peripheral_request(P_UART1_TX, DRIVER_NAME);
138 peripheral_request(P_UART1_RX, DRIVER_NAME);
139#endif
135 140
136#ifdef CONFIG_SERIAL_BFIN_CTSRTS 141#ifdef CONFIG_SERIAL_BFIN_CTSRTS
137 if (uart->cts_pin >= 0) { 142 if (uart->cts_pin >= 0) {
138 gpio_request(uart->cts_pin, NULL); 143 gpio_request(uart->cts_pin, DRIVER_NAME);
139 gpio_direction_input(uart->cts_pin); 144 gpio_direction_input(uart->cts_pin);
140 } 145 }
141 146
142 if (uart->rts_pin >= 0) { 147 if (uart->rts_pin >= 0) {
143 gpio_request(uart->rts_pin, NULL); 148 gpio_request(uart->rts_pin, DRIVER_NAME);
144 gpio_direction_output(uart->rts_pin); 149 gpio_direction_output(uart->rts_pin);
145 } 150 }
146#endif 151#endif
diff --git a/include/asm-blackfin/mach-bf537/portmux.h b/include/asm-blackfin/mach-bf537/portmux.h
index 23e13c5abc4d..ae6c53b28452 100644
--- a/include/asm-blackfin/mach-bf537/portmux.h
+++ b/include/asm-blackfin/mach-bf537/portmux.h
@@ -106,4 +106,37 @@
106#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1)) 106#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
107#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2)) 107#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2))
108 108
109#endif /* _MACH_PORTMUX_H_ */ 109#define P_MII0 {\
110 P_MII0_ETxD0, \
111 P_MII0_ETxD1, \
112 P_MII0_ETxD2, \
113 P_MII0_ETxD3, \
114 P_MII0_ETxEN, \
115 P_MII0_TxCLK, \
116 P_MII0_PHYINT, \
117 P_MII0_COL, \
118 P_MII0_ERxD0, \
119 P_MII0_ERxD1, \
120 P_MII0_ERxD2, \
121 P_MII0_ERxD3, \
122 P_MII0_ERxDV, \
123 P_MII0_ERxCLK, \
124 P_MII0_ERxER, \
125 P_MII0_CRS, \
126 P_MDC, \
127 P_MDIO, 0}
128
129
130#define P_RMII0 {\
131 P_MII0_ETxD0, \
132 P_MII0_ETxD1, \
133 P_MII0_ETxEN, \
134 P_MII0_ERxD0, \
135 P_MII0_ERxD1, \
136 P_MII0_ERxER, \
137 P_RMII0_REF_CLK, \
138 P_RMII0_MDINT, \
139 P_RMII0_CRS_DV, \
140 P_MDC, \
141 P_MDIO, 0}
142#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
index e043cafa3c42..69b9f8e120e9 100644
--- a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
+++ b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
@@ -1,5 +1,6 @@
1#include <linux/serial.h> 1#include <linux/serial.h>
2#include <asm/dma.h> 2#include <asm/dma.h>
3#include <asm/portmux.h>
3 4
4#define NR_PORTS 1 5#define NR_PORTS 1
5 6
@@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
92 } 93 }
93}; 94};
94 95
96#define DRIVER_NAME "bfin-uart"
95 97
96int nr_ports = NR_PORTS; 98int nr_ports = NR_PORTS;
97static void bfin_serial_hw_init(struct bfin_serial_port *uart) 99static void bfin_serial_hw_init(struct bfin_serial_port *uart)
98{ 100{
99 101
102#ifdef CONFIG_SERIAL_BFIN_UART0
103 peripheral_request(P_UART0_TX, DRIVER_NAME);
104 peripheral_request(P_UART0_RX, DRIVER_NAME);
105#endif
106
100#ifdef CONFIG_SERIAL_BFIN_CTSRTS 107#ifdef CONFIG_SERIAL_BFIN_CTSRTS
101 if (uart->cts_pin >= 0) { 108 if (uart->cts_pin >= 0) {
102 gpio_request(uart->cts_pin, NULL); 109 gpio_request(uart->cts_pin, DRIVER_NAME);
103 gpio_direction_input(uart->cts_pin); 110 gpio_direction_input(uart->cts_pin);
104 } 111 }
105 if (uart->rts_pin >= 0) { 112 if (uart->rts_pin >= 0) {
106 gpio_request(uart->rts_pin, NULL); 113 gpio_request(uart->rts_pin, DRIVER_NAME);
107 gpio_direction_input(uart->rts_pin); 114 gpio_direction_input(uart->rts_pin);
108 } 115 }
109#endif 116#endif
diff --git a/include/asm-blackfin/portmux.h b/include/asm-blackfin/portmux.h
index 9d3681e42111..0d3f650d2d99 100644
--- a/include/asm-blackfin/portmux.h
+++ b/include/asm-blackfin/portmux.h
@@ -14,6 +14,12 @@
14#define P_MAYSHARE 0x2000 14#define P_MAYSHARE 0x2000
15#define P_DONTCARE 0x1000 15#define P_DONTCARE 0x1000
16 16
17
18int peripheral_request(unsigned short per, const char *label);
19void peripheral_free(unsigned short per);
20int peripheral_request_list(unsigned short per[], const char *label);
21void peripheral_free_list(unsigned short per[]);
22
17#include <asm/gpio.h> 23#include <asm/gpio.h>
18#include <asm/mach/portmux.h> 24#include <asm/mach/portmux.h>
19 25
@@ -145,6 +151,22 @@
145#define P_SPI2_SSEL3 P_UNDEF 151#define P_SPI2_SSEL3 P_UNDEF
146#endif 152#endif
147 153
154#ifndef P_SPI2_SSEL4
155#define P_SPI2_SSEL4 P_UNDEF
156#endif
157
158#ifndef P_SPI2_SSEL5
159#define P_SPI2_SSEL5 P_UNDEF
160#endif
161
162#ifndef P_SPI2_SSEL6
163#define P_SPI2_SSEL6 P_UNDEF
164#endif
165
166#ifndef P_SPI2_SSEL7
167#define P_SPI2_SSEL7 P_UNDEF
168#endif
169
148#ifndef P_SPI2_SCK 170#ifndef P_SPI2_SCK
149#define P_SPI2_SCK P_UNDEF 171#define P_SPI2_SCK P_UNDEF
150#endif 172#endif
@@ -513,6 +535,22 @@
513#define P_SPI0_SSEL3 P_UNDEF 535#define P_SPI0_SSEL3 P_UNDEF
514#endif 536#endif
515 537
538#ifndef P_SPI0_SSEL4
539#define P_SPI0_SSEL4 P_UNDEF
540#endif
541
542#ifndef P_SPI0_SSEL5
543#define P_SPI0_SSEL5 P_UNDEF
544#endif
545
546#ifndef P_SPI0_SSEL6
547#define P_SPI0_SSEL6 P_UNDEF
548#endif
549
550#ifndef P_SPI0_SSEL7
551#define P_SPI0_SSEL7 P_UNDEF
552#endif
553
516#ifndef P_UART0_TX 554#ifndef P_UART0_TX
517#define P_UART0_TX P_UNDEF 555#define P_UART0_TX P_UNDEF
518#endif 556#endif
@@ -741,6 +779,23 @@
741#define P_SPI1_SSEL3 P_UNDEF 779#define P_SPI1_SSEL3 P_UNDEF
742#endif 780#endif
743 781
782
783#ifndef P_SPI1_SSEL4
784#define P_SPI1_SSEL4 P_UNDEF
785#endif
786
787#ifndef P_SPI1_SSEL5
788#define P_SPI1_SSEL5 P_UNDEF
789#endif
790
791#ifndef P_SPI1_SSEL6
792#define P_SPI1_SSEL6 P_UNDEF
793#endif
794
795#ifndef P_SPI1_SSEL7
796#define P_SPI1_SSEL7 P_UNDEF
797#endif
798
744#ifndef P_SPI1_SCK 799#ifndef P_SPI1_SCK
745#define P_SPI1_SCK P_UNDEF 800#define P_SPI1_SCK P_UNDEF
746#endif 801#endif
diff --git a/include/asm-blackfin/unistd.h b/include/asm-blackfin/unistd.h
index 0df9f2d322a3..07ffe8b718c5 100644
--- a/include/asm-blackfin/unistd.h
+++ b/include/asm-blackfin/unistd.h
@@ -3,6 +3,7 @@
3/* 3/*
4 * This file contains the system call numbers. 4 * This file contains the system call numbers.
5 */ 5 */
6#define __NR_restart_syscall 0
6#define __NR_exit 1 7#define __NR_exit 1
7#define __NR_fork 2 8#define __NR_fork 2
8#define __NR_read 3 9#define __NR_read 3
@@ -165,13 +166,13 @@
165#define __NR_sched_get_priority_min 160 166#define __NR_sched_get_priority_min 160
166#define __NR_sched_rr_get_interval 161 167#define __NR_sched_rr_get_interval 161
167#define __NR_nanosleep 162 168#define __NR_nanosleep 162
168 /* 163 __NR_mremap */ 169#define __NR_mremap 163
169#define __NR_setresuid 164 170#define __NR_setresuid 164
170#define __NR_getresuid 165 171#define __NR_getresuid 165
171 /* 166 __NR_vm86 */ 172 /* 166 __NR_vm86 */
172 /* 167 __NR_query_module */ 173 /* 167 __NR_query_module */
173 /* 168 __NR_poll */ 174 /* 168 __NR_poll */
174 /* 169 __NR_nfsservctl */ 175#define __NR_nfsservctl 169
175#define __NR_setresgid 170 176#define __NR_setresgid 170
176#define __NR_getresgid 171 177#define __NR_getresgid 171
177#define __NR_prctl 172 178#define __NR_prctl 172
@@ -227,7 +228,7 @@
227 /* 222 reserved for TUX */ 228 /* 222 reserved for TUX */
228 /* 223 reserved for TUX */ 229 /* 223 reserved for TUX */
229#define __NR_gettid 224 230#define __NR_gettid 224
230 /* 225 __NR_readahead */ 231#define __NR_readahead 225
231#define __NR_setxattr 226 232#define __NR_setxattr 226
232#define __NR_lsetxattr 227 233#define __NR_lsetxattr 227
233#define __NR_fsetxattr 228 234#define __NR_fsetxattr 228
@@ -287,7 +288,7 @@
287#define __NR_mq_timedreceive (__NR_mq_open+3) 288#define __NR_mq_timedreceive (__NR_mq_open+3)
288#define __NR_mq_notify (__NR_mq_open+4) 289#define __NR_mq_notify (__NR_mq_open+4)
289#define __NR_mq_getsetattr (__NR_mq_open+5) 290#define __NR_mq_getsetattr (__NR_mq_open+5)
290 /* 284 __NR_sys_kexec_load */ 291#define __NR_kexec_load 284
291#define __NR_waitid 285 292#define __NR_waitid 285
292#define __NR_add_key 286 293#define __NR_add_key 286
293#define __NR_request_key 287 294#define __NR_request_key 287
@@ -352,9 +353,54 @@
352#define __NR_shmdt 340 353#define __NR_shmdt 340
353#define __NR_shmget 341 354#define __NR_shmget 341
354 355
355#define __NR_syscall 342 356#define __NR_splice 342
357#define __NR_sync_file_range 343
358#define __NR_tee 344
359#define __NR_vmsplice 345
360
361#define __NR_epoll_pwait 346
362#define __NR_utimensat 347
363#define __NR_signalfd 348
364#define __NR_timerfd 349
365#define __NR_eventfd 350
366#define __NR_pread64 351
367#define __NR_pwrite64 352
368#define __NR_fadvise64 353
369#define __NR_set_robust_list 354
370#define __NR_get_robust_list 355
371#define __NR_fallocate 356
372
373#define __NR_syscall 357
356#define NR_syscalls __NR_syscall 374#define NR_syscalls __NR_syscall
357 375
376/* Old optional stuff no one actually uses */
377#define __IGNORE_sysfs
378#define __IGNORE_uselib
379
380/* Implement the newer interfaces */
381#define __IGNORE_mmap
382#define __IGNORE_poll
383#define __IGNORE_select
384#define __IGNORE_utime
385
386/* Not relevant on no-mmu */
387#define __IGNORE_swapon
388#define __IGNORE_swapoff
389#define __IGNORE_msync
390#define __IGNORE_mlock
391#define __IGNORE_munlock
392#define __IGNORE_mlockall
393#define __IGNORE_munlockall
394#define __IGNORE_mincore
395#define __IGNORE_madvise
396#define __IGNORE_remap_file_pages
397#define __IGNORE_mbind
398#define __IGNORE_get_mempolicy
399#define __IGNORE_set_mempolicy
400#define __IGNORE_migrate_pages
401#define __IGNORE_move_pages
402#define __IGNORE_getcpu
403
358#ifdef __KERNEL__ 404#ifdef __KERNEL__
359#define __ARCH_WANT_IPC_PARSE_VERSION 405#define __ARCH_WANT_IPC_PARSE_VERSION
360#define __ARCH_WANT_STAT64 406#define __ARCH_WANT_STAT64
diff --git a/include/asm-h8300/flat.h b/include/asm-h8300/flat.h
index c20eee767d6f..2a873508a9a1 100644
--- a/include/asm-h8300/flat.h
+++ b/include/asm-h8300/flat.h
@@ -9,6 +9,7 @@
9#define flat_argvp_envp_on_stack() 1 9#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) 1 10#define flat_old_ram_flag(flags) 1
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 11#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
12#define flat_set_persistent(relval, p) 0
12 13
13/* 14/*
14 * on the H8 a couple of the relocations have an instruction in the 15 * on the H8 a couple of the relocations have an instruction in the
@@ -18,7 +19,7 @@
18 */ 19 */
19 20
20#define flat_get_relocate_addr(rel) (rel) 21#define flat_get_relocate_addr(rel) (rel)
21#define flat_get_addr_from_rp(rp, relval, flags) \ 22#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
22 (get_unaligned(rp) & ((flags & FLAT_FLAG_GOTPIC) ? 0xffffffff: 0x00ffffff)) 23 (get_unaligned(rp) & ((flags & FLAT_FLAG_GOTPIC) ? 0xffffffff: 0x00ffffff))
23#define flat_put_addr_at_rp(rp, addr, rel) \ 24#define flat_put_addr_at_rp(rp, addr, rel) \
24 put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp) 25 put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp)
diff --git a/include/asm-m32r/flat.h b/include/asm-m32r/flat.h
index 1b285f65cab6..d851cf0c4aa5 100644
--- a/include/asm-m32r/flat.h
+++ b/include/asm-m32r/flat.h
@@ -15,9 +15,10 @@
15#define flat_stack_align(sp) (*sp += (*sp & 3 ? (4 - (*sp & 3)): 0)) 15#define flat_stack_align(sp) (*sp += (*sp & 3 ? (4 - (*sp & 3)): 0))
16#define flat_argvp_envp_on_stack() 0 16#define flat_argvp_envp_on_stack() 0
17#define flat_old_ram_flag(flags) (flags) 17#define flat_old_ram_flag(flags) (flags)
18#define flat_set_persistent(relval, p) 0
18#define flat_reloc_valid(reloc, size) \ 19#define flat_reloc_valid(reloc, size) \
19 (((reloc) - textlen_for_m32r_lo16_data) <= (size)) 20 (((reloc) - textlen_for_m32r_lo16_data) <= (size))
20#define flat_get_addr_from_rp(rp, relval, flags) \ 21#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
21 m32r_flat_get_addr_from_rp(rp, relval, (text_len) ) 22 m32r_flat_get_addr_from_rp(rp, relval, (text_len) )
22 23
23#define flat_put_addr_at_rp(rp, addr, relval) \ 24#define flat_put_addr_at_rp(rp, addr, relval) \
diff --git a/include/asm-m68knommu/flat.h b/include/asm-m68knommu/flat.h
index 2d836edc4344..814b5174a8e0 100644
--- a/include/asm-m68knommu/flat.h
+++ b/include/asm-m68knommu/flat.h
@@ -9,8 +9,9 @@
9#define flat_argvp_envp_on_stack() 1 9#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) (flags) 10#define flat_old_ram_flag(flags) (flags)
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 11#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
12#define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp) 12#define flat_get_addr_from_rp(rp, relval, flags, p) get_unaligned(rp)
13#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) 13#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
14#define flat_get_relocate_addr(rel) (rel) 14#define flat_get_relocate_addr(rel) (rel)
15#define flat_set_persistent(relval, p) 0
15 16
16#endif /* __M68KNOMMU_FLAT_H__ */ 17#endif /* __M68KNOMMU_FLAT_H__ */
diff --git a/include/asm-mips/cmpxchg.h b/include/asm-mips/cmpxchg.h
new file mode 100644
index 000000000000..c5b4708e003b
--- /dev/null
+++ b/include/asm-mips/cmpxchg.h
@@ -0,0 +1,107 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003, 06, 07 by Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_CMPXCHG_H
9#define __ASM_CMPXCHG_H
10
11#include <linux/irqflags.h>
12
13#define __HAVE_ARCH_CMPXCHG 1
14
15#define __cmpxchg_asm(ld, st, m, old, new) \
16({ \
17 __typeof(*(m)) __ret; \
18 \
19 if (cpu_has_llsc && R10000_LLSC_WAR) { \
20 __asm__ __volatile__( \
21 " .set push \n" \
22 " .set noat \n" \
23 " .set mips3 \n" \
24 "1: " ld " %0, %2 # __cmpxchg_asm \n" \
25 " bne %0, %z3, 2f \n" \
26 " .set mips0 \n" \
27 " move $1, %z4 \n" \
28 " .set mips3 \n" \
29 " " st " $1, %1 \n" \
30 " beqzl $1, 1b \n" \
31 "2: \n" \
32 " .set pop \n" \
33 : "=&r" (__ret), "=R" (*m) \
34 : "R" (*m), "Jr" (old), "Jr" (new) \
35 : "memory"); \
36 } else if (cpu_has_llsc) { \
37 __asm__ __volatile__( \
38 " .set push \n" \
39 " .set noat \n" \
40 " .set mips3 \n" \
41 "1: " ld " %0, %2 # __cmpxchg_asm \n" \
42 " bne %0, %z3, 2f \n" \
43 " .set mips0 \n" \
44 " move $1, %z4 \n" \
45 " .set mips3 \n" \
46 " " st " $1, %1 \n" \
47 " beqz $1, 3f \n" \
48 "2: \n" \
49 " .subsection 2 \n" \
50 "3: b 1b \n" \
51 " .previous \n" \
52 " .set pop \n" \
53 : "=&r" (__ret), "=R" (*m) \
54 : "R" (*m), "Jr" (old), "Jr" (new) \
55 : "memory"); \
56 } else { \
57 unsigned long __flags; \
58 \
59 raw_local_irq_save(__flags); \
60 __ret = *m; \
61 if (__ret == old) \
62 *m = new; \
63 raw_local_irq_restore(__flags); \
64 } \
65 \
66 __ret; \
67})
68
69/*
70 * This function doesn't exist, so you'll get a linker error
71 * if something tries to do an invalid cmpxchg().
72 */
73extern void __cmpxchg_called_with_bad_pointer(void);
74
75#define __cmpxchg(ptr,old,new,barrier) \
76({ \
77 __typeof__(ptr) __ptr = (ptr); \
78 __typeof__(*(ptr)) __old = (old); \
79 __typeof__(*(ptr)) __new = (new); \
80 __typeof__(*(ptr)) __res = 0; \
81 \
82 barrier; \
83 \
84 switch (sizeof(*(__ptr))) { \
85 case 4: \
86 __res = __cmpxchg_asm("ll", "sc", __ptr, __old, __new); \
87 break; \
88 case 8: \
89 if (sizeof(long) == 8) { \
90 __res = __cmpxchg_asm("lld", "scd", __ptr, \
91 __old, __new); \
92 break; \
93 } \
94 default: \
95 __cmpxchg_called_with_bad_pointer(); \
96 break; \
97 } \
98 \
99 barrier; \
100 \
101 __res; \
102})
103
104#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb())
105#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new,)
106
107#endif /* __ASM_CMPXCHG_H */
diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h
index ed882c88e0ca..f9a5ce5c9af1 100644
--- a/include/asm-mips/local.h
+++ b/include/asm-mips/local.h
@@ -4,6 +4,7 @@
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <linux/bitops.h> 5#include <linux/bitops.h>
6#include <asm/atomic.h> 6#include <asm/atomic.h>
7#include <asm/cmpxchg.h>
7#include <asm/war.h> 8#include <asm/war.h>
8 9
9typedef struct 10typedef struct
@@ -114,68 +115,6 @@ static __inline__ long local_sub_return(long i, local_t * l)
114 return result; 115 return result;
115} 116}
116 117
117/*
118 * local_sub_if_positive - conditionally subtract integer from atomic variable
119 * @i: integer value to subtract
120 * @l: pointer of type local_t
121 *
122 * Atomically test @l and subtract @i if @l is greater or equal than @i.
123 * The function returns the old value of @l minus @i.
124 */
125static __inline__ long local_sub_if_positive(long i, local_t * l)
126{
127 unsigned long result;
128
129 if (cpu_has_llsc && R10000_LLSC_WAR) {
130 unsigned long temp;
131
132 __asm__ __volatile__(
133 " .set mips3 \n"
134 "1:" __LL "%1, %2 # local_sub_if_positive\n"
135 " dsubu %0, %1, %3 \n"
136 " bltz %0, 1f \n"
137 __SC "%0, %2 \n"
138 " .set noreorder \n"
139 " beqzl %0, 1b \n"
140 " dsubu %0, %1, %3 \n"
141 " .set reorder \n"
142 "1: \n"
143 " .set mips0 \n"
144 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
145 : "Ir" (i), "m" (l->a.counter)
146 : "memory");
147 } else if (cpu_has_llsc) {
148 unsigned long temp;
149
150 __asm__ __volatile__(
151 " .set mips3 \n"
152 "1:" __LL "%1, %2 # local_sub_if_positive\n"
153 " dsubu %0, %1, %3 \n"
154 " bltz %0, 1f \n"
155 __SC "%0, %2 \n"
156 " .set noreorder \n"
157 " beqz %0, 1b \n"
158 " dsubu %0, %1, %3 \n"
159 " .set reorder \n"
160 "1: \n"
161 " .set mips0 \n"
162 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
163 : "Ir" (i), "m" (l->a.counter)
164 : "memory");
165 } else {
166 unsigned long flags;
167
168 local_irq_save(flags);
169 result = l->a.counter;
170 result -= i;
171 if (result >= 0)
172 l->a.counter = result;
173 local_irq_restore(flags);
174 }
175
176 return result;
177}
178
179#define local_cmpxchg(l, o, n) \ 118#define local_cmpxchg(l, o, n) \
180 ((long)cmpxchg_local(&((l)->a.counter), (o), (n))) 119 ((long)cmpxchg_local(&((l)->a.counter), (o), (n)))
181#define local_xchg(l, n) (xchg_local(&((l)->a.counter),(n))) 120#define local_xchg(l, n) (xchg_local(&((l)->a.counter),(n)))
@@ -234,12 +173,6 @@ static __inline__ long local_sub_if_positive(long i, local_t * l)
234#define local_dec_and_test(l) (local_sub_return(1, (l)) == 0) 173#define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
235 174
236/* 175/*
237 * local_dec_if_positive - decrement by 1 if old value positive
238 * @l: pointer of type local_t
239 */
240#define local_dec_if_positive(l) local_sub_if_positive(1, l)
241
242/*
243 * local_add_negative - add and test if negative 176 * local_add_negative - add and test if negative
244 * @l: pointer of type local_t 177 * @l: pointer of type local_t
245 * @i: integer value to add 178 * @i: integer value to add
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 357251f42518..480b574e2483 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -17,6 +17,7 @@
17 17
18#include <asm/addrspace.h> 18#include <asm/addrspace.h>
19#include <asm/barrier.h> 19#include <asm/barrier.h>
20#include <asm/cmpxchg.h>
20#include <asm/cpu-features.h> 21#include <asm/cpu-features.h>
21#include <asm/dsp.h> 22#include <asm/dsp.h>
22#include <asm/war.h> 23#include <asm/war.h>
@@ -194,266 +195,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
194 195
195#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 196#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
196 197
197#define __HAVE_ARCH_CMPXCHG 1
198
199static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
200 unsigned long new)
201{
202 __u32 retval;
203
204 if (cpu_has_llsc && R10000_LLSC_WAR) {
205 __asm__ __volatile__(
206 " .set push \n"
207 " .set noat \n"
208 " .set mips3 \n"
209 "1: ll %0, %2 # __cmpxchg_u32 \n"
210 " bne %0, %z3, 2f \n"
211 " .set mips0 \n"
212 " move $1, %z4 \n"
213 " .set mips3 \n"
214 " sc $1, %1 \n"
215 " beqzl $1, 1b \n"
216 "2: \n"
217 " .set pop \n"
218 : "=&r" (retval), "=R" (*m)
219 : "R" (*m), "Jr" (old), "Jr" (new)
220 : "memory");
221 } else if (cpu_has_llsc) {
222 __asm__ __volatile__(
223 " .set push \n"
224 " .set noat \n"
225 " .set mips3 \n"
226 "1: ll %0, %2 # __cmpxchg_u32 \n"
227 " bne %0, %z3, 2f \n"
228 " .set mips0 \n"
229 " move $1, %z4 \n"
230 " .set mips3 \n"
231 " sc $1, %1 \n"
232 " beqz $1, 3f \n"
233 "2: \n"
234 " .subsection 2 \n"
235 "3: b 1b \n"
236 " .previous \n"
237 " .set pop \n"
238 : "=&r" (retval), "=R" (*m)
239 : "R" (*m), "Jr" (old), "Jr" (new)
240 : "memory");
241 } else {
242 unsigned long flags;
243
244 raw_local_irq_save(flags);
245 retval = *m;
246 if (retval == old)
247 *m = new;
248 raw_local_irq_restore(flags); /* implies memory barrier */
249 }
250
251 smp_llsc_mb();
252
253 return retval;
254}
255
256static inline unsigned long __cmpxchg_u32_local(volatile int * m,
257 unsigned long old, unsigned long new)
258{
259 __u32 retval;
260
261 if (cpu_has_llsc && R10000_LLSC_WAR) {
262 __asm__ __volatile__(
263 " .set push \n"
264 " .set noat \n"
265 " .set mips3 \n"
266 "1: ll %0, %2 # __cmpxchg_u32 \n"
267 " bne %0, %z3, 2f \n"
268 " .set mips0 \n"
269 " move $1, %z4 \n"
270 " .set mips3 \n"
271 " sc $1, %1 \n"
272 " beqzl $1, 1b \n"
273 "2: \n"
274 " .set pop \n"
275 : "=&r" (retval), "=R" (*m)
276 : "R" (*m), "Jr" (old), "Jr" (new)
277 : "memory");
278 } else if (cpu_has_llsc) {
279 __asm__ __volatile__(
280 " .set push \n"
281 " .set noat \n"
282 " .set mips3 \n"
283 "1: ll %0, %2 # __cmpxchg_u32 \n"
284 " bne %0, %z3, 2f \n"
285 " .set mips0 \n"
286 " move $1, %z4 \n"
287 " .set mips3 \n"
288 " sc $1, %1 \n"
289 " beqz $1, 1b \n"
290 "2: \n"
291 " .set pop \n"
292 : "=&r" (retval), "=R" (*m)
293 : "R" (*m), "Jr" (old), "Jr" (new)
294 : "memory");
295 } else {
296 unsigned long flags;
297
298 local_irq_save(flags);
299 retval = *m;
300 if (retval == old)
301 *m = new;
302 local_irq_restore(flags); /* implies memory barrier */
303 }
304
305 return retval;
306}
307
308#ifdef CONFIG_64BIT
309static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
310 unsigned long new)
311{
312 __u64 retval;
313
314 if (cpu_has_llsc && R10000_LLSC_WAR) {
315 __asm__ __volatile__(
316 " .set push \n"
317 " .set noat \n"
318 " .set mips3 \n"
319 "1: lld %0, %2 # __cmpxchg_u64 \n"
320 " bne %0, %z3, 2f \n"
321 " move $1, %z4 \n"
322 " scd $1, %1 \n"
323 " beqzl $1, 1b \n"
324 "2: \n"
325 " .set pop \n"
326 : "=&r" (retval), "=R" (*m)
327 : "R" (*m), "Jr" (old), "Jr" (new)
328 : "memory");
329 } else if (cpu_has_llsc) {
330 __asm__ __volatile__(
331 " .set push \n"
332 " .set noat \n"
333 " .set mips3 \n"
334 "1: lld %0, %2 # __cmpxchg_u64 \n"
335 " bne %0, %z3, 2f \n"
336 " move $1, %z4 \n"
337 " scd $1, %1 \n"
338 " beqz $1, 3f \n"
339 "2: \n"
340 " .subsection 2 \n"
341 "3: b 1b \n"
342 " .previous \n"
343 " .set pop \n"
344 : "=&r" (retval), "=R" (*m)
345 : "R" (*m), "Jr" (old), "Jr" (new)
346 : "memory");
347 } else {
348 unsigned long flags;
349
350 raw_local_irq_save(flags);
351 retval = *m;
352 if (retval == old)
353 *m = new;
354 raw_local_irq_restore(flags); /* implies memory barrier */
355 }
356
357 smp_llsc_mb();
358
359 return retval;
360}
361
362static inline unsigned long __cmpxchg_u64_local(volatile int * m,
363 unsigned long old, unsigned long new)
364{
365 __u64 retval;
366
367 if (cpu_has_llsc && R10000_LLSC_WAR) {
368 __asm__ __volatile__(
369 " .set push \n"
370 " .set noat \n"
371 " .set mips3 \n"
372 "1: lld %0, %2 # __cmpxchg_u64 \n"
373 " bne %0, %z3, 2f \n"
374 " move $1, %z4 \n"
375 " scd $1, %1 \n"
376 " beqzl $1, 1b \n"
377 "2: \n"
378 " .set pop \n"
379 : "=&r" (retval), "=R" (*m)
380 : "R" (*m), "Jr" (old), "Jr" (new)
381 : "memory");
382 } else if (cpu_has_llsc) {
383 __asm__ __volatile__(
384 " .set push \n"
385 " .set noat \n"
386 " .set mips3 \n"
387 "1: lld %0, %2 # __cmpxchg_u64 \n"
388 " bne %0, %z3, 2f \n"
389 " move $1, %z4 \n"
390 " scd $1, %1 \n"
391 " beqz $1, 1b \n"
392 "2: \n"
393 " .set pop \n"
394 : "=&r" (retval), "=R" (*m)
395 : "R" (*m), "Jr" (old), "Jr" (new)
396 : "memory");
397 } else {
398 unsigned long flags;
399
400 local_irq_save(flags);
401 retval = *m;
402 if (retval == old)
403 *m = new;
404 local_irq_restore(flags); /* implies memory barrier */
405 }
406
407 return retval;
408}
409
410#else
411extern unsigned long __cmpxchg_u64_unsupported_on_32bit_kernels(
412 volatile int * m, unsigned long old, unsigned long new);
413#define __cmpxchg_u64 __cmpxchg_u64_unsupported_on_32bit_kernels
414extern unsigned long __cmpxchg_u64_local_unsupported_on_32bit_kernels(
415 volatile int * m, unsigned long old, unsigned long new);
416#define __cmpxchg_u64_local __cmpxchg_u64_local_unsupported_on_32bit_kernels
417#endif
418
419/* This function doesn't exist, so you'll get a linker error
420 if something tries to do an invalid cmpxchg(). */
421extern void __cmpxchg_called_with_bad_pointer(void);
422
423static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
424 unsigned long new, int size)
425{
426 switch (size) {
427 case 4:
428 return __cmpxchg_u32(ptr, old, new);
429 case 8:
430 return __cmpxchg_u64(ptr, old, new);
431 }
432 __cmpxchg_called_with_bad_pointer();
433 return old;
434}
435
436static inline unsigned long __cmpxchg_local(volatile void * ptr,
437 unsigned long old, unsigned long new, int size)
438{
439 switch (size) {
440 case 4:
441 return __cmpxchg_u32_local(ptr, old, new);
442 case 8:
443 return __cmpxchg_u64_local(ptr, old, new);
444 }
445 __cmpxchg_called_with_bad_pointer();
446 return old;
447}
448
449#define cmpxchg(ptr,old,new) \
450 ((__typeof__(*(ptr)))__cmpxchg((ptr), \
451 (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr))))
452
453#define cmpxchg_local(ptr,old,new) \
454 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \
455 (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr))))
456
457extern void set_handler (unsigned long offset, void *addr, unsigned long len); 198extern void set_handler (unsigned long offset, void *addr, unsigned long len);
458extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len); 199extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len);
459 200
diff --git a/include/asm-sh/flat.h b/include/asm-sh/flat.h
index 0d5cc04ab005..dc4f5950dafa 100644
--- a/include/asm-sh/flat.h
+++ b/include/asm-sh/flat.h
@@ -16,8 +16,9 @@
16#define flat_argvp_envp_on_stack() 0 16#define flat_argvp_envp_on_stack() 0
17#define flat_old_ram_flag(flags) (flags) 17#define flat_old_ram_flag(flags) (flags)
18#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 18#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
19#define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp) 19#define flat_get_addr_from_rp(rp, relval, flags, p) get_unaligned(rp)
20#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) 20#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
21#define flat_get_relocate_addr(rel) (rel) 21#define flat_get_relocate_addr(rel) (rel)
22#define flat_set_persistent(relval, p) 0
22 23
23#endif /* __ASM_SH_FLAT_H */ 24#endif /* __ASM_SH_FLAT_H */
diff --git a/include/asm-v850/flat.h b/include/asm-v850/flat.h
index 3888f59d6881..17f0ea566611 100644
--- a/include/asm-v850/flat.h
+++ b/include/asm-v850/flat.h
@@ -25,6 +25,7 @@
25#define flat_stack_align(sp) /* nothing needed */ 25#define flat_stack_align(sp) /* nothing needed */
26#define flat_argvp_envp_on_stack() 0 26#define flat_argvp_envp_on_stack() 0
27#define flat_old_ram_flag(flags) (flags) 27#define flat_old_ram_flag(flags) (flags)
28#define flat_set_persistent(relval, p) 0
28 29
29/* We store the type of relocation in the top 4 bits of the `relval.' */ 30/* We store the type of relocation in the top 4 bits of the `relval.' */
30 31
@@ -46,7 +47,8 @@ flat_get_relocate_addr (unsigned long relval)
46 For the v850, RP should always be half-word aligned. */ 47 For the v850, RP should always be half-word aligned. */
47static inline unsigned long flat_get_addr_from_rp (unsigned long *rp, 48static inline unsigned long flat_get_addr_from_rp (unsigned long *rp,
48 unsigned long relval, 49 unsigned long relval,
49 unsigned long flags) 50 unsigned long flags,
51 unsigned long *persistent)
50{ 52{
51 short *srp = (short *)rp; 53 short *srp = (short *)rp;
52 54
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index 442b9875f3fb..5742dc803b79 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -114,7 +114,7 @@ check_assoc_again:
114 sm->associnfo.associating = 1; 114 sm->associnfo.associating = 1;
115 /* queue lower level code to do work (if necessary) */ 115 /* queue lower level code to do work (if necessary) */
116 schedule_delayed_work(&sm->associnfo.work, 0); 116 schedule_delayed_work(&sm->associnfo.work, 0);
117out: 117
118 mutex_unlock(&sm->associnfo.mutex); 118 mutex_unlock(&sm->associnfo.mutex);
119 119
120 return 0; 120 return 0;