diff options
96 files changed, 2008 insertions, 2355 deletions
@@ -3738,7 +3738,7 @@ S: 93149 Nittenau | |||
3738 | S: Germany | 3738 | S: Germany |
3739 | 3739 | ||
3740 | N: Gertjan van Wingerde | 3740 | N: Gertjan van Wingerde |
3741 | E: gwingerde@home.nl | 3741 | E: gwingerde@gmail.com |
3742 | D: Ralink rt2x00 WLAN driver | 3742 | D: Ralink rt2x00 WLAN driver |
3743 | D: Minix V2 file-system | 3743 | D: Minix V2 file-system |
3744 | D: Misc fixes | 3744 | D: Misc fixes |
diff --git a/Documentation/filesystems/ext2.txt b/Documentation/filesystems/ext2.txt index 23448551cabe..e055acb6b2d4 100644 --- a/Documentation/filesystems/ext2.txt +++ b/Documentation/filesystems/ext2.txt | |||
@@ -376,7 +376,8 @@ Implementations for: | |||
376 | Windows 95/98/NT/2000 http://www.chrysocome.net/explore2fs | 376 | Windows 95/98/NT/2000 http://www.chrysocome.net/explore2fs |
377 | Windows 95 (*) http://www.yipton.net/content.html#FSDEXT2 | 377 | Windows 95 (*) http://www.yipton.net/content.html#FSDEXT2 |
378 | DOS client (*) ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/ | 378 | DOS client (*) ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/ |
379 | OS/2 (*) ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/ | 379 | OS/2 (+) ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/ |
380 | RISC OS client http://www.esw-heim.tu-clausthal.de/~marco/smorbrod/IscaFS/ | 380 | RISC OS client http://www.esw-heim.tu-clausthal.de/~marco/smorbrod/IscaFS/ |
381 | 381 | ||
382 | (*) no longer actively developed/supported (as of Mar 2009) | 382 | (*) no longer actively developed/supported (as of Apr 2001) |
383 | (+) no longer actively developed/supported (as of Mar 2009) | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index a87be42f8211..830bad7cce0f 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -1478,6 +1478,13 @@ of problems on the network like duplicate address or bad checksums. Normally, | |||
1478 | this should be enabled, but if the problem persists the messages can be | 1478 | this should be enabled, but if the problem persists the messages can be |
1479 | disabled. | 1479 | disabled. |
1480 | 1480 | ||
1481 | netdev_budget | ||
1482 | ------------- | ||
1483 | |||
1484 | Maximum number of packets taken from all interfaces in one polling cycle (NAPI | ||
1485 | poll). In one polling cycle interfaces which are registered to polling are | ||
1486 | probed in a round-robin manner. The limit of packets in one such probe can be | ||
1487 | set per-device via sysfs class/net/<device>/weight . | ||
1481 | 1488 | ||
1482 | netdev_max_backlog | 1489 | netdev_max_backlog |
1483 | ------------------ | 1490 | ------------------ |
@@ -1,8 +1,8 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 29 | 3 | SUBLEVEL = 29 |
4 | EXTRAVERSION = -rc8 | 4 | EXTRAVERSION = |
5 | NAME = Erotic Pickled Herring | 5 | NAME = Temporary Tasmanian Devil |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
8 | # To see a list of typical targets execute "make help" | 8 | # To see a list of typical targets execute "make help" |
@@ -570,6 +570,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) | |||
570 | # disable invalid "can't wrap" optimzations for signed / pointers | 570 | # disable invalid "can't wrap" optimzations for signed / pointers |
571 | KBUILD_CFLAGS += $(call cc-option,-fwrapv) | 571 | KBUILD_CFLAGS += $(call cc-option,-fwrapv) |
572 | 572 | ||
573 | # revert to pre-gcc-4.4 behaviour of .eh_frame | ||
574 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) | ||
575 | |||
573 | # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments | 576 | # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments |
574 | # But warn user when we do so | 577 | # But warn user when we do so |
575 | warn-assign = \ | 578 | warn-assign = \ |
diff --git a/arch/m68k/include/asm/param.h b/arch/m68k/include/asm/param.h index 40d1112a4588..85c41b75aa78 100644 --- a/arch/m68k/include/asm/param.h +++ b/arch/m68k/include/asm/param.h | |||
@@ -1,5 +1,26 @@ | |||
1 | #ifndef _M68K_PARAM_H | ||
2 | #define _M68K_PARAM_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | # define HZ CONFIG_HZ /* Internal kernel timer frequency */ | ||
6 | # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | ||
7 | # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | ||
8 | #endif | ||
9 | |||
10 | #ifndef HZ | ||
11 | #define HZ 100 | ||
12 | #endif | ||
13 | |||
1 | #ifdef __uClinux__ | 14 | #ifdef __uClinux__ |
2 | #include "param_no.h" | 15 | #define EXEC_PAGESIZE 4096 |
3 | #else | 16 | #else |
4 | #include "param_mm.h" | 17 | #define EXEC_PAGESIZE 8192 |
18 | #endif | ||
19 | |||
20 | #ifndef NOGROUP | ||
21 | #define NOGROUP (-1) | ||
5 | #endif | 22 | #endif |
23 | |||
24 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
25 | |||
26 | #endif /* _M68K_PARAM_H */ | ||
diff --git a/arch/m68k/include/asm/param_mm.h b/arch/m68k/include/asm/param_mm.h deleted file mode 100644 index 536a27888358..000000000000 --- a/arch/m68k/include/asm/param_mm.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef _M68K_PARAM_H | ||
2 | #define _M68K_PARAM_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | # define HZ CONFIG_HZ /* Internal kernel timer frequency */ | ||
6 | # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | ||
7 | # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | ||
8 | #endif | ||
9 | |||
10 | #ifndef HZ | ||
11 | #define HZ 100 | ||
12 | #endif | ||
13 | |||
14 | #define EXEC_PAGESIZE 8192 | ||
15 | |||
16 | #ifndef NOGROUP | ||
17 | #define NOGROUP (-1) | ||
18 | #endif | ||
19 | |||
20 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
21 | |||
22 | #endif /* _M68K_PARAM_H */ | ||
diff --git a/arch/m68k/include/asm/param_no.h b/arch/m68k/include/asm/param_no.h deleted file mode 100644 index 6044397adb64..000000000000 --- a/arch/m68k/include/asm/param_no.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_PARAM_H | ||
2 | #define _M68KNOMMU_PARAM_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | #define HZ CONFIG_HZ | ||
6 | #define USER_HZ HZ | ||
7 | #define CLOCKS_PER_SEC (USER_HZ) | ||
8 | #endif | ||
9 | |||
10 | #ifndef HZ | ||
11 | #define HZ 100 | ||
12 | #endif | ||
13 | |||
14 | #define EXEC_PAGESIZE 4096 | ||
15 | |||
16 | #ifndef NOGROUP | ||
17 | #define NOGROUP (-1) | ||
18 | #endif | ||
19 | |||
20 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
21 | |||
22 | #endif /* _M68KNOMMU_PARAM_H */ | ||
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h index e83cd2f66101..8c9194b98548 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h | |||
@@ -1,5 +1,87 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_PTRACE_H |
2 | #include "ptrace_no.h" | 2 | #define _M68K_PTRACE_H |
3 | |||
4 | #define PT_D1 0 | ||
5 | #define PT_D2 1 | ||
6 | #define PT_D3 2 | ||
7 | #define PT_D4 3 | ||
8 | #define PT_D5 4 | ||
9 | #define PT_D6 5 | ||
10 | #define PT_D7 6 | ||
11 | #define PT_A0 7 | ||
12 | #define PT_A1 8 | ||
13 | #define PT_A2 9 | ||
14 | #define PT_A3 10 | ||
15 | #define PT_A4 11 | ||
16 | #define PT_A5 12 | ||
17 | #define PT_A6 13 | ||
18 | #define PT_D0 14 | ||
19 | #define PT_USP 15 | ||
20 | #define PT_ORIG_D0 16 | ||
21 | #define PT_SR 17 | ||
22 | #define PT_PC 18 | ||
23 | |||
24 | #ifndef __ASSEMBLY__ | ||
25 | |||
26 | /* this struct defines the way the registers are stored on the | ||
27 | stack during a system call. */ | ||
28 | |||
29 | struct pt_regs { | ||
30 | long d1; | ||
31 | long d2; | ||
32 | long d3; | ||
33 | long d4; | ||
34 | long d5; | ||
35 | long a0; | ||
36 | long a1; | ||
37 | long a2; | ||
38 | long d0; | ||
39 | long orig_d0; | ||
40 | long stkadj; | ||
41 | #ifdef CONFIG_COLDFIRE | ||
42 | unsigned format : 4; /* frame format specifier */ | ||
43 | unsigned vector : 12; /* vector offset */ | ||
44 | unsigned short sr; | ||
45 | unsigned long pc; | ||
3 | #else | 46 | #else |
4 | #include "ptrace_mm.h" | 47 | unsigned short sr; |
48 | unsigned long pc; | ||
49 | unsigned format : 4; /* frame format specifier */ | ||
50 | unsigned vector : 12; /* vector offset */ | ||
5 | #endif | 51 | #endif |
52 | }; | ||
53 | |||
54 | /* | ||
55 | * This is the extended stack used by signal handlers and the context | ||
56 | * switcher: it's pushed after the normal "struct pt_regs". | ||
57 | */ | ||
58 | struct switch_stack { | ||
59 | unsigned long d6; | ||
60 | unsigned long d7; | ||
61 | unsigned long a3; | ||
62 | unsigned long a4; | ||
63 | unsigned long a5; | ||
64 | unsigned long a6; | ||
65 | unsigned long retpc; | ||
66 | }; | ||
67 | |||
68 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | ||
69 | #define PTRACE_GETREGS 12 | ||
70 | #define PTRACE_SETREGS 13 | ||
71 | #define PTRACE_GETFPREGS 14 | ||
72 | #define PTRACE_SETFPREGS 15 | ||
73 | |||
74 | #ifdef __KERNEL__ | ||
75 | |||
76 | #ifndef PS_S | ||
77 | #define PS_S (0x2000) | ||
78 | #define PS_M (0x1000) | ||
79 | #endif | ||
80 | |||
81 | #define user_mode(regs) (!((regs)->sr & PS_S)) | ||
82 | #define instruction_pointer(regs) ((regs)->pc) | ||
83 | #define profile_pc(regs) instruction_pointer(regs) | ||
84 | extern void show_regs(struct pt_regs *); | ||
85 | #endif /* __KERNEL__ */ | ||
86 | #endif /* __ASSEMBLY__ */ | ||
87 | #endif /* _M68K_PTRACE_H */ | ||
diff --git a/arch/m68k/include/asm/ptrace_mm.h b/arch/m68k/include/asm/ptrace_mm.h deleted file mode 100644 index 57e763d79bf4..000000000000 --- a/arch/m68k/include/asm/ptrace_mm.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | #ifndef _M68K_PTRACE_H | ||
2 | #define _M68K_PTRACE_H | ||
3 | |||
4 | #define PT_D1 0 | ||
5 | #define PT_D2 1 | ||
6 | #define PT_D3 2 | ||
7 | #define PT_D4 3 | ||
8 | #define PT_D5 4 | ||
9 | #define PT_D6 5 | ||
10 | #define PT_D7 6 | ||
11 | #define PT_A0 7 | ||
12 | #define PT_A1 8 | ||
13 | #define PT_A2 9 | ||
14 | #define PT_A3 10 | ||
15 | #define PT_A4 11 | ||
16 | #define PT_A5 12 | ||
17 | #define PT_A6 13 | ||
18 | #define PT_D0 14 | ||
19 | #define PT_USP 15 | ||
20 | #define PT_ORIG_D0 16 | ||
21 | #define PT_SR 17 | ||
22 | #define PT_PC 18 | ||
23 | |||
24 | #ifndef __ASSEMBLY__ | ||
25 | |||
26 | /* this struct defines the way the registers are stored on the | ||
27 | stack during a system call. */ | ||
28 | |||
29 | struct pt_regs { | ||
30 | long d1; | ||
31 | long d2; | ||
32 | long d3; | ||
33 | long d4; | ||
34 | long d5; | ||
35 | long a0; | ||
36 | long a1; | ||
37 | long a2; | ||
38 | long d0; | ||
39 | long orig_d0; | ||
40 | long stkadj; | ||
41 | unsigned short sr; | ||
42 | unsigned long pc; | ||
43 | unsigned format : 4; /* frame format specifier */ | ||
44 | unsigned vector : 12; /* vector offset */ | ||
45 | }; | ||
46 | |||
47 | /* | ||
48 | * This is the extended stack used by signal handlers and the context | ||
49 | * switcher: it's pushed after the normal "struct pt_regs". | ||
50 | */ | ||
51 | struct switch_stack { | ||
52 | unsigned long d6; | ||
53 | unsigned long d7; | ||
54 | unsigned long a3; | ||
55 | unsigned long a4; | ||
56 | unsigned long a5; | ||
57 | unsigned long a6; | ||
58 | unsigned long retpc; | ||
59 | }; | ||
60 | |||
61 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | ||
62 | #define PTRACE_GETREGS 12 | ||
63 | #define PTRACE_SETREGS 13 | ||
64 | #define PTRACE_GETFPREGS 14 | ||
65 | #define PTRACE_SETFPREGS 15 | ||
66 | |||
67 | #ifdef __KERNEL__ | ||
68 | |||
69 | #ifndef PS_S | ||
70 | #define PS_S (0x2000) | ||
71 | #define PS_M (0x1000) | ||
72 | #endif | ||
73 | |||
74 | #define user_mode(regs) (!((regs)->sr & PS_S)) | ||
75 | #define instruction_pointer(regs) ((regs)->pc) | ||
76 | #define profile_pc(regs) instruction_pointer(regs) | ||
77 | extern void show_regs(struct pt_regs *); | ||
78 | #endif /* __KERNEL__ */ | ||
79 | #endif /* __ASSEMBLY__ */ | ||
80 | #endif /* _M68K_PTRACE_H */ | ||
diff --git a/arch/m68k/include/asm/ptrace_no.h b/arch/m68k/include/asm/ptrace_no.h deleted file mode 100644 index 8c9194b98548..000000000000 --- a/arch/m68k/include/asm/ptrace_no.h +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | #ifndef _M68K_PTRACE_H | ||
2 | #define _M68K_PTRACE_H | ||
3 | |||
4 | #define PT_D1 0 | ||
5 | #define PT_D2 1 | ||
6 | #define PT_D3 2 | ||
7 | #define PT_D4 3 | ||
8 | #define PT_D5 4 | ||
9 | #define PT_D6 5 | ||
10 | #define PT_D7 6 | ||
11 | #define PT_A0 7 | ||
12 | #define PT_A1 8 | ||
13 | #define PT_A2 9 | ||
14 | #define PT_A3 10 | ||
15 | #define PT_A4 11 | ||
16 | #define PT_A5 12 | ||
17 | #define PT_A6 13 | ||
18 | #define PT_D0 14 | ||
19 | #define PT_USP 15 | ||
20 | #define PT_ORIG_D0 16 | ||
21 | #define PT_SR 17 | ||
22 | #define PT_PC 18 | ||
23 | |||
24 | #ifndef __ASSEMBLY__ | ||
25 | |||
26 | /* this struct defines the way the registers are stored on the | ||
27 | stack during a system call. */ | ||
28 | |||
29 | struct pt_regs { | ||
30 | long d1; | ||
31 | long d2; | ||
32 | long d3; | ||
33 | long d4; | ||
34 | long d5; | ||
35 | long a0; | ||
36 | long a1; | ||
37 | long a2; | ||
38 | long d0; | ||
39 | long orig_d0; | ||
40 | long stkadj; | ||
41 | #ifdef CONFIG_COLDFIRE | ||
42 | unsigned format : 4; /* frame format specifier */ | ||
43 | unsigned vector : 12; /* vector offset */ | ||
44 | unsigned short sr; | ||
45 | unsigned long pc; | ||
46 | #else | ||
47 | unsigned short sr; | ||
48 | unsigned long pc; | ||
49 | unsigned format : 4; /* frame format specifier */ | ||
50 | unsigned vector : 12; /* vector offset */ | ||
51 | #endif | ||
52 | }; | ||
53 | |||
54 | /* | ||
55 | * This is the extended stack used by signal handlers and the context | ||
56 | * switcher: it's pushed after the normal "struct pt_regs". | ||
57 | */ | ||
58 | struct switch_stack { | ||
59 | unsigned long d6; | ||
60 | unsigned long d7; | ||
61 | unsigned long a3; | ||
62 | unsigned long a4; | ||
63 | unsigned long a5; | ||
64 | unsigned long a6; | ||
65 | unsigned long retpc; | ||
66 | }; | ||
67 | |||
68 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | ||
69 | #define PTRACE_GETREGS 12 | ||
70 | #define PTRACE_SETREGS 13 | ||
71 | #define PTRACE_GETFPREGS 14 | ||
72 | #define PTRACE_SETFPREGS 15 | ||
73 | |||
74 | #ifdef __KERNEL__ | ||
75 | |||
76 | #ifndef PS_S | ||
77 | #define PS_S (0x2000) | ||
78 | #define PS_M (0x1000) | ||
79 | #endif | ||
80 | |||
81 | #define user_mode(regs) (!((regs)->sr & PS_S)) | ||
82 | #define instruction_pointer(regs) ((regs)->pc) | ||
83 | #define profile_pc(regs) instruction_pointer(regs) | ||
84 | extern void show_regs(struct pt_regs *); | ||
85 | #endif /* __KERNEL__ */ | ||
86 | #endif /* __ASSEMBLY__ */ | ||
87 | #endif /* _M68K_PTRACE_H */ | ||
diff --git a/arch/m68k/include/asm/setup.h b/arch/m68k/include/asm/setup.h index 842f86f75ccd..4dfb3952b375 100644 --- a/arch/m68k/include/asm/setup.h +++ b/arch/m68k/include/asm/setup.h | |||
@@ -1,5 +1,376 @@ | |||
1 | #ifdef __uClinux__ | 1 | /* |
2 | #include "setup_no.h" | 2 | ** asm/setup.h -- Definition of the Linux/m68k setup information |
3 | ** | ||
4 | ** Copyright 1992 by Greg Harp | ||
5 | ** | ||
6 | ** This file is subject to the terms and conditions of the GNU General Public | ||
7 | ** License. See the file COPYING in the main directory of this archive | ||
8 | ** for more details. | ||
9 | ** | ||
10 | ** Created 09/29/92 by Greg Harp | ||
11 | ** | ||
12 | ** 5/2/94 Roman Hodek: | ||
13 | ** Added bi_atari part of the machine dependent union bi_un; for now it | ||
14 | ** contains just a model field to distinguish between TT and Falcon. | ||
15 | ** 26/7/96 Roman Zippel: | ||
16 | ** Renamed to setup.h; added some useful macros to allow gcc some | ||
17 | ** optimizations if possible. | ||
18 | ** 5/10/96 Geert Uytterhoeven: | ||
19 | ** Redesign of the boot information structure; moved boot information | ||
20 | ** structure to bootinfo.h | ||
21 | */ | ||
22 | |||
23 | #ifndef _M68K_SETUP_H | ||
24 | #define _M68K_SETUP_H | ||
25 | |||
26 | |||
27 | |||
28 | /* | ||
29 | * Linux/m68k Architectures | ||
30 | */ | ||
31 | |||
32 | #define MACH_AMIGA 1 | ||
33 | #define MACH_ATARI 2 | ||
34 | #define MACH_MAC 3 | ||
35 | #define MACH_APOLLO 4 | ||
36 | #define MACH_SUN3 5 | ||
37 | #define MACH_MVME147 6 | ||
38 | #define MACH_MVME16x 7 | ||
39 | #define MACH_BVME6000 8 | ||
40 | #define MACH_HP300 9 | ||
41 | #define MACH_Q40 10 | ||
42 | #define MACH_SUN3X 11 | ||
43 | |||
44 | #define COMMAND_LINE_SIZE 256 | ||
45 | |||
46 | #ifdef __KERNEL__ | ||
47 | |||
48 | #define CL_SIZE COMMAND_LINE_SIZE | ||
49 | |||
50 | #ifndef __ASSEMBLY__ | ||
51 | extern unsigned long m68k_machtype; | ||
52 | #endif /* !__ASSEMBLY__ */ | ||
53 | |||
54 | #if !defined(CONFIG_AMIGA) | ||
55 | # define MACH_IS_AMIGA (0) | ||
56 | #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ | ||
57 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
58 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
59 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
60 | # define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA) | ||
3 | #else | 61 | #else |
4 | #include "setup_mm.h" | 62 | # define MACH_AMIGA_ONLY |
63 | # define MACH_IS_AMIGA (1) | ||
64 | # define MACH_TYPE (MACH_AMIGA) | ||
5 | #endif | 65 | #endif |
66 | |||
67 | #if !defined(CONFIG_ATARI) | ||
68 | # define MACH_IS_ATARI (0) | ||
69 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ | ||
70 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
71 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
72 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
73 | # define MACH_IS_ATARI (m68k_machtype == MACH_ATARI) | ||
74 | #else | ||
75 | # define MACH_ATARI_ONLY | ||
76 | # define MACH_IS_ATARI (1) | ||
77 | # define MACH_TYPE (MACH_ATARI) | ||
78 | #endif | ||
79 | |||
80 | #if !defined(CONFIG_MAC) | ||
81 | # define MACH_IS_MAC (0) | ||
82 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \ | ||
83 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
84 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
85 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
86 | # define MACH_IS_MAC (m68k_machtype == MACH_MAC) | ||
87 | #else | ||
88 | # define MACH_MAC_ONLY | ||
89 | # define MACH_IS_MAC (1) | ||
90 | # define MACH_TYPE (MACH_MAC) | ||
91 | #endif | ||
92 | |||
93 | #if defined(CONFIG_SUN3) | ||
94 | #define MACH_IS_SUN3 (1) | ||
95 | #define MACH_SUN3_ONLY (1) | ||
96 | #define MACH_TYPE (MACH_SUN3) | ||
97 | #else | ||
98 | #define MACH_IS_SUN3 (0) | ||
99 | #endif | ||
100 | |||
101 | #if !defined (CONFIG_APOLLO) | ||
102 | # define MACH_IS_APOLLO (0) | ||
103 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
104 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
105 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
106 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
107 | # define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO) | ||
108 | #else | ||
109 | # define MACH_APOLLO_ONLY | ||
110 | # define MACH_IS_APOLLO (1) | ||
111 | # define MACH_TYPE (MACH_APOLLO) | ||
112 | #endif | ||
113 | |||
114 | #if !defined (CONFIG_MVME147) | ||
115 | # define MACH_IS_MVME147 (0) | ||
116 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
117 | || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \ | ||
118 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
119 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x) | ||
120 | # define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147) | ||
121 | #else | ||
122 | # define MACH_MVME147_ONLY | ||
123 | # define MACH_IS_MVME147 (1) | ||
124 | # define MACH_TYPE (MACH_MVME147) | ||
125 | #endif | ||
126 | |||
127 | #if !defined (CONFIG_MVME16x) | ||
128 | # define MACH_IS_MVME16x (0) | ||
129 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
130 | || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \ | ||
131 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
132 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
133 | # define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x) | ||
134 | #else | ||
135 | # define MACH_MVME16x_ONLY | ||
136 | # define MACH_IS_MVME16x (1) | ||
137 | # define MACH_TYPE (MACH_MVME16x) | ||
138 | #endif | ||
139 | |||
140 | #if !defined (CONFIG_BVME6000) | ||
141 | # define MACH_IS_BVME6000 (0) | ||
142 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
143 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
144 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
145 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
146 | # define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000) | ||
147 | #else | ||
148 | # define MACH_BVME6000_ONLY | ||
149 | # define MACH_IS_BVME6000 (1) | ||
150 | # define MACH_TYPE (MACH_BVME6000) | ||
151 | #endif | ||
152 | |||
153 | #if !defined (CONFIG_HP300) | ||
154 | # define MACH_IS_HP300 (0) | ||
155 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
156 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
157 | || defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \ | ||
158 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
159 | # define MACH_IS_HP300 (m68k_machtype == MACH_HP300) | ||
160 | #else | ||
161 | # define MACH_HP300_ONLY | ||
162 | # define MACH_IS_HP300 (1) | ||
163 | # define MACH_TYPE (MACH_HP300) | ||
164 | #endif | ||
165 | |||
166 | #if !defined (CONFIG_Q40) | ||
167 | # define MACH_IS_Q40 (0) | ||
168 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
169 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
170 | || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \ | ||
171 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
172 | # define MACH_IS_Q40 (m68k_machtype == MACH_Q40) | ||
173 | #else | ||
174 | # define MACH_Q40_ONLY | ||
175 | # define MACH_IS_Q40 (1) | ||
176 | # define MACH_TYPE (MACH_Q40) | ||
177 | #endif | ||
178 | |||
179 | #if !defined (CONFIG_SUN3X) | ||
180 | # define MACH_IS_SUN3X (0) | ||
181 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
182 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
183 | || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \ | ||
184 | || defined(CONFIG_Q40) || defined(CONFIG_MVME147) | ||
185 | # define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X) | ||
186 | #else | ||
187 | # define CONFIG_SUN3X_ONLY | ||
188 | # define MACH_IS_SUN3X (1) | ||
189 | # define MACH_TYPE (MACH_SUN3X) | ||
190 | #endif | ||
191 | |||
192 | #ifndef MACH_TYPE | ||
193 | # define MACH_TYPE (m68k_machtype) | ||
194 | #endif | ||
195 | |||
196 | #endif /* __KERNEL__ */ | ||
197 | |||
198 | |||
199 | /* | ||
200 | * CPU, FPU and MMU types | ||
201 | * | ||
202 | * Note: we may rely on the following equalities: | ||
203 | * | ||
204 | * CPU_68020 == MMU_68851 | ||
205 | * CPU_68030 == MMU_68030 | ||
206 | * CPU_68040 == FPU_68040 == MMU_68040 | ||
207 | * CPU_68060 == FPU_68060 == MMU_68060 | ||
208 | */ | ||
209 | |||
210 | #define CPUB_68020 0 | ||
211 | #define CPUB_68030 1 | ||
212 | #define CPUB_68040 2 | ||
213 | #define CPUB_68060 3 | ||
214 | |||
215 | #define CPU_68020 (1<<CPUB_68020) | ||
216 | #define CPU_68030 (1<<CPUB_68030) | ||
217 | #define CPU_68040 (1<<CPUB_68040) | ||
218 | #define CPU_68060 (1<<CPUB_68060) | ||
219 | |||
220 | #define FPUB_68881 0 | ||
221 | #define FPUB_68882 1 | ||
222 | #define FPUB_68040 2 /* Internal FPU */ | ||
223 | #define FPUB_68060 3 /* Internal FPU */ | ||
224 | #define FPUB_SUNFPA 4 /* Sun-3 FPA */ | ||
225 | |||
226 | #define FPU_68881 (1<<FPUB_68881) | ||
227 | #define FPU_68882 (1<<FPUB_68882) | ||
228 | #define FPU_68040 (1<<FPUB_68040) | ||
229 | #define FPU_68060 (1<<FPUB_68060) | ||
230 | #define FPU_SUNFPA (1<<FPUB_SUNFPA) | ||
231 | |||
232 | #define MMUB_68851 0 | ||
233 | #define MMUB_68030 1 /* Internal MMU */ | ||
234 | #define MMUB_68040 2 /* Internal MMU */ | ||
235 | #define MMUB_68060 3 /* Internal MMU */ | ||
236 | #define MMUB_APOLLO 4 /* Custom Apollo */ | ||
237 | #define MMUB_SUN3 5 /* Custom Sun-3 */ | ||
238 | |||
239 | #define MMU_68851 (1<<MMUB_68851) | ||
240 | #define MMU_68030 (1<<MMUB_68030) | ||
241 | #define MMU_68040 (1<<MMUB_68040) | ||
242 | #define MMU_68060 (1<<MMUB_68060) | ||
243 | #define MMU_SUN3 (1<<MMUB_SUN3) | ||
244 | #define MMU_APOLLO (1<<MMUB_APOLLO) | ||
245 | |||
246 | #ifdef __KERNEL__ | ||
247 | |||
248 | #ifndef __ASSEMBLY__ | ||
249 | extern unsigned long m68k_cputype; | ||
250 | extern unsigned long m68k_fputype; | ||
251 | extern unsigned long m68k_mmutype; | ||
252 | #ifdef CONFIG_VME | ||
253 | extern unsigned long vme_brdtype; | ||
254 | #endif | ||
255 | |||
256 | /* | ||
257 | * m68k_is040or060 is != 0 for a '040 or higher; | ||
258 | * used numbers are 4 for 68040 and 6 for 68060. | ||
259 | */ | ||
260 | |||
261 | extern int m68k_is040or060; | ||
262 | #endif /* !__ASSEMBLY__ */ | ||
263 | |||
264 | #if !defined(CONFIG_M68020) | ||
265 | # define CPU_IS_020 (0) | ||
266 | # define MMU_IS_851 (0) | ||
267 | # define MMU_IS_SUN3 (0) | ||
268 | #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060) | ||
269 | # define CPU_IS_020 (m68k_cputype & CPU_68020) | ||
270 | # define MMU_IS_851 (m68k_mmutype & MMU_68851) | ||
271 | # define MMU_IS_SUN3 (0) /* Sun3 not supported with other CPU enabled */ | ||
272 | #else | ||
273 | # define CPU_M68020_ONLY | ||
274 | # define CPU_IS_020 (1) | ||
275 | #ifdef MACH_SUN3_ONLY | ||
276 | # define MMU_IS_SUN3 (1) | ||
277 | # define MMU_IS_851 (0) | ||
278 | #else | ||
279 | # define MMU_IS_SUN3 (0) | ||
280 | # define MMU_IS_851 (1) | ||
281 | #endif | ||
282 | #endif | ||
283 | |||
284 | #if !defined(CONFIG_M68030) | ||
285 | # define CPU_IS_030 (0) | ||
286 | # define MMU_IS_030 (0) | ||
287 | #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060) | ||
288 | # define CPU_IS_030 (m68k_cputype & CPU_68030) | ||
289 | # define MMU_IS_030 (m68k_mmutype & MMU_68030) | ||
290 | #else | ||
291 | # define CPU_M68030_ONLY | ||
292 | # define CPU_IS_030 (1) | ||
293 | # define MMU_IS_030 (1) | ||
294 | #endif | ||
295 | |||
296 | #if !defined(CONFIG_M68040) | ||
297 | # define CPU_IS_040 (0) | ||
298 | # define MMU_IS_040 (0) | ||
299 | #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060) | ||
300 | # define CPU_IS_040 (m68k_cputype & CPU_68040) | ||
301 | # define MMU_IS_040 (m68k_mmutype & MMU_68040) | ||
302 | #else | ||
303 | # define CPU_M68040_ONLY | ||
304 | # define CPU_IS_040 (1) | ||
305 | # define MMU_IS_040 (1) | ||
306 | #endif | ||
307 | |||
308 | #if !defined(CONFIG_M68060) | ||
309 | # define CPU_IS_060 (0) | ||
310 | # define MMU_IS_060 (0) | ||
311 | #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040) | ||
312 | # define CPU_IS_060 (m68k_cputype & CPU_68060) | ||
313 | # define MMU_IS_060 (m68k_mmutype & MMU_68060) | ||
314 | #else | ||
315 | # define CPU_M68060_ONLY | ||
316 | # define CPU_IS_060 (1) | ||
317 | # define MMU_IS_060 (1) | ||
318 | #endif | ||
319 | |||
320 | #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030) | ||
321 | # define CPU_IS_020_OR_030 (0) | ||
322 | #else | ||
323 | # define CPU_M68020_OR_M68030 | ||
324 | # if defined(CONFIG_M68040) || defined(CONFIG_M68060) | ||
325 | # define CPU_IS_020_OR_030 (!m68k_is040or060) | ||
326 | # else | ||
327 | # define CPU_M68020_OR_M68030_ONLY | ||
328 | # define CPU_IS_020_OR_030 (1) | ||
329 | # endif | ||
330 | #endif | ||
331 | |||
332 | #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060) | ||
333 | # define CPU_IS_040_OR_060 (0) | ||
334 | #else | ||
335 | # define CPU_M68040_OR_M68060 | ||
336 | # if defined(CONFIG_M68020) || defined(CONFIG_M68030) | ||
337 | # define CPU_IS_040_OR_060 (m68k_is040or060) | ||
338 | # else | ||
339 | # define CPU_M68040_OR_M68060_ONLY | ||
340 | # define CPU_IS_040_OR_060 (1) | ||
341 | # endif | ||
342 | #endif | ||
343 | |||
344 | #define CPU_TYPE (m68k_cputype) | ||
345 | |||
346 | #ifdef CONFIG_M68KFPU_EMU | ||
347 | # ifdef CONFIG_M68KFPU_EMU_ONLY | ||
348 | # define FPU_IS_EMU (1) | ||
349 | # else | ||
350 | # define FPU_IS_EMU (!m68k_fputype) | ||
351 | # endif | ||
352 | #else | ||
353 | # define FPU_IS_EMU (0) | ||
354 | #endif | ||
355 | |||
356 | |||
357 | /* | ||
358 | * Miscellaneous | ||
359 | */ | ||
360 | |||
361 | #define NUM_MEMINFO 4 | ||
362 | |||
363 | #ifndef __ASSEMBLY__ | ||
364 | struct mem_info { | ||
365 | unsigned long addr; /* physical address of memory chunk */ | ||
366 | unsigned long size; /* length of memory chunk (in bytes) */ | ||
367 | }; | ||
368 | |||
369 | extern int m68k_num_memory; /* # of memory blocks found (and used) */ | ||
370 | extern int m68k_realnum_memory; /* real # of memory blocks found */ | ||
371 | extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ | ||
372 | #endif | ||
373 | |||
374 | #endif /* __KERNEL__ */ | ||
375 | |||
376 | #endif /* _M68K_SETUP_H */ | ||
diff --git a/arch/m68k/include/asm/setup_mm.h b/arch/m68k/include/asm/setup_mm.h deleted file mode 100644 index 4dfb3952b375..000000000000 --- a/arch/m68k/include/asm/setup_mm.h +++ /dev/null | |||
@@ -1,376 +0,0 @@ | |||
1 | /* | ||
2 | ** asm/setup.h -- Definition of the Linux/m68k setup information | ||
3 | ** | ||
4 | ** Copyright 1992 by Greg Harp | ||
5 | ** | ||
6 | ** This file is subject to the terms and conditions of the GNU General Public | ||
7 | ** License. See the file COPYING in the main directory of this archive | ||
8 | ** for more details. | ||
9 | ** | ||
10 | ** Created 09/29/92 by Greg Harp | ||
11 | ** | ||
12 | ** 5/2/94 Roman Hodek: | ||
13 | ** Added bi_atari part of the machine dependent union bi_un; for now it | ||
14 | ** contains just a model field to distinguish between TT and Falcon. | ||
15 | ** 26/7/96 Roman Zippel: | ||
16 | ** Renamed to setup.h; added some useful macros to allow gcc some | ||
17 | ** optimizations if possible. | ||
18 | ** 5/10/96 Geert Uytterhoeven: | ||
19 | ** Redesign of the boot information structure; moved boot information | ||
20 | ** structure to bootinfo.h | ||
21 | */ | ||
22 | |||
23 | #ifndef _M68K_SETUP_H | ||
24 | #define _M68K_SETUP_H | ||
25 | |||
26 | |||
27 | |||
28 | /* | ||
29 | * Linux/m68k Architectures | ||
30 | */ | ||
31 | |||
32 | #define MACH_AMIGA 1 | ||
33 | #define MACH_ATARI 2 | ||
34 | #define MACH_MAC 3 | ||
35 | #define MACH_APOLLO 4 | ||
36 | #define MACH_SUN3 5 | ||
37 | #define MACH_MVME147 6 | ||
38 | #define MACH_MVME16x 7 | ||
39 | #define MACH_BVME6000 8 | ||
40 | #define MACH_HP300 9 | ||
41 | #define MACH_Q40 10 | ||
42 | #define MACH_SUN3X 11 | ||
43 | |||
44 | #define COMMAND_LINE_SIZE 256 | ||
45 | |||
46 | #ifdef __KERNEL__ | ||
47 | |||
48 | #define CL_SIZE COMMAND_LINE_SIZE | ||
49 | |||
50 | #ifndef __ASSEMBLY__ | ||
51 | extern unsigned long m68k_machtype; | ||
52 | #endif /* !__ASSEMBLY__ */ | ||
53 | |||
54 | #if !defined(CONFIG_AMIGA) | ||
55 | # define MACH_IS_AMIGA (0) | ||
56 | #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ | ||
57 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
58 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
59 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
60 | # define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA) | ||
61 | #else | ||
62 | # define MACH_AMIGA_ONLY | ||
63 | # define MACH_IS_AMIGA (1) | ||
64 | # define MACH_TYPE (MACH_AMIGA) | ||
65 | #endif | ||
66 | |||
67 | #if !defined(CONFIG_ATARI) | ||
68 | # define MACH_IS_ATARI (0) | ||
69 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ | ||
70 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
71 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
72 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
73 | # define MACH_IS_ATARI (m68k_machtype == MACH_ATARI) | ||
74 | #else | ||
75 | # define MACH_ATARI_ONLY | ||
76 | # define MACH_IS_ATARI (1) | ||
77 | # define MACH_TYPE (MACH_ATARI) | ||
78 | #endif | ||
79 | |||
80 | #if !defined(CONFIG_MAC) | ||
81 | # define MACH_IS_MAC (0) | ||
82 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \ | ||
83 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
84 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
85 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
86 | # define MACH_IS_MAC (m68k_machtype == MACH_MAC) | ||
87 | #else | ||
88 | # define MACH_MAC_ONLY | ||
89 | # define MACH_IS_MAC (1) | ||
90 | # define MACH_TYPE (MACH_MAC) | ||
91 | #endif | ||
92 | |||
93 | #if defined(CONFIG_SUN3) | ||
94 | #define MACH_IS_SUN3 (1) | ||
95 | #define MACH_SUN3_ONLY (1) | ||
96 | #define MACH_TYPE (MACH_SUN3) | ||
97 | #else | ||
98 | #define MACH_IS_SUN3 (0) | ||
99 | #endif | ||
100 | |||
101 | #if !defined (CONFIG_APOLLO) | ||
102 | # define MACH_IS_APOLLO (0) | ||
103 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
104 | || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \ | ||
105 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
106 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
107 | # define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO) | ||
108 | #else | ||
109 | # define MACH_APOLLO_ONLY | ||
110 | # define MACH_IS_APOLLO (1) | ||
111 | # define MACH_TYPE (MACH_APOLLO) | ||
112 | #endif | ||
113 | |||
114 | #if !defined (CONFIG_MVME147) | ||
115 | # define MACH_IS_MVME147 (0) | ||
116 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
117 | || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \ | ||
118 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
119 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x) | ||
120 | # define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147) | ||
121 | #else | ||
122 | # define MACH_MVME147_ONLY | ||
123 | # define MACH_IS_MVME147 (1) | ||
124 | # define MACH_TYPE (MACH_MVME147) | ||
125 | #endif | ||
126 | |||
127 | #if !defined (CONFIG_MVME16x) | ||
128 | # define MACH_IS_MVME16x (0) | ||
129 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
130 | || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \ | ||
131 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
132 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
133 | # define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x) | ||
134 | #else | ||
135 | # define MACH_MVME16x_ONLY | ||
136 | # define MACH_IS_MVME16x (1) | ||
137 | # define MACH_TYPE (MACH_MVME16x) | ||
138 | #endif | ||
139 | |||
140 | #if !defined (CONFIG_BVME6000) | ||
141 | # define MACH_IS_BVME6000 (0) | ||
142 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
143 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
144 | || defined(CONFIG_HP300) || defined(CONFIG_Q40) \ | ||
145 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
146 | # define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000) | ||
147 | #else | ||
148 | # define MACH_BVME6000_ONLY | ||
149 | # define MACH_IS_BVME6000 (1) | ||
150 | # define MACH_TYPE (MACH_BVME6000) | ||
151 | #endif | ||
152 | |||
153 | #if !defined (CONFIG_HP300) | ||
154 | # define MACH_IS_HP300 (0) | ||
155 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
156 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
157 | || defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \ | ||
158 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
159 | # define MACH_IS_HP300 (m68k_machtype == MACH_HP300) | ||
160 | #else | ||
161 | # define MACH_HP300_ONLY | ||
162 | # define MACH_IS_HP300 (1) | ||
163 | # define MACH_TYPE (MACH_HP300) | ||
164 | #endif | ||
165 | |||
166 | #if !defined (CONFIG_Q40) | ||
167 | # define MACH_IS_Q40 (0) | ||
168 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
169 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
170 | || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \ | ||
171 | || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) | ||
172 | # define MACH_IS_Q40 (m68k_machtype == MACH_Q40) | ||
173 | #else | ||
174 | # define MACH_Q40_ONLY | ||
175 | # define MACH_IS_Q40 (1) | ||
176 | # define MACH_TYPE (MACH_Q40) | ||
177 | #endif | ||
178 | |||
179 | #if !defined (CONFIG_SUN3X) | ||
180 | # define MACH_IS_SUN3X (0) | ||
181 | #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ | ||
182 | || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \ | ||
183 | || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \ | ||
184 | || defined(CONFIG_Q40) || defined(CONFIG_MVME147) | ||
185 | # define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X) | ||
186 | #else | ||
187 | # define CONFIG_SUN3X_ONLY | ||
188 | # define MACH_IS_SUN3X (1) | ||
189 | # define MACH_TYPE (MACH_SUN3X) | ||
190 | #endif | ||
191 | |||
192 | #ifndef MACH_TYPE | ||
193 | # define MACH_TYPE (m68k_machtype) | ||
194 | #endif | ||
195 | |||
196 | #endif /* __KERNEL__ */ | ||
197 | |||
198 | |||
199 | /* | ||
200 | * CPU, FPU and MMU types | ||
201 | * | ||
202 | * Note: we may rely on the following equalities: | ||
203 | * | ||
204 | * CPU_68020 == MMU_68851 | ||
205 | * CPU_68030 == MMU_68030 | ||
206 | * CPU_68040 == FPU_68040 == MMU_68040 | ||
207 | * CPU_68060 == FPU_68060 == MMU_68060 | ||
208 | */ | ||
209 | |||
210 | #define CPUB_68020 0 | ||
211 | #define CPUB_68030 1 | ||
212 | #define CPUB_68040 2 | ||
213 | #define CPUB_68060 3 | ||
214 | |||
215 | #define CPU_68020 (1<<CPUB_68020) | ||
216 | #define CPU_68030 (1<<CPUB_68030) | ||
217 | #define CPU_68040 (1<<CPUB_68040) | ||
218 | #define CPU_68060 (1<<CPUB_68060) | ||
219 | |||
220 | #define FPUB_68881 0 | ||
221 | #define FPUB_68882 1 | ||
222 | #define FPUB_68040 2 /* Internal FPU */ | ||
223 | #define FPUB_68060 3 /* Internal FPU */ | ||
224 | #define FPUB_SUNFPA 4 /* Sun-3 FPA */ | ||
225 | |||
226 | #define FPU_68881 (1<<FPUB_68881) | ||
227 | #define FPU_68882 (1<<FPUB_68882) | ||
228 | #define FPU_68040 (1<<FPUB_68040) | ||
229 | #define FPU_68060 (1<<FPUB_68060) | ||
230 | #define FPU_SUNFPA (1<<FPUB_SUNFPA) | ||
231 | |||
232 | #define MMUB_68851 0 | ||
233 | #define MMUB_68030 1 /* Internal MMU */ | ||
234 | #define MMUB_68040 2 /* Internal MMU */ | ||
235 | #define MMUB_68060 3 /* Internal MMU */ | ||
236 | #define MMUB_APOLLO 4 /* Custom Apollo */ | ||
237 | #define MMUB_SUN3 5 /* Custom Sun-3 */ | ||
238 | |||
239 | #define MMU_68851 (1<<MMUB_68851) | ||
240 | #define MMU_68030 (1<<MMUB_68030) | ||
241 | #define MMU_68040 (1<<MMUB_68040) | ||
242 | #define MMU_68060 (1<<MMUB_68060) | ||
243 | #define MMU_SUN3 (1<<MMUB_SUN3) | ||
244 | #define MMU_APOLLO (1<<MMUB_APOLLO) | ||
245 | |||
246 | #ifdef __KERNEL__ | ||
247 | |||
248 | #ifndef __ASSEMBLY__ | ||
249 | extern unsigned long m68k_cputype; | ||
250 | extern unsigned long m68k_fputype; | ||
251 | extern unsigned long m68k_mmutype; | ||
252 | #ifdef CONFIG_VME | ||
253 | extern unsigned long vme_brdtype; | ||
254 | #endif | ||
255 | |||
256 | /* | ||
257 | * m68k_is040or060 is != 0 for a '040 or higher; | ||
258 | * used numbers are 4 for 68040 and 6 for 68060. | ||
259 | */ | ||
260 | |||
261 | extern int m68k_is040or060; | ||
262 | #endif /* !__ASSEMBLY__ */ | ||
263 | |||
264 | #if !defined(CONFIG_M68020) | ||
265 | # define CPU_IS_020 (0) | ||
266 | # define MMU_IS_851 (0) | ||
267 | # define MMU_IS_SUN3 (0) | ||
268 | #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060) | ||
269 | # define CPU_IS_020 (m68k_cputype & CPU_68020) | ||
270 | # define MMU_IS_851 (m68k_mmutype & MMU_68851) | ||
271 | # define MMU_IS_SUN3 (0) /* Sun3 not supported with other CPU enabled */ | ||
272 | #else | ||
273 | # define CPU_M68020_ONLY | ||
274 | # define CPU_IS_020 (1) | ||
275 | #ifdef MACH_SUN3_ONLY | ||
276 | # define MMU_IS_SUN3 (1) | ||
277 | # define MMU_IS_851 (0) | ||
278 | #else | ||
279 | # define MMU_IS_SUN3 (0) | ||
280 | # define MMU_IS_851 (1) | ||
281 | #endif | ||
282 | #endif | ||
283 | |||
284 | #if !defined(CONFIG_M68030) | ||
285 | # define CPU_IS_030 (0) | ||
286 | # define MMU_IS_030 (0) | ||
287 | #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060) | ||
288 | # define CPU_IS_030 (m68k_cputype & CPU_68030) | ||
289 | # define MMU_IS_030 (m68k_mmutype & MMU_68030) | ||
290 | #else | ||
291 | # define CPU_M68030_ONLY | ||
292 | # define CPU_IS_030 (1) | ||
293 | # define MMU_IS_030 (1) | ||
294 | #endif | ||
295 | |||
296 | #if !defined(CONFIG_M68040) | ||
297 | # define CPU_IS_040 (0) | ||
298 | # define MMU_IS_040 (0) | ||
299 | #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060) | ||
300 | # define CPU_IS_040 (m68k_cputype & CPU_68040) | ||
301 | # define MMU_IS_040 (m68k_mmutype & MMU_68040) | ||
302 | #else | ||
303 | # define CPU_M68040_ONLY | ||
304 | # define CPU_IS_040 (1) | ||
305 | # define MMU_IS_040 (1) | ||
306 | #endif | ||
307 | |||
308 | #if !defined(CONFIG_M68060) | ||
309 | # define CPU_IS_060 (0) | ||
310 | # define MMU_IS_060 (0) | ||
311 | #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040) | ||
312 | # define CPU_IS_060 (m68k_cputype & CPU_68060) | ||
313 | # define MMU_IS_060 (m68k_mmutype & MMU_68060) | ||
314 | #else | ||
315 | # define CPU_M68060_ONLY | ||
316 | # define CPU_IS_060 (1) | ||
317 | # define MMU_IS_060 (1) | ||
318 | #endif | ||
319 | |||
320 | #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030) | ||
321 | # define CPU_IS_020_OR_030 (0) | ||
322 | #else | ||
323 | # define CPU_M68020_OR_M68030 | ||
324 | # if defined(CONFIG_M68040) || defined(CONFIG_M68060) | ||
325 | # define CPU_IS_020_OR_030 (!m68k_is040or060) | ||
326 | # else | ||
327 | # define CPU_M68020_OR_M68030_ONLY | ||
328 | # define CPU_IS_020_OR_030 (1) | ||
329 | # endif | ||
330 | #endif | ||
331 | |||
332 | #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060) | ||
333 | # define CPU_IS_040_OR_060 (0) | ||
334 | #else | ||
335 | # define CPU_M68040_OR_M68060 | ||
336 | # if defined(CONFIG_M68020) || defined(CONFIG_M68030) | ||
337 | # define CPU_IS_040_OR_060 (m68k_is040or060) | ||
338 | # else | ||
339 | # define CPU_M68040_OR_M68060_ONLY | ||
340 | # define CPU_IS_040_OR_060 (1) | ||
341 | # endif | ||
342 | #endif | ||
343 | |||
344 | #define CPU_TYPE (m68k_cputype) | ||
345 | |||
346 | #ifdef CONFIG_M68KFPU_EMU | ||
347 | # ifdef CONFIG_M68KFPU_EMU_ONLY | ||
348 | # define FPU_IS_EMU (1) | ||
349 | # else | ||
350 | # define FPU_IS_EMU (!m68k_fputype) | ||
351 | # endif | ||
352 | #else | ||
353 | # define FPU_IS_EMU (0) | ||
354 | #endif | ||
355 | |||
356 | |||
357 | /* | ||
358 | * Miscellaneous | ||
359 | */ | ||
360 | |||
361 | #define NUM_MEMINFO 4 | ||
362 | |||
363 | #ifndef __ASSEMBLY__ | ||
364 | struct mem_info { | ||
365 | unsigned long addr; /* physical address of memory chunk */ | ||
366 | unsigned long size; /* length of memory chunk (in bytes) */ | ||
367 | }; | ||
368 | |||
369 | extern int m68k_num_memory; /* # of memory blocks found (and used) */ | ||
370 | extern int m68k_realnum_memory; /* real # of memory blocks found */ | ||
371 | extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ | ||
372 | #endif | ||
373 | |||
374 | #endif /* __KERNEL__ */ | ||
375 | |||
376 | #endif /* _M68K_SETUP_H */ | ||
diff --git a/arch/m68k/include/asm/setup_no.h b/arch/m68k/include/asm/setup_no.h deleted file mode 100644 index 45d286ce9398..000000000000 --- a/arch/m68k/include/asm/setup_no.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | |||
3 | #include <asm/setup_mm.h> | ||
4 | |||
5 | /* We have a bigger command line buffer. */ | ||
6 | #undef COMMAND_LINE_SIZE | ||
7 | |||
8 | #endif /* __KERNEL__ */ | ||
9 | |||
10 | #define COMMAND_LINE_SIZE 512 | ||
diff --git a/arch/m68k/include/asm/sigcontext.h b/arch/m68k/include/asm/sigcontext.h index bff6d40345a9..523db2a51cf3 100644 --- a/arch/m68k/include/asm/sigcontext.h +++ b/arch/m68k/include/asm/sigcontext.h | |||
@@ -1,5 +1,24 @@ | |||
1 | #ifndef _ASM_M68k_SIGCONTEXT_H | ||
2 | #define _ASM_M68k_SIGCONTEXT_H | ||
3 | |||
4 | struct sigcontext { | ||
5 | unsigned long sc_mask; /* old sigmask */ | ||
6 | unsigned long sc_usp; /* old user stack pointer */ | ||
7 | unsigned long sc_d0; | ||
8 | unsigned long sc_d1; | ||
9 | unsigned long sc_a0; | ||
10 | unsigned long sc_a1; | ||
1 | #ifdef __uClinux__ | 11 | #ifdef __uClinux__ |
2 | #include "sigcontext_no.h" | 12 | unsigned long sc_a5; |
3 | #else | 13 | #endif |
4 | #include "sigcontext_mm.h" | 14 | unsigned short sc_sr; |
15 | unsigned long sc_pc; | ||
16 | unsigned short sc_formatvec; | ||
17 | #ifndef __uClinux__ | ||
18 | unsigned long sc_fpregs[2*3]; /* room for two fp registers */ | ||
19 | unsigned long sc_fpcntl[3]; | ||
20 | unsigned char sc_fpstate[216]; | ||
21 | #endif | ||
22 | }; | ||
23 | |||
5 | #endif | 24 | #endif |
diff --git a/arch/m68k/include/asm/sigcontext_mm.h b/arch/m68k/include/asm/sigcontext_mm.h deleted file mode 100644 index 64fbe34cf26f..000000000000 --- a/arch/m68k/include/asm/sigcontext_mm.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef _ASM_M68k_SIGCONTEXT_H | ||
2 | #define _ASM_M68k_SIGCONTEXT_H | ||
3 | |||
4 | struct sigcontext { | ||
5 | unsigned long sc_mask; /* old sigmask */ | ||
6 | unsigned long sc_usp; /* old user stack pointer */ | ||
7 | unsigned long sc_d0; | ||
8 | unsigned long sc_d1; | ||
9 | unsigned long sc_a0; | ||
10 | unsigned long sc_a1; | ||
11 | unsigned short sc_sr; | ||
12 | unsigned long sc_pc; | ||
13 | unsigned short sc_formatvec; | ||
14 | unsigned long sc_fpregs[2*3]; /* room for two fp registers */ | ||
15 | unsigned long sc_fpcntl[3]; | ||
16 | unsigned char sc_fpstate[216]; | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/arch/m68k/include/asm/sigcontext_no.h b/arch/m68k/include/asm/sigcontext_no.h deleted file mode 100644 index 36c293fc133d..000000000000 --- a/arch/m68k/include/asm/sigcontext_no.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef _ASM_M68KNOMMU_SIGCONTEXT_H | ||
2 | #define _ASM_M68KNOMMU_SIGCONTEXT_H | ||
3 | |||
4 | struct sigcontext { | ||
5 | unsigned long sc_mask; /* old sigmask */ | ||
6 | unsigned long sc_usp; /* old user stack pointer */ | ||
7 | unsigned long sc_d0; | ||
8 | unsigned long sc_d1; | ||
9 | unsigned long sc_a0; | ||
10 | unsigned long sc_a1; | ||
11 | unsigned long sc_a5; | ||
12 | unsigned short sc_sr; | ||
13 | unsigned long sc_pc; | ||
14 | unsigned short sc_formatvec; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/arch/m68k/include/asm/siginfo.h b/arch/m68k/include/asm/siginfo.h index 61219d7affc8..ca7dde8fd223 100644 --- a/arch/m68k/include/asm/siginfo.h +++ b/arch/m68k/include/asm/siginfo.h | |||
@@ -1,5 +1,97 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_SIGINFO_H |
2 | #include "siginfo_no.h" | 2 | #define _M68K_SIGINFO_H |
3 | |||
4 | #ifndef __uClinux__ | ||
5 | #define HAVE_ARCH_SIGINFO_T | ||
6 | #define HAVE_ARCH_COPY_SIGINFO | ||
7 | #endif | ||
8 | |||
9 | #include <asm-generic/siginfo.h> | ||
10 | |||
11 | #ifndef __uClinux__ | ||
12 | |||
13 | typedef struct siginfo { | ||
14 | int si_signo; | ||
15 | int si_errno; | ||
16 | int si_code; | ||
17 | |||
18 | union { | ||
19 | int _pad[SI_PAD_SIZE]; | ||
20 | |||
21 | /* kill() */ | ||
22 | struct { | ||
23 | __kernel_pid_t _pid; /* sender's pid */ | ||
24 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
25 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
26 | } _kill; | ||
27 | |||
28 | /* POSIX.1b timers */ | ||
29 | struct { | ||
30 | timer_t _tid; /* timer id */ | ||
31 | int _overrun; /* overrun count */ | ||
32 | char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; | ||
33 | sigval_t _sigval; /* same as below */ | ||
34 | int _sys_private; /* not to be passed to user */ | ||
35 | } _timer; | ||
36 | |||
37 | /* POSIX.1b signals */ | ||
38 | struct { | ||
39 | __kernel_pid_t _pid; /* sender's pid */ | ||
40 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
41 | sigval_t _sigval; | ||
42 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
43 | } _rt; | ||
44 | |||
45 | /* SIGCHLD */ | ||
46 | struct { | ||
47 | __kernel_pid_t _pid; /* which child */ | ||
48 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
49 | int _status; /* exit code */ | ||
50 | clock_t _utime; | ||
51 | clock_t _stime; | ||
52 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
53 | } _sigchld; | ||
54 | |||
55 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
56 | struct { | ||
57 | void *_addr; /* faulting insn/memory ref. */ | ||
58 | } _sigfault; | ||
59 | |||
60 | /* SIGPOLL */ | ||
61 | struct { | ||
62 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
63 | int _fd; | ||
64 | } _sigpoll; | ||
65 | } _sifields; | ||
66 | } siginfo_t; | ||
67 | |||
68 | #define UID16_SIGINFO_COMPAT_NEEDED | ||
69 | |||
70 | /* | ||
71 | * How these fields are to be accessed. | ||
72 | */ | ||
73 | #undef si_uid | ||
74 | #ifdef __KERNEL__ | ||
75 | #define si_uid _sifields._kill._uid32 | ||
76 | #define si_uid16 _sifields._kill._uid | ||
3 | #else | 77 | #else |
4 | #include "siginfo_mm.h" | 78 | #define si_uid _sifields._kill._uid |
79 | #endif | ||
80 | |||
81 | #ifdef __KERNEL__ | ||
82 | |||
83 | #include <linux/string.h> | ||
84 | |||
85 | static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) | ||
86 | { | ||
87 | if (from->si_code < 0) | ||
88 | memcpy(to, from, sizeof(*to)); | ||
89 | else | ||
90 | /* _sigchld is currently the largest know union member */ | ||
91 | memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld)); | ||
92 | } | ||
93 | |||
94 | #endif /* __KERNEL__ */ | ||
95 | #endif /* !__uClinux__ */ | ||
96 | |||
5 | #endif | 97 | #endif |
diff --git a/arch/m68k/include/asm/siginfo_mm.h b/arch/m68k/include/asm/siginfo_mm.h deleted file mode 100644 index 05a8d6d90b58..000000000000 --- a/arch/m68k/include/asm/siginfo_mm.h +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | #ifndef _M68K_SIGINFO_H | ||
2 | #define _M68K_SIGINFO_H | ||
3 | |||
4 | #define HAVE_ARCH_SIGINFO_T | ||
5 | #define HAVE_ARCH_COPY_SIGINFO | ||
6 | |||
7 | #include <asm-generic/siginfo.h> | ||
8 | |||
9 | typedef struct siginfo { | ||
10 | int si_signo; | ||
11 | int si_errno; | ||
12 | int si_code; | ||
13 | |||
14 | union { | ||
15 | int _pad[SI_PAD_SIZE]; | ||
16 | |||
17 | /* kill() */ | ||
18 | struct { | ||
19 | __kernel_pid_t _pid; /* sender's pid */ | ||
20 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
21 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
22 | } _kill; | ||
23 | |||
24 | /* POSIX.1b timers */ | ||
25 | struct { | ||
26 | timer_t _tid; /* timer id */ | ||
27 | int _overrun; /* overrun count */ | ||
28 | char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; | ||
29 | sigval_t _sigval; /* same as below */ | ||
30 | int _sys_private; /* not to be passed to user */ | ||
31 | } _timer; | ||
32 | |||
33 | /* POSIX.1b signals */ | ||
34 | struct { | ||
35 | __kernel_pid_t _pid; /* sender's pid */ | ||
36 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
37 | sigval_t _sigval; | ||
38 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
39 | } _rt; | ||
40 | |||
41 | /* SIGCHLD */ | ||
42 | struct { | ||
43 | __kernel_pid_t _pid; /* which child */ | ||
44 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
45 | int _status; /* exit code */ | ||
46 | clock_t _utime; | ||
47 | clock_t _stime; | ||
48 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
49 | } _sigchld; | ||
50 | |||
51 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
52 | struct { | ||
53 | void *_addr; /* faulting insn/memory ref. */ | ||
54 | } _sigfault; | ||
55 | |||
56 | /* SIGPOLL */ | ||
57 | struct { | ||
58 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
59 | int _fd; | ||
60 | } _sigpoll; | ||
61 | } _sifields; | ||
62 | } siginfo_t; | ||
63 | |||
64 | #define UID16_SIGINFO_COMPAT_NEEDED | ||
65 | |||
66 | /* | ||
67 | * How these fields are to be accessed. | ||
68 | */ | ||
69 | #undef si_uid | ||
70 | #ifdef __KERNEL__ | ||
71 | #define si_uid _sifields._kill._uid32 | ||
72 | #define si_uid16 _sifields._kill._uid | ||
73 | #else | ||
74 | #define si_uid _sifields._kill._uid | ||
75 | #endif | ||
76 | |||
77 | #ifdef __KERNEL__ | ||
78 | |||
79 | #include <linux/string.h> | ||
80 | |||
81 | static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) | ||
82 | { | ||
83 | if (from->si_code < 0) | ||
84 | memcpy(to, from, sizeof(*to)); | ||
85 | else | ||
86 | /* _sigchld is currently the largest know union member */ | ||
87 | memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld)); | ||
88 | } | ||
89 | |||
90 | #endif /* __KERNEL__ */ | ||
91 | |||
92 | #endif | ||
diff --git a/arch/m68k/include/asm/siginfo_no.h b/arch/m68k/include/asm/siginfo_no.h deleted file mode 100644 index b18e5f4064ae..000000000000 --- a/arch/m68k/include/asm/siginfo_no.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_SIGINFO_H | ||
2 | #define _M68KNOMMU_SIGINFO_H | ||
3 | |||
4 | #include <asm-generic/siginfo.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h index 3c19988bd93c..08788fdefde0 100644 --- a/arch/m68k/include/asm/signal.h +++ b/arch/m68k/include/asm/signal.h | |||
@@ -1,5 +1,213 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_SIGNAL_H |
2 | #include "signal_no.h" | 2 | #define _M68K_SIGNAL_H |
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Avoid too many header ordering problems. */ | ||
7 | struct siginfo; | ||
8 | |||
9 | #ifdef __KERNEL__ | ||
10 | /* Most things should be clean enough to redefine this at will, if care | ||
11 | is taken to make libc match. */ | ||
12 | |||
13 | #define _NSIG 64 | ||
14 | #define _NSIG_BPW 32 | ||
15 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
16 | |||
17 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
18 | |||
19 | typedef struct { | ||
20 | unsigned long sig[_NSIG_WORDS]; | ||
21 | } sigset_t; | ||
22 | |||
3 | #else | 23 | #else |
4 | #include "signal_mm.h" | 24 | /* Here we must cater to libcs that poke about in kernel headers. */ |
5 | #endif | 25 | |
26 | #define NSIG 32 | ||
27 | typedef unsigned long sigset_t; | ||
28 | |||
29 | #endif /* __KERNEL__ */ | ||
30 | |||
31 | #define SIGHUP 1 | ||
32 | #define SIGINT 2 | ||
33 | #define SIGQUIT 3 | ||
34 | #define SIGILL 4 | ||
35 | #define SIGTRAP 5 | ||
36 | #define SIGABRT 6 | ||
37 | #define SIGIOT 6 | ||
38 | #define SIGBUS 7 | ||
39 | #define SIGFPE 8 | ||
40 | #define SIGKILL 9 | ||
41 | #define SIGUSR1 10 | ||
42 | #define SIGSEGV 11 | ||
43 | #define SIGUSR2 12 | ||
44 | #define SIGPIPE 13 | ||
45 | #define SIGALRM 14 | ||
46 | #define SIGTERM 15 | ||
47 | #define SIGSTKFLT 16 | ||
48 | #define SIGCHLD 17 | ||
49 | #define SIGCONT 18 | ||
50 | #define SIGSTOP 19 | ||
51 | #define SIGTSTP 20 | ||
52 | #define SIGTTIN 21 | ||
53 | #define SIGTTOU 22 | ||
54 | #define SIGURG 23 | ||
55 | #define SIGXCPU 24 | ||
56 | #define SIGXFSZ 25 | ||
57 | #define SIGVTALRM 26 | ||
58 | #define SIGPROF 27 | ||
59 | #define SIGWINCH 28 | ||
60 | #define SIGIO 29 | ||
61 | #define SIGPOLL SIGIO | ||
62 | /* | ||
63 | #define SIGLOST 29 | ||
64 | */ | ||
65 | #define SIGPWR 30 | ||
66 | #define SIGSYS 31 | ||
67 | #define SIGUNUSED 31 | ||
68 | |||
69 | /* These should not be considered constants from userland. */ | ||
70 | #define SIGRTMIN 32 | ||
71 | #define SIGRTMAX _NSIG | ||
72 | |||
73 | /* | ||
74 | * SA_FLAGS values: | ||
75 | * | ||
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
77 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
79 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
80 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
81 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
82 | * | ||
83 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
84 | * Unix names RESETHAND and NODEFER respectively. | ||
85 | */ | ||
86 | #define SA_NOCLDSTOP 0x00000001 | ||
87 | #define SA_NOCLDWAIT 0x00000002 | ||
88 | #define SA_SIGINFO 0x00000004 | ||
89 | #define SA_ONSTACK 0x08000000 | ||
90 | #define SA_RESTART 0x10000000 | ||
91 | #define SA_NODEFER 0x40000000 | ||
92 | #define SA_RESETHAND 0x80000000 | ||
93 | |||
94 | #define SA_NOMASK SA_NODEFER | ||
95 | #define SA_ONESHOT SA_RESETHAND | ||
96 | |||
97 | /* | ||
98 | * sigaltstack controls | ||
99 | */ | ||
100 | #define SS_ONSTACK 1 | ||
101 | #define SS_DISABLE 2 | ||
102 | |||
103 | #define MINSIGSTKSZ 2048 | ||
104 | #define SIGSTKSZ 8192 | ||
105 | |||
106 | #include <asm-generic/signal.h> | ||
107 | |||
108 | #ifdef __KERNEL__ | ||
109 | struct old_sigaction { | ||
110 | __sighandler_t sa_handler; | ||
111 | old_sigset_t sa_mask; | ||
112 | unsigned long sa_flags; | ||
113 | __sigrestore_t sa_restorer; | ||
114 | }; | ||
115 | |||
116 | struct sigaction { | ||
117 | __sighandler_t sa_handler; | ||
118 | unsigned long sa_flags; | ||
119 | __sigrestore_t sa_restorer; | ||
120 | sigset_t sa_mask; /* mask last for extensibility */ | ||
121 | }; | ||
122 | |||
123 | struct k_sigaction { | ||
124 | struct sigaction sa; | ||
125 | }; | ||
126 | #else | ||
127 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
128 | |||
129 | struct sigaction { | ||
130 | union { | ||
131 | __sighandler_t _sa_handler; | ||
132 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
133 | } _u; | ||
134 | sigset_t sa_mask; | ||
135 | unsigned long sa_flags; | ||
136 | void (*sa_restorer)(void); | ||
137 | }; | ||
138 | |||
139 | #define sa_handler _u._sa_handler | ||
140 | #define sa_sigaction _u._sa_sigaction | ||
141 | |||
142 | #endif /* __KERNEL__ */ | ||
143 | |||
144 | typedef struct sigaltstack { | ||
145 | void __user *ss_sp; | ||
146 | int ss_flags; | ||
147 | size_t ss_size; | ||
148 | } stack_t; | ||
149 | |||
150 | #ifdef __KERNEL__ | ||
151 | #include <asm/sigcontext.h> | ||
152 | |||
153 | #ifndef __uClinux__ | ||
154 | #define __HAVE_ARCH_SIG_BITOPS | ||
155 | |||
156 | static inline void sigaddset(sigset_t *set, int _sig) | ||
157 | { | ||
158 | asm ("bfset %0{%1,#1}" | ||
159 | : "+od" (*set) | ||
160 | : "id" ((_sig - 1) ^ 31) | ||
161 | : "cc"); | ||
162 | } | ||
163 | |||
164 | static inline void sigdelset(sigset_t *set, int _sig) | ||
165 | { | ||
166 | asm ("bfclr %0{%1,#1}" | ||
167 | : "+od" (*set) | ||
168 | : "id" ((_sig - 1) ^ 31) | ||
169 | : "cc"); | ||
170 | } | ||
171 | |||
172 | static inline int __const_sigismember(sigset_t *set, int _sig) | ||
173 | { | ||
174 | unsigned long sig = _sig - 1; | ||
175 | return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW)); | ||
176 | } | ||
177 | |||
178 | static inline int __gen_sigismember(sigset_t *set, int _sig) | ||
179 | { | ||
180 | int ret; | ||
181 | asm ("bfextu %1{%2,#1},%0" | ||
182 | : "=d" (ret) | ||
183 | : "od" (*set), "id" ((_sig-1) ^ 31) | ||
184 | : "cc"); | ||
185 | return ret; | ||
186 | } | ||
187 | |||
188 | #define sigismember(set,sig) \ | ||
189 | (__builtin_constant_p(sig) ? \ | ||
190 | __const_sigismember(set,sig) : \ | ||
191 | __gen_sigismember(set,sig)) | ||
192 | |||
193 | static inline int sigfindinword(unsigned long word) | ||
194 | { | ||
195 | asm ("bfffo %1{#0,#0},%0" | ||
196 | : "=d" (word) | ||
197 | : "d" (word & -word) | ||
198 | : "cc"); | ||
199 | return word ^ 31; | ||
200 | } | ||
201 | |||
202 | struct pt_regs; | ||
203 | extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); | ||
204 | |||
205 | #else | ||
206 | |||
207 | #undef __HAVE_ARCH_SIG_BITOPS | ||
208 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | ||
209 | |||
210 | #endif /* __uClinux__ */ | ||
211 | #endif /* __KERNEL__ */ | ||
212 | |||
213 | #endif /* _M68K_SIGNAL_H */ | ||
diff --git a/arch/m68k/include/asm/signal_mm.h b/arch/m68k/include/asm/signal_mm.h deleted file mode 100644 index 3db8a81942f1..000000000000 --- a/arch/m68k/include/asm/signal_mm.h +++ /dev/null | |||
@@ -1,206 +0,0 @@ | |||
1 | #ifndef _M68K_SIGNAL_H | ||
2 | #define _M68K_SIGNAL_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Avoid too many header ordering problems. */ | ||
7 | struct siginfo; | ||
8 | |||
9 | #ifdef __KERNEL__ | ||
10 | /* Most things should be clean enough to redefine this at will, if care | ||
11 | is taken to make libc match. */ | ||
12 | |||
13 | #define _NSIG 64 | ||
14 | #define _NSIG_BPW 32 | ||
15 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
16 | |||
17 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
18 | |||
19 | typedef struct { | ||
20 | unsigned long sig[_NSIG_WORDS]; | ||
21 | } sigset_t; | ||
22 | |||
23 | #else | ||
24 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
25 | |||
26 | #define NSIG 32 | ||
27 | typedef unsigned long sigset_t; | ||
28 | |||
29 | #endif /* __KERNEL__ */ | ||
30 | |||
31 | #define SIGHUP 1 | ||
32 | #define SIGINT 2 | ||
33 | #define SIGQUIT 3 | ||
34 | #define SIGILL 4 | ||
35 | #define SIGTRAP 5 | ||
36 | #define SIGABRT 6 | ||
37 | #define SIGIOT 6 | ||
38 | #define SIGBUS 7 | ||
39 | #define SIGFPE 8 | ||
40 | #define SIGKILL 9 | ||
41 | #define SIGUSR1 10 | ||
42 | #define SIGSEGV 11 | ||
43 | #define SIGUSR2 12 | ||
44 | #define SIGPIPE 13 | ||
45 | #define SIGALRM 14 | ||
46 | #define SIGTERM 15 | ||
47 | #define SIGSTKFLT 16 | ||
48 | #define SIGCHLD 17 | ||
49 | #define SIGCONT 18 | ||
50 | #define SIGSTOP 19 | ||
51 | #define SIGTSTP 20 | ||
52 | #define SIGTTIN 21 | ||
53 | #define SIGTTOU 22 | ||
54 | #define SIGURG 23 | ||
55 | #define SIGXCPU 24 | ||
56 | #define SIGXFSZ 25 | ||
57 | #define SIGVTALRM 26 | ||
58 | #define SIGPROF 27 | ||
59 | #define SIGWINCH 28 | ||
60 | #define SIGIO 29 | ||
61 | #define SIGPOLL SIGIO | ||
62 | /* | ||
63 | #define SIGLOST 29 | ||
64 | */ | ||
65 | #define SIGPWR 30 | ||
66 | #define SIGSYS 31 | ||
67 | #define SIGUNUSED 31 | ||
68 | |||
69 | /* These should not be considered constants from userland. */ | ||
70 | #define SIGRTMIN 32 | ||
71 | #define SIGRTMAX _NSIG | ||
72 | |||
73 | /* | ||
74 | * SA_FLAGS values: | ||
75 | * | ||
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
77 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
79 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
80 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
81 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
82 | * | ||
83 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
84 | * Unix names RESETHAND and NODEFER respectively. | ||
85 | */ | ||
86 | #define SA_NOCLDSTOP 0x00000001 | ||
87 | #define SA_NOCLDWAIT 0x00000002 | ||
88 | #define SA_SIGINFO 0x00000004 | ||
89 | #define SA_ONSTACK 0x08000000 | ||
90 | #define SA_RESTART 0x10000000 | ||
91 | #define SA_NODEFER 0x40000000 | ||
92 | #define SA_RESETHAND 0x80000000 | ||
93 | |||
94 | #define SA_NOMASK SA_NODEFER | ||
95 | #define SA_ONESHOT SA_RESETHAND | ||
96 | |||
97 | /* | ||
98 | * sigaltstack controls | ||
99 | */ | ||
100 | #define SS_ONSTACK 1 | ||
101 | #define SS_DISABLE 2 | ||
102 | |||
103 | #define MINSIGSTKSZ 2048 | ||
104 | #define SIGSTKSZ 8192 | ||
105 | |||
106 | #include <asm-generic/signal.h> | ||
107 | |||
108 | #ifdef __KERNEL__ | ||
109 | struct old_sigaction { | ||
110 | __sighandler_t sa_handler; | ||
111 | old_sigset_t sa_mask; | ||
112 | unsigned long sa_flags; | ||
113 | __sigrestore_t sa_restorer; | ||
114 | }; | ||
115 | |||
116 | struct sigaction { | ||
117 | __sighandler_t sa_handler; | ||
118 | unsigned long sa_flags; | ||
119 | __sigrestore_t sa_restorer; | ||
120 | sigset_t sa_mask; /* mask last for extensibility */ | ||
121 | }; | ||
122 | |||
123 | struct k_sigaction { | ||
124 | struct sigaction sa; | ||
125 | }; | ||
126 | #else | ||
127 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
128 | |||
129 | struct sigaction { | ||
130 | union { | ||
131 | __sighandler_t _sa_handler; | ||
132 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
133 | } _u; | ||
134 | sigset_t sa_mask; | ||
135 | unsigned long sa_flags; | ||
136 | void (*sa_restorer)(void); | ||
137 | }; | ||
138 | |||
139 | #define sa_handler _u._sa_handler | ||
140 | #define sa_sigaction _u._sa_sigaction | ||
141 | |||
142 | #endif /* __KERNEL__ */ | ||
143 | |||
144 | typedef struct sigaltstack { | ||
145 | void __user *ss_sp; | ||
146 | int ss_flags; | ||
147 | size_t ss_size; | ||
148 | } stack_t; | ||
149 | |||
150 | #ifdef __KERNEL__ | ||
151 | #include <asm/sigcontext.h> | ||
152 | |||
153 | #define __HAVE_ARCH_SIG_BITOPS | ||
154 | |||
155 | static inline void sigaddset(sigset_t *set, int _sig) | ||
156 | { | ||
157 | asm ("bfset %0{%1,#1}" | ||
158 | : "+od" (*set) | ||
159 | : "id" ((_sig - 1) ^ 31) | ||
160 | : "cc"); | ||
161 | } | ||
162 | |||
163 | static inline void sigdelset(sigset_t *set, int _sig) | ||
164 | { | ||
165 | asm ("bfclr %0{%1,#1}" | ||
166 | : "+od" (*set) | ||
167 | : "id" ((_sig - 1) ^ 31) | ||
168 | : "cc"); | ||
169 | } | ||
170 | |||
171 | static inline int __const_sigismember(sigset_t *set, int _sig) | ||
172 | { | ||
173 | unsigned long sig = _sig - 1; | ||
174 | return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW)); | ||
175 | } | ||
176 | |||
177 | static inline int __gen_sigismember(sigset_t *set, int _sig) | ||
178 | { | ||
179 | int ret; | ||
180 | asm ("bfextu %1{%2,#1},%0" | ||
181 | : "=d" (ret) | ||
182 | : "od" (*set), "id" ((_sig-1) ^ 31) | ||
183 | : "cc"); | ||
184 | return ret; | ||
185 | } | ||
186 | |||
187 | #define sigismember(set,sig) \ | ||
188 | (__builtin_constant_p(sig) ? \ | ||
189 | __const_sigismember(set,sig) : \ | ||
190 | __gen_sigismember(set,sig)) | ||
191 | |||
192 | static inline int sigfindinword(unsigned long word) | ||
193 | { | ||
194 | asm ("bfffo %1{#0,#0},%0" | ||
195 | : "=d" (word) | ||
196 | : "d" (word & -word) | ||
197 | : "cc"); | ||
198 | return word ^ 31; | ||
199 | } | ||
200 | |||
201 | struct pt_regs; | ||
202 | extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); | ||
203 | |||
204 | #endif /* __KERNEL__ */ | ||
205 | |||
206 | #endif /* _M68K_SIGNAL_H */ | ||
diff --git a/arch/m68k/include/asm/signal_no.h b/arch/m68k/include/asm/signal_no.h deleted file mode 100644 index 216c08be54a0..000000000000 --- a/arch/m68k/include/asm/signal_no.h +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_SIGNAL_H | ||
2 | #define _M68KNOMMU_SIGNAL_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Avoid too many header ordering problems. */ | ||
7 | struct siginfo; | ||
8 | |||
9 | #ifdef __KERNEL__ | ||
10 | /* Most things should be clean enough to redefine this at will, if care | ||
11 | is taken to make libc match. */ | ||
12 | |||
13 | #define _NSIG 64 | ||
14 | #define _NSIG_BPW 32 | ||
15 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
16 | |||
17 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
18 | |||
19 | typedef struct { | ||
20 | unsigned long sig[_NSIG_WORDS]; | ||
21 | } sigset_t; | ||
22 | |||
23 | #else | ||
24 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
25 | |||
26 | #define NSIG 32 | ||
27 | typedef unsigned long sigset_t; | ||
28 | |||
29 | #endif /* __KERNEL__ */ | ||
30 | |||
31 | #define SIGHUP 1 | ||
32 | #define SIGINT 2 | ||
33 | #define SIGQUIT 3 | ||
34 | #define SIGILL 4 | ||
35 | #define SIGTRAP 5 | ||
36 | #define SIGABRT 6 | ||
37 | #define SIGIOT 6 | ||
38 | #define SIGBUS 7 | ||
39 | #define SIGFPE 8 | ||
40 | #define SIGKILL 9 | ||
41 | #define SIGUSR1 10 | ||
42 | #define SIGSEGV 11 | ||
43 | #define SIGUSR2 12 | ||
44 | #define SIGPIPE 13 | ||
45 | #define SIGALRM 14 | ||
46 | #define SIGTERM 15 | ||
47 | #define SIGSTKFLT 16 | ||
48 | #define SIGCHLD 17 | ||
49 | #define SIGCONT 18 | ||
50 | #define SIGSTOP 19 | ||
51 | #define SIGTSTP 20 | ||
52 | #define SIGTTIN 21 | ||
53 | #define SIGTTOU 22 | ||
54 | #define SIGURG 23 | ||
55 | #define SIGXCPU 24 | ||
56 | #define SIGXFSZ 25 | ||
57 | #define SIGVTALRM 26 | ||
58 | #define SIGPROF 27 | ||
59 | #define SIGWINCH 28 | ||
60 | #define SIGIO 29 | ||
61 | #define SIGPOLL SIGIO | ||
62 | /* | ||
63 | #define SIGLOST 29 | ||
64 | */ | ||
65 | #define SIGPWR 30 | ||
66 | #define SIGSYS 31 | ||
67 | #define SIGUNUSED 31 | ||
68 | |||
69 | /* These should not be considered constants from userland. */ | ||
70 | #define SIGRTMIN 32 | ||
71 | #define SIGRTMAX _NSIG | ||
72 | |||
73 | /* | ||
74 | * SA_FLAGS values: | ||
75 | * | ||
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
77 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
79 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
80 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
81 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
82 | * | ||
83 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
84 | * Unix names RESETHAND and NODEFER respectively. | ||
85 | */ | ||
86 | #define SA_NOCLDSTOP 0x00000001 | ||
87 | #define SA_NOCLDWAIT 0x00000002 | ||
88 | #define SA_SIGINFO 0x00000004 | ||
89 | #define SA_ONSTACK 0x08000000 | ||
90 | #define SA_RESTART 0x10000000 | ||
91 | #define SA_NODEFER 0x40000000 | ||
92 | #define SA_RESETHAND 0x80000000 | ||
93 | |||
94 | #define SA_NOMASK SA_NODEFER | ||
95 | #define SA_ONESHOT SA_RESETHAND | ||
96 | |||
97 | /* | ||
98 | * sigaltstack controls | ||
99 | */ | ||
100 | #define SS_ONSTACK 1 | ||
101 | #define SS_DISABLE 2 | ||
102 | |||
103 | #define MINSIGSTKSZ 2048 | ||
104 | #define SIGSTKSZ 8192 | ||
105 | |||
106 | #include <asm-generic/signal.h> | ||
107 | |||
108 | #ifdef __KERNEL__ | ||
109 | struct old_sigaction { | ||
110 | __sighandler_t sa_handler; | ||
111 | old_sigset_t sa_mask; | ||
112 | unsigned long sa_flags; | ||
113 | void (*sa_restorer)(void); | ||
114 | }; | ||
115 | |||
116 | struct sigaction { | ||
117 | __sighandler_t sa_handler; | ||
118 | unsigned long sa_flags; | ||
119 | void (*sa_restorer)(void); | ||
120 | sigset_t sa_mask; /* mask last for extensibility */ | ||
121 | }; | ||
122 | |||
123 | struct k_sigaction { | ||
124 | struct sigaction sa; | ||
125 | }; | ||
126 | #else | ||
127 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
128 | |||
129 | struct sigaction { | ||
130 | union { | ||
131 | __sighandler_t _sa_handler; | ||
132 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
133 | } _u; | ||
134 | sigset_t sa_mask; | ||
135 | unsigned long sa_flags; | ||
136 | void (*sa_restorer)(void); | ||
137 | }; | ||
138 | |||
139 | #define sa_handler _u._sa_handler | ||
140 | #define sa_sigaction _u._sa_sigaction | ||
141 | |||
142 | #endif /* __KERNEL__ */ | ||
143 | |||
144 | typedef struct sigaltstack { | ||
145 | void *ss_sp; | ||
146 | int ss_flags; | ||
147 | size_t ss_size; | ||
148 | } stack_t; | ||
149 | |||
150 | #ifdef __KERNEL__ | ||
151 | |||
152 | #include <asm/sigcontext.h> | ||
153 | #undef __HAVE_ARCH_SIG_BITOPS | ||
154 | |||
155 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | ||
156 | |||
157 | #endif /* __KERNEL__ */ | ||
158 | |||
159 | #endif /* _M68KNOMMU_SIGNAL_H */ | ||
diff --git a/arch/m68k/include/asm/swab.h b/arch/m68k/include/asm/swab.h index 7d7dde1c73ec..9e3054ea59e9 100644 --- a/arch/m68k/include/asm/swab.h +++ b/arch/m68k/include/asm/swab.h | |||
@@ -1,5 +1,27 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_SWAB_H |
2 | #include "swab_no.h" | 2 | #define _M68K_SWAB_H |
3 | #else | 3 | |
4 | #include "swab_mm.h" | 4 | #include <asm/types.h> |
5 | #include <linux/compiler.h> | ||
6 | |||
7 | #define __SWAB_64_THRU_32__ | ||
8 | |||
9 | #if defined (__mcfisaaplus__) || defined (__mcfisac__) | ||
10 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
11 | { | ||
12 | __asm__("byterev %0" : "=d" (val) : "0" (val)); | ||
13 | return val; | ||
14 | } | ||
15 | |||
16 | #define __arch_swab32 __arch_swab32 | ||
17 | #elif !defined(__uClinux__) | ||
18 | |||
19 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
20 | { | ||
21 | __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); | ||
22 | return val; | ||
23 | } | ||
24 | #define __arch_swab32 __arch_swab32 | ||
5 | #endif | 25 | #endif |
26 | |||
27 | #endif /* _M68K_SWAB_H */ | ||
diff --git a/arch/m68k/include/asm/swab_mm.h b/arch/m68k/include/asm/swab_mm.h deleted file mode 100644 index 7221e3066825..000000000000 --- a/arch/m68k/include/asm/swab_mm.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef _M68K_SWAB_H | ||
2 | #define _M68K_SWAB_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | #include <linux/compiler.h> | ||
6 | |||
7 | #define __SWAB_64_THRU_32__ | ||
8 | |||
9 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
10 | { | ||
11 | __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); | ||
12 | return val; | ||
13 | } | ||
14 | #define __arch_swab32 __arch_swab32 | ||
15 | |||
16 | #endif /* _M68K_SWAB_H */ | ||
diff --git a/arch/m68k/include/asm/swab_no.h b/arch/m68k/include/asm/swab_no.h deleted file mode 100644 index e582257db300..000000000000 --- a/arch/m68k/include/asm/swab_no.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_SWAB_H | ||
2 | #define _M68KNOMMU_SWAB_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
7 | # define __SWAB_64_THRU_32__ | ||
8 | #endif | ||
9 | |||
10 | #if defined (__mcfisaaplus__) || defined (__mcfisac__) | ||
11 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
12 | { | ||
13 | asm( | ||
14 | "byterev %0" | ||
15 | : "=d" (val) | ||
16 | : "0" (val) | ||
17 | ); | ||
18 | return val; | ||
19 | } | ||
20 | |||
21 | #define __arch_swab32 __arch_swab32 | ||
22 | #endif | ||
23 | |||
24 | #endif /* _M68KNOMMU_SWAB_H */ | ||
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index df1d9d4cb1fd..3c19027331fa 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -1,5 +1,372 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _ASM_M68K_UNISTD_H_ |
2 | #include "unistd_no.h" | 2 | #define _ASM_M68K_UNISTD_H_ |
3 | #else | 3 | |
4 | #include "unistd_mm.h" | 4 | /* |
5 | #endif | 5 | * This file contains the system call numbers. |
6 | */ | ||
7 | |||
8 | #define __NR_restart_syscall 0 | ||
9 | #define __NR_exit 1 | ||
10 | #define __NR_fork 2 | ||
11 | #define __NR_read 3 | ||
12 | #define __NR_write 4 | ||
13 | #define __NR_open 5 | ||
14 | #define __NR_close 6 | ||
15 | #define __NR_waitpid 7 | ||
16 | #define __NR_creat 8 | ||
17 | #define __NR_link 9 | ||
18 | #define __NR_unlink 10 | ||
19 | #define __NR_execve 11 | ||
20 | #define __NR_chdir 12 | ||
21 | #define __NR_time 13 | ||
22 | #define __NR_mknod 14 | ||
23 | #define __NR_chmod 15 | ||
24 | #define __NR_chown 16 | ||
25 | #define __NR_break 17 | ||
26 | #define __NR_oldstat 18 | ||
27 | #define __NR_lseek 19 | ||
28 | #define __NR_getpid 20 | ||
29 | #define __NR_mount 21 | ||
30 | #define __NR_umount 22 | ||
31 | #define __NR_setuid 23 | ||
32 | #define __NR_getuid 24 | ||
33 | #define __NR_stime 25 | ||
34 | #define __NR_ptrace 26 | ||
35 | #define __NR_alarm 27 | ||
36 | #define __NR_oldfstat 28 | ||
37 | #define __NR_pause 29 | ||
38 | #define __NR_utime 30 | ||
39 | #define __NR_stty 31 | ||
40 | #define __NR_gtty 32 | ||
41 | #define __NR_access 33 | ||
42 | #define __NR_nice 34 | ||
43 | #define __NR_ftime 35 | ||
44 | #define __NR_sync 36 | ||
45 | #define __NR_kill 37 | ||
46 | #define __NR_rename 38 | ||
47 | #define __NR_mkdir 39 | ||
48 | #define __NR_rmdir 40 | ||
49 | #define __NR_dup 41 | ||
50 | #define __NR_pipe 42 | ||
51 | #define __NR_times 43 | ||
52 | #define __NR_prof 44 | ||
53 | #define __NR_brk 45 | ||
54 | #define __NR_setgid 46 | ||
55 | #define __NR_getgid 47 | ||
56 | #define __NR_signal 48 | ||
57 | #define __NR_geteuid 49 | ||
58 | #define __NR_getegid 50 | ||
59 | #define __NR_acct 51 | ||
60 | #define __NR_umount2 52 | ||
61 | #define __NR_lock 53 | ||
62 | #define __NR_ioctl 54 | ||
63 | #define __NR_fcntl 55 | ||
64 | #define __NR_mpx 56 | ||
65 | #define __NR_setpgid 57 | ||
66 | #define __NR_ulimit 58 | ||
67 | #define __NR_oldolduname 59 | ||
68 | #define __NR_umask 60 | ||
69 | #define __NR_chroot 61 | ||
70 | #define __NR_ustat 62 | ||
71 | #define __NR_dup2 63 | ||
72 | #define __NR_getppid 64 | ||
73 | #define __NR_getpgrp 65 | ||
74 | #define __NR_setsid 66 | ||
75 | #define __NR_sigaction 67 | ||
76 | #define __NR_sgetmask 68 | ||
77 | #define __NR_ssetmask 69 | ||
78 | #define __NR_setreuid 70 | ||
79 | #define __NR_setregid 71 | ||
80 | #define __NR_sigsuspend 72 | ||
81 | #define __NR_sigpending 73 | ||
82 | #define __NR_sethostname 74 | ||
83 | #define __NR_setrlimit 75 | ||
84 | #define __NR_getrlimit 76 | ||
85 | #define __NR_getrusage 77 | ||
86 | #define __NR_gettimeofday 78 | ||
87 | #define __NR_settimeofday 79 | ||
88 | #define __NR_getgroups 80 | ||
89 | #define __NR_setgroups 81 | ||
90 | #define __NR_select 82 | ||
91 | #define __NR_symlink 83 | ||
92 | #define __NR_oldlstat 84 | ||
93 | #define __NR_readlink 85 | ||
94 | #define __NR_uselib 86 | ||
95 | #define __NR_swapon 87 | ||
96 | #define __NR_reboot 88 | ||
97 | #define __NR_readdir 89 | ||
98 | #define __NR_mmap 90 | ||
99 | #define __NR_munmap 91 | ||
100 | #define __NR_truncate 92 | ||
101 | #define __NR_ftruncate 93 | ||
102 | #define __NR_fchmod 94 | ||
103 | #define __NR_fchown 95 | ||
104 | #define __NR_getpriority 96 | ||
105 | #define __NR_setpriority 97 | ||
106 | #define __NR_profil 98 | ||
107 | #define __NR_statfs 99 | ||
108 | #define __NR_fstatfs 100 | ||
109 | #define __NR_ioperm 101 | ||
110 | #define __NR_socketcall 102 | ||
111 | #define __NR_syslog 103 | ||
112 | #define __NR_setitimer 104 | ||
113 | #define __NR_getitimer 105 | ||
114 | #define __NR_stat 106 | ||
115 | #define __NR_lstat 107 | ||
116 | #define __NR_fstat 108 | ||
117 | #define __NR_olduname 109 | ||
118 | #define __NR_iopl /* 110 */ not supported | ||
119 | #define __NR_vhangup 111 | ||
120 | #define __NR_idle /* 112 */ Obsolete | ||
121 | #define __NR_vm86 /* 113 */ not supported | ||
122 | #define __NR_wait4 114 | ||
123 | #define __NR_swapoff 115 | ||
124 | #define __NR_sysinfo 116 | ||
125 | #define __NR_ipc 117 | ||
126 | #define __NR_fsync 118 | ||
127 | #define __NR_sigreturn 119 | ||
128 | #define __NR_clone 120 | ||
129 | #define __NR_setdomainname 121 | ||
130 | #define __NR_uname 122 | ||
131 | #define __NR_cacheflush 123 | ||
132 | #define __NR_adjtimex 124 | ||
133 | #define __NR_mprotect 125 | ||
134 | #define __NR_sigprocmask 126 | ||
135 | #define __NR_create_module 127 | ||
136 | #define __NR_init_module 128 | ||
137 | #define __NR_delete_module 129 | ||
138 | #define __NR_get_kernel_syms 130 | ||
139 | #define __NR_quotactl 131 | ||
140 | #define __NR_getpgid 132 | ||
141 | #define __NR_fchdir 133 | ||
142 | #define __NR_bdflush 134 | ||
143 | #define __NR_sysfs 135 | ||
144 | #define __NR_personality 136 | ||
145 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
146 | #define __NR_setfsuid 138 | ||
147 | #define __NR_setfsgid 139 | ||
148 | #define __NR__llseek 140 | ||
149 | #define __NR_getdents 141 | ||
150 | #define __NR__newselect 142 | ||
151 | #define __NR_flock 143 | ||
152 | #define __NR_msync 144 | ||
153 | #define __NR_readv 145 | ||
154 | #define __NR_writev 146 | ||
155 | #define __NR_getsid 147 | ||
156 | #define __NR_fdatasync 148 | ||
157 | #define __NR__sysctl 149 | ||
158 | #define __NR_mlock 150 | ||
159 | #define __NR_munlock 151 | ||
160 | #define __NR_mlockall 152 | ||
161 | #define __NR_munlockall 153 | ||
162 | #define __NR_sched_setparam 154 | ||
163 | #define __NR_sched_getparam 155 | ||
164 | #define __NR_sched_setscheduler 156 | ||
165 | #define __NR_sched_getscheduler 157 | ||
166 | #define __NR_sched_yield 158 | ||
167 | #define __NR_sched_get_priority_max 159 | ||
168 | #define __NR_sched_get_priority_min 160 | ||
169 | #define __NR_sched_rr_get_interval 161 | ||
170 | #define __NR_nanosleep 162 | ||
171 | #define __NR_mremap 163 | ||
172 | #define __NR_setresuid 164 | ||
173 | #define __NR_getresuid 165 | ||
174 | #define __NR_getpagesize 166 | ||
175 | #define __NR_query_module 167 | ||
176 | #define __NR_poll 168 | ||
177 | #define __NR_nfsservctl 169 | ||
178 | #define __NR_setresgid 170 | ||
179 | #define __NR_getresgid 171 | ||
180 | #define __NR_prctl 172 | ||
181 | #define __NR_rt_sigreturn 173 | ||
182 | #define __NR_rt_sigaction 174 | ||
183 | #define __NR_rt_sigprocmask 175 | ||
184 | #define __NR_rt_sigpending 176 | ||
185 | #define __NR_rt_sigtimedwait 177 | ||
186 | #define __NR_rt_sigqueueinfo 178 | ||
187 | #define __NR_rt_sigsuspend 179 | ||
188 | #define __NR_pread64 180 | ||
189 | #define __NR_pwrite64 181 | ||
190 | #define __NR_lchown 182 | ||
191 | #define __NR_getcwd 183 | ||
192 | #define __NR_capget 184 | ||
193 | #define __NR_capset 185 | ||
194 | #define __NR_sigaltstack 186 | ||
195 | #define __NR_sendfile 187 | ||
196 | #define __NR_getpmsg 188 /* some people actually want streams */ | ||
197 | #define __NR_putpmsg 189 /* some people actually want streams */ | ||
198 | #define __NR_vfork 190 | ||
199 | #define __NR_ugetrlimit 191 | ||
200 | #define __NR_mmap2 192 | ||
201 | #define __NR_truncate64 193 | ||
202 | #define __NR_ftruncate64 194 | ||
203 | #define __NR_stat64 195 | ||
204 | #define __NR_lstat64 196 | ||
205 | #define __NR_fstat64 197 | ||
206 | #define __NR_chown32 198 | ||
207 | #define __NR_getuid32 199 | ||
208 | #define __NR_getgid32 200 | ||
209 | #define __NR_geteuid32 201 | ||
210 | #define __NR_getegid32 202 | ||
211 | #define __NR_setreuid32 203 | ||
212 | #define __NR_setregid32 204 | ||
213 | #define __NR_getgroups32 205 | ||
214 | #define __NR_setgroups32 206 | ||
215 | #define __NR_fchown32 207 | ||
216 | #define __NR_setresuid32 208 | ||
217 | #define __NR_getresuid32 209 | ||
218 | #define __NR_setresgid32 210 | ||
219 | #define __NR_getresgid32 211 | ||
220 | #define __NR_lchown32 212 | ||
221 | #define __NR_setuid32 213 | ||
222 | #define __NR_setgid32 214 | ||
223 | #define __NR_setfsuid32 215 | ||
224 | #define __NR_setfsgid32 216 | ||
225 | #define __NR_pivot_root 217 | ||
226 | #define __NR_getdents64 220 | ||
227 | #define __NR_gettid 221 | ||
228 | #define __NR_tkill 222 | ||
229 | #define __NR_setxattr 223 | ||
230 | #define __NR_lsetxattr 224 | ||
231 | #define __NR_fsetxattr 225 | ||
232 | #define __NR_getxattr 226 | ||
233 | #define __NR_lgetxattr 227 | ||
234 | #define __NR_fgetxattr 228 | ||
235 | #define __NR_listxattr 229 | ||
236 | #define __NR_llistxattr 230 | ||
237 | #define __NR_flistxattr 231 | ||
238 | #define __NR_removexattr 232 | ||
239 | #define __NR_lremovexattr 233 | ||
240 | #define __NR_fremovexattr 234 | ||
241 | #define __NR_futex 235 | ||
242 | #define __NR_sendfile64 236 | ||
243 | #define __NR_mincore 237 | ||
244 | #define __NR_madvise 238 | ||
245 | #define __NR_fcntl64 239 | ||
246 | #define __NR_readahead 240 | ||
247 | #define __NR_io_setup 241 | ||
248 | #define __NR_io_destroy 242 | ||
249 | #define __NR_io_getevents 243 | ||
250 | #define __NR_io_submit 244 | ||
251 | #define __NR_io_cancel 245 | ||
252 | #define __NR_fadvise64 246 | ||
253 | #define __NR_exit_group 247 | ||
254 | #define __NR_lookup_dcookie 248 | ||
255 | #define __NR_epoll_create 249 | ||
256 | #define __NR_epoll_ctl 250 | ||
257 | #define __NR_epoll_wait 251 | ||
258 | #define __NR_remap_file_pages 252 | ||
259 | #define __NR_set_tid_address 253 | ||
260 | #define __NR_timer_create 254 | ||
261 | #define __NR_timer_settime 255 | ||
262 | #define __NR_timer_gettime 256 | ||
263 | #define __NR_timer_getoverrun 257 | ||
264 | #define __NR_timer_delete 258 | ||
265 | #define __NR_clock_settime 259 | ||
266 | #define __NR_clock_gettime 260 | ||
267 | #define __NR_clock_getres 261 | ||
268 | #define __NR_clock_nanosleep 262 | ||
269 | #define __NR_statfs64 263 | ||
270 | #define __NR_fstatfs64 264 | ||
271 | #define __NR_tgkill 265 | ||
272 | #define __NR_utimes 266 | ||
273 | #define __NR_fadvise64_64 267 | ||
274 | #define __NR_mbind 268 | ||
275 | #define __NR_get_mempolicy 269 | ||
276 | #define __NR_set_mempolicy 270 | ||
277 | #define __NR_mq_open 271 | ||
278 | #define __NR_mq_unlink 272 | ||
279 | #define __NR_mq_timedsend 273 | ||
280 | #define __NR_mq_timedreceive 274 | ||
281 | #define __NR_mq_notify 275 | ||
282 | #define __NR_mq_getsetattr 276 | ||
283 | #define __NR_waitid 277 | ||
284 | #define __NR_vserver 278 | ||
285 | #define __NR_add_key 279 | ||
286 | #define __NR_request_key 280 | ||
287 | #define __NR_keyctl 281 | ||
288 | #define __NR_ioprio_set 282 | ||
289 | #define __NR_ioprio_get 283 | ||
290 | #define __NR_inotify_init 284 | ||
291 | #define __NR_inotify_add_watch 285 | ||
292 | #define __NR_inotify_rm_watch 286 | ||
293 | #define __NR_migrate_pages 287 | ||
294 | #define __NR_openat 288 | ||
295 | #define __NR_mkdirat 289 | ||
296 | #define __NR_mknodat 290 | ||
297 | #define __NR_fchownat 291 | ||
298 | #define __NR_futimesat 292 | ||
299 | #define __NR_fstatat64 293 | ||
300 | #define __NR_unlinkat 294 | ||
301 | #define __NR_renameat 295 | ||
302 | #define __NR_linkat 296 | ||
303 | #define __NR_symlinkat 297 | ||
304 | #define __NR_readlinkat 298 | ||
305 | #define __NR_fchmodat 299 | ||
306 | #define __NR_faccessat 300 | ||
307 | #define __NR_pselect6 301 | ||
308 | #define __NR_ppoll 302 | ||
309 | #define __NR_unshare 303 | ||
310 | #define __NR_set_robust_list 304 | ||
311 | #define __NR_get_robust_list 305 | ||
312 | #define __NR_splice 306 | ||
313 | #define __NR_sync_file_range 307 | ||
314 | #define __NR_tee 308 | ||
315 | #define __NR_vmsplice 309 | ||
316 | #define __NR_move_pages 310 | ||
317 | #define __NR_sched_setaffinity 311 | ||
318 | #define __NR_sched_getaffinity 312 | ||
319 | #define __NR_kexec_load 313 | ||
320 | #define __NR_getcpu 314 | ||
321 | #define __NR_epoll_pwait 315 | ||
322 | #define __NR_utimensat 316 | ||
323 | #define __NR_signalfd 317 | ||
324 | #define __NR_timerfd_create 318 | ||
325 | #define __NR_eventfd 319 | ||
326 | #define __NR_fallocate 320 | ||
327 | #define __NR_timerfd_settime 321 | ||
328 | #define __NR_timerfd_gettime 322 | ||
329 | #define __NR_signalfd4 323 | ||
330 | #define __NR_eventfd2 324 | ||
331 | #define __NR_epoll_create1 325 | ||
332 | #define __NR_dup3 326 | ||
333 | #define __NR_pipe2 327 | ||
334 | #define __NR_inotify_init1 328 | ||
335 | |||
336 | #ifdef __KERNEL__ | ||
337 | |||
338 | #define NR_syscalls 329 | ||
339 | |||
340 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
341 | #define __ARCH_WANT_OLD_READDIR | ||
342 | #define __ARCH_WANT_OLD_STAT | ||
343 | #define __ARCH_WANT_STAT64 | ||
344 | #define __ARCH_WANT_SYS_ALARM | ||
345 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
346 | #define __ARCH_WANT_SYS_PAUSE | ||
347 | #define __ARCH_WANT_SYS_SGETMASK | ||
348 | #define __ARCH_WANT_SYS_SIGNAL | ||
349 | #define __ARCH_WANT_SYS_TIME | ||
350 | #define __ARCH_WANT_SYS_UTIME | ||
351 | #define __ARCH_WANT_SYS_WAITPID | ||
352 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
353 | #define __ARCH_WANT_SYS_FADVISE64 | ||
354 | #define __ARCH_WANT_SYS_GETPGRP | ||
355 | #define __ARCH_WANT_SYS_LLSEEK | ||
356 | #define __ARCH_WANT_SYS_NICE | ||
357 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
358 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
359 | #define __ARCH_WANT_SYS_SIGPENDING | ||
360 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
361 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
362 | |||
363 | /* | ||
364 | * "Conditional" syscalls | ||
365 | * | ||
366 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
367 | * but it doesn't work on all toolchains, so we just do it by hand | ||
368 | */ | ||
369 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
370 | |||
371 | #endif /* __KERNEL__ */ | ||
372 | #endif /* _ASM_M68K_UNISTD_H_ */ | ||
diff --git a/arch/m68k/include/asm/unistd_mm.h b/arch/m68k/include/asm/unistd_mm.h deleted file mode 100644 index 3c19027331fa..000000000000 --- a/arch/m68k/include/asm/unistd_mm.h +++ /dev/null | |||
@@ -1,372 +0,0 @@ | |||
1 | #ifndef _ASM_M68K_UNISTD_H_ | ||
2 | #define _ASM_M68K_UNISTD_H_ | ||
3 | |||
4 | /* | ||
5 | * This file contains the system call numbers. | ||
6 | */ | ||
7 | |||
8 | #define __NR_restart_syscall 0 | ||
9 | #define __NR_exit 1 | ||
10 | #define __NR_fork 2 | ||
11 | #define __NR_read 3 | ||
12 | #define __NR_write 4 | ||
13 | #define __NR_open 5 | ||
14 | #define __NR_close 6 | ||
15 | #define __NR_waitpid 7 | ||
16 | #define __NR_creat 8 | ||
17 | #define __NR_link 9 | ||
18 | #define __NR_unlink 10 | ||
19 | #define __NR_execve 11 | ||
20 | #define __NR_chdir 12 | ||
21 | #define __NR_time 13 | ||
22 | #define __NR_mknod 14 | ||
23 | #define __NR_chmod 15 | ||
24 | #define __NR_chown 16 | ||
25 | #define __NR_break 17 | ||
26 | #define __NR_oldstat 18 | ||
27 | #define __NR_lseek 19 | ||
28 | #define __NR_getpid 20 | ||
29 | #define __NR_mount 21 | ||
30 | #define __NR_umount 22 | ||
31 | #define __NR_setuid 23 | ||
32 | #define __NR_getuid 24 | ||
33 | #define __NR_stime 25 | ||
34 | #define __NR_ptrace 26 | ||
35 | #define __NR_alarm 27 | ||
36 | #define __NR_oldfstat 28 | ||
37 | #define __NR_pause 29 | ||
38 | #define __NR_utime 30 | ||
39 | #define __NR_stty 31 | ||
40 | #define __NR_gtty 32 | ||
41 | #define __NR_access 33 | ||
42 | #define __NR_nice 34 | ||
43 | #define __NR_ftime 35 | ||
44 | #define __NR_sync 36 | ||
45 | #define __NR_kill 37 | ||
46 | #define __NR_rename 38 | ||
47 | #define __NR_mkdir 39 | ||
48 | #define __NR_rmdir 40 | ||
49 | #define __NR_dup 41 | ||
50 | #define __NR_pipe 42 | ||
51 | #define __NR_times 43 | ||
52 | #define __NR_prof 44 | ||
53 | #define __NR_brk 45 | ||
54 | #define __NR_setgid 46 | ||
55 | #define __NR_getgid 47 | ||
56 | #define __NR_signal 48 | ||
57 | #define __NR_geteuid 49 | ||
58 | #define __NR_getegid 50 | ||
59 | #define __NR_acct 51 | ||
60 | #define __NR_umount2 52 | ||
61 | #define __NR_lock 53 | ||
62 | #define __NR_ioctl 54 | ||
63 | #define __NR_fcntl 55 | ||
64 | #define __NR_mpx 56 | ||
65 | #define __NR_setpgid 57 | ||
66 | #define __NR_ulimit 58 | ||
67 | #define __NR_oldolduname 59 | ||
68 | #define __NR_umask 60 | ||
69 | #define __NR_chroot 61 | ||
70 | #define __NR_ustat 62 | ||
71 | #define __NR_dup2 63 | ||
72 | #define __NR_getppid 64 | ||
73 | #define __NR_getpgrp 65 | ||
74 | #define __NR_setsid 66 | ||
75 | #define __NR_sigaction 67 | ||
76 | #define __NR_sgetmask 68 | ||
77 | #define __NR_ssetmask 69 | ||
78 | #define __NR_setreuid 70 | ||
79 | #define __NR_setregid 71 | ||
80 | #define __NR_sigsuspend 72 | ||
81 | #define __NR_sigpending 73 | ||
82 | #define __NR_sethostname 74 | ||
83 | #define __NR_setrlimit 75 | ||
84 | #define __NR_getrlimit 76 | ||
85 | #define __NR_getrusage 77 | ||
86 | #define __NR_gettimeofday 78 | ||
87 | #define __NR_settimeofday 79 | ||
88 | #define __NR_getgroups 80 | ||
89 | #define __NR_setgroups 81 | ||
90 | #define __NR_select 82 | ||
91 | #define __NR_symlink 83 | ||
92 | #define __NR_oldlstat 84 | ||
93 | #define __NR_readlink 85 | ||
94 | #define __NR_uselib 86 | ||
95 | #define __NR_swapon 87 | ||
96 | #define __NR_reboot 88 | ||
97 | #define __NR_readdir 89 | ||
98 | #define __NR_mmap 90 | ||
99 | #define __NR_munmap 91 | ||
100 | #define __NR_truncate 92 | ||
101 | #define __NR_ftruncate 93 | ||
102 | #define __NR_fchmod 94 | ||
103 | #define __NR_fchown 95 | ||
104 | #define __NR_getpriority 96 | ||
105 | #define __NR_setpriority 97 | ||
106 | #define __NR_profil 98 | ||
107 | #define __NR_statfs 99 | ||
108 | #define __NR_fstatfs 100 | ||
109 | #define __NR_ioperm 101 | ||
110 | #define __NR_socketcall 102 | ||
111 | #define __NR_syslog 103 | ||
112 | #define __NR_setitimer 104 | ||
113 | #define __NR_getitimer 105 | ||
114 | #define __NR_stat 106 | ||
115 | #define __NR_lstat 107 | ||
116 | #define __NR_fstat 108 | ||
117 | #define __NR_olduname 109 | ||
118 | #define __NR_iopl /* 110 */ not supported | ||
119 | #define __NR_vhangup 111 | ||
120 | #define __NR_idle /* 112 */ Obsolete | ||
121 | #define __NR_vm86 /* 113 */ not supported | ||
122 | #define __NR_wait4 114 | ||
123 | #define __NR_swapoff 115 | ||
124 | #define __NR_sysinfo 116 | ||
125 | #define __NR_ipc 117 | ||
126 | #define __NR_fsync 118 | ||
127 | #define __NR_sigreturn 119 | ||
128 | #define __NR_clone 120 | ||
129 | #define __NR_setdomainname 121 | ||
130 | #define __NR_uname 122 | ||
131 | #define __NR_cacheflush 123 | ||
132 | #define __NR_adjtimex 124 | ||
133 | #define __NR_mprotect 125 | ||
134 | #define __NR_sigprocmask 126 | ||
135 | #define __NR_create_module 127 | ||
136 | #define __NR_init_module 128 | ||
137 | #define __NR_delete_module 129 | ||
138 | #define __NR_get_kernel_syms 130 | ||
139 | #define __NR_quotactl 131 | ||
140 | #define __NR_getpgid 132 | ||
141 | #define __NR_fchdir 133 | ||
142 | #define __NR_bdflush 134 | ||
143 | #define __NR_sysfs 135 | ||
144 | #define __NR_personality 136 | ||
145 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
146 | #define __NR_setfsuid 138 | ||
147 | #define __NR_setfsgid 139 | ||
148 | #define __NR__llseek 140 | ||
149 | #define __NR_getdents 141 | ||
150 | #define __NR__newselect 142 | ||
151 | #define __NR_flock 143 | ||
152 | #define __NR_msync 144 | ||
153 | #define __NR_readv 145 | ||
154 | #define __NR_writev 146 | ||
155 | #define __NR_getsid 147 | ||
156 | #define __NR_fdatasync 148 | ||
157 | #define __NR__sysctl 149 | ||
158 | #define __NR_mlock 150 | ||
159 | #define __NR_munlock 151 | ||
160 | #define __NR_mlockall 152 | ||
161 | #define __NR_munlockall 153 | ||
162 | #define __NR_sched_setparam 154 | ||
163 | #define __NR_sched_getparam 155 | ||
164 | #define __NR_sched_setscheduler 156 | ||
165 | #define __NR_sched_getscheduler 157 | ||
166 | #define __NR_sched_yield 158 | ||
167 | #define __NR_sched_get_priority_max 159 | ||
168 | #define __NR_sched_get_priority_min 160 | ||
169 | #define __NR_sched_rr_get_interval 161 | ||
170 | #define __NR_nanosleep 162 | ||
171 | #define __NR_mremap 163 | ||
172 | #define __NR_setresuid 164 | ||
173 | #define __NR_getresuid 165 | ||
174 | #define __NR_getpagesize 166 | ||
175 | #define __NR_query_module 167 | ||
176 | #define __NR_poll 168 | ||
177 | #define __NR_nfsservctl 169 | ||
178 | #define __NR_setresgid 170 | ||
179 | #define __NR_getresgid 171 | ||
180 | #define __NR_prctl 172 | ||
181 | #define __NR_rt_sigreturn 173 | ||
182 | #define __NR_rt_sigaction 174 | ||
183 | #define __NR_rt_sigprocmask 175 | ||
184 | #define __NR_rt_sigpending 176 | ||
185 | #define __NR_rt_sigtimedwait 177 | ||
186 | #define __NR_rt_sigqueueinfo 178 | ||
187 | #define __NR_rt_sigsuspend 179 | ||
188 | #define __NR_pread64 180 | ||
189 | #define __NR_pwrite64 181 | ||
190 | #define __NR_lchown 182 | ||
191 | #define __NR_getcwd 183 | ||
192 | #define __NR_capget 184 | ||
193 | #define __NR_capset 185 | ||
194 | #define __NR_sigaltstack 186 | ||
195 | #define __NR_sendfile 187 | ||
196 | #define __NR_getpmsg 188 /* some people actually want streams */ | ||
197 | #define __NR_putpmsg 189 /* some people actually want streams */ | ||
198 | #define __NR_vfork 190 | ||
199 | #define __NR_ugetrlimit 191 | ||
200 | #define __NR_mmap2 192 | ||
201 | #define __NR_truncate64 193 | ||
202 | #define __NR_ftruncate64 194 | ||
203 | #define __NR_stat64 195 | ||
204 | #define __NR_lstat64 196 | ||
205 | #define __NR_fstat64 197 | ||
206 | #define __NR_chown32 198 | ||
207 | #define __NR_getuid32 199 | ||
208 | #define __NR_getgid32 200 | ||
209 | #define __NR_geteuid32 201 | ||
210 | #define __NR_getegid32 202 | ||
211 | #define __NR_setreuid32 203 | ||
212 | #define __NR_setregid32 204 | ||
213 | #define __NR_getgroups32 205 | ||
214 | #define __NR_setgroups32 206 | ||
215 | #define __NR_fchown32 207 | ||
216 | #define __NR_setresuid32 208 | ||
217 | #define __NR_getresuid32 209 | ||
218 | #define __NR_setresgid32 210 | ||
219 | #define __NR_getresgid32 211 | ||
220 | #define __NR_lchown32 212 | ||
221 | #define __NR_setuid32 213 | ||
222 | #define __NR_setgid32 214 | ||
223 | #define __NR_setfsuid32 215 | ||
224 | #define __NR_setfsgid32 216 | ||
225 | #define __NR_pivot_root 217 | ||
226 | #define __NR_getdents64 220 | ||
227 | #define __NR_gettid 221 | ||
228 | #define __NR_tkill 222 | ||
229 | #define __NR_setxattr 223 | ||
230 | #define __NR_lsetxattr 224 | ||
231 | #define __NR_fsetxattr 225 | ||
232 | #define __NR_getxattr 226 | ||
233 | #define __NR_lgetxattr 227 | ||
234 | #define __NR_fgetxattr 228 | ||
235 | #define __NR_listxattr 229 | ||
236 | #define __NR_llistxattr 230 | ||
237 | #define __NR_flistxattr 231 | ||
238 | #define __NR_removexattr 232 | ||
239 | #define __NR_lremovexattr 233 | ||
240 | #define __NR_fremovexattr 234 | ||
241 | #define __NR_futex 235 | ||
242 | #define __NR_sendfile64 236 | ||
243 | #define __NR_mincore 237 | ||
244 | #define __NR_madvise 238 | ||
245 | #define __NR_fcntl64 239 | ||
246 | #define __NR_readahead 240 | ||
247 | #define __NR_io_setup 241 | ||
248 | #define __NR_io_destroy 242 | ||
249 | #define __NR_io_getevents 243 | ||
250 | #define __NR_io_submit 244 | ||
251 | #define __NR_io_cancel 245 | ||
252 | #define __NR_fadvise64 246 | ||
253 | #define __NR_exit_group 247 | ||
254 | #define __NR_lookup_dcookie 248 | ||
255 | #define __NR_epoll_create 249 | ||
256 | #define __NR_epoll_ctl 250 | ||
257 | #define __NR_epoll_wait 251 | ||
258 | #define __NR_remap_file_pages 252 | ||
259 | #define __NR_set_tid_address 253 | ||
260 | #define __NR_timer_create 254 | ||
261 | #define __NR_timer_settime 255 | ||
262 | #define __NR_timer_gettime 256 | ||
263 | #define __NR_timer_getoverrun 257 | ||
264 | #define __NR_timer_delete 258 | ||
265 | #define __NR_clock_settime 259 | ||
266 | #define __NR_clock_gettime 260 | ||
267 | #define __NR_clock_getres 261 | ||
268 | #define __NR_clock_nanosleep 262 | ||
269 | #define __NR_statfs64 263 | ||
270 | #define __NR_fstatfs64 264 | ||
271 | #define __NR_tgkill 265 | ||
272 | #define __NR_utimes 266 | ||
273 | #define __NR_fadvise64_64 267 | ||
274 | #define __NR_mbind 268 | ||
275 | #define __NR_get_mempolicy 269 | ||
276 | #define __NR_set_mempolicy 270 | ||
277 | #define __NR_mq_open 271 | ||
278 | #define __NR_mq_unlink 272 | ||
279 | #define __NR_mq_timedsend 273 | ||
280 | #define __NR_mq_timedreceive 274 | ||
281 | #define __NR_mq_notify 275 | ||
282 | #define __NR_mq_getsetattr 276 | ||
283 | #define __NR_waitid 277 | ||
284 | #define __NR_vserver 278 | ||
285 | #define __NR_add_key 279 | ||
286 | #define __NR_request_key 280 | ||
287 | #define __NR_keyctl 281 | ||
288 | #define __NR_ioprio_set 282 | ||
289 | #define __NR_ioprio_get 283 | ||
290 | #define __NR_inotify_init 284 | ||
291 | #define __NR_inotify_add_watch 285 | ||
292 | #define __NR_inotify_rm_watch 286 | ||
293 | #define __NR_migrate_pages 287 | ||
294 | #define __NR_openat 288 | ||
295 | #define __NR_mkdirat 289 | ||
296 | #define __NR_mknodat 290 | ||
297 | #define __NR_fchownat 291 | ||
298 | #define __NR_futimesat 292 | ||
299 | #define __NR_fstatat64 293 | ||
300 | #define __NR_unlinkat 294 | ||
301 | #define __NR_renameat 295 | ||
302 | #define __NR_linkat 296 | ||
303 | #define __NR_symlinkat 297 | ||
304 | #define __NR_readlinkat 298 | ||
305 | #define __NR_fchmodat 299 | ||
306 | #define __NR_faccessat 300 | ||
307 | #define __NR_pselect6 301 | ||
308 | #define __NR_ppoll 302 | ||
309 | #define __NR_unshare 303 | ||
310 | #define __NR_set_robust_list 304 | ||
311 | #define __NR_get_robust_list 305 | ||
312 | #define __NR_splice 306 | ||
313 | #define __NR_sync_file_range 307 | ||
314 | #define __NR_tee 308 | ||
315 | #define __NR_vmsplice 309 | ||
316 | #define __NR_move_pages 310 | ||
317 | #define __NR_sched_setaffinity 311 | ||
318 | #define __NR_sched_getaffinity 312 | ||
319 | #define __NR_kexec_load 313 | ||
320 | #define __NR_getcpu 314 | ||
321 | #define __NR_epoll_pwait 315 | ||
322 | #define __NR_utimensat 316 | ||
323 | #define __NR_signalfd 317 | ||
324 | #define __NR_timerfd_create 318 | ||
325 | #define __NR_eventfd 319 | ||
326 | #define __NR_fallocate 320 | ||
327 | #define __NR_timerfd_settime 321 | ||
328 | #define __NR_timerfd_gettime 322 | ||
329 | #define __NR_signalfd4 323 | ||
330 | #define __NR_eventfd2 324 | ||
331 | #define __NR_epoll_create1 325 | ||
332 | #define __NR_dup3 326 | ||
333 | #define __NR_pipe2 327 | ||
334 | #define __NR_inotify_init1 328 | ||
335 | |||
336 | #ifdef __KERNEL__ | ||
337 | |||
338 | #define NR_syscalls 329 | ||
339 | |||
340 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
341 | #define __ARCH_WANT_OLD_READDIR | ||
342 | #define __ARCH_WANT_OLD_STAT | ||
343 | #define __ARCH_WANT_STAT64 | ||
344 | #define __ARCH_WANT_SYS_ALARM | ||
345 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
346 | #define __ARCH_WANT_SYS_PAUSE | ||
347 | #define __ARCH_WANT_SYS_SGETMASK | ||
348 | #define __ARCH_WANT_SYS_SIGNAL | ||
349 | #define __ARCH_WANT_SYS_TIME | ||
350 | #define __ARCH_WANT_SYS_UTIME | ||
351 | #define __ARCH_WANT_SYS_WAITPID | ||
352 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
353 | #define __ARCH_WANT_SYS_FADVISE64 | ||
354 | #define __ARCH_WANT_SYS_GETPGRP | ||
355 | #define __ARCH_WANT_SYS_LLSEEK | ||
356 | #define __ARCH_WANT_SYS_NICE | ||
357 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
358 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
359 | #define __ARCH_WANT_SYS_SIGPENDING | ||
360 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
361 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
362 | |||
363 | /* | ||
364 | * "Conditional" syscalls | ||
365 | * | ||
366 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
367 | * but it doesn't work on all toolchains, so we just do it by hand | ||
368 | */ | ||
369 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
370 | |||
371 | #endif /* __KERNEL__ */ | ||
372 | #endif /* _ASM_M68K_UNISTD_H_ */ | ||
diff --git a/arch/m68k/include/asm/unistd_no.h b/arch/m68k/include/asm/unistd_no.h deleted file mode 100644 index b034a2f7b444..000000000000 --- a/arch/m68k/include/asm/unistd_no.h +++ /dev/null | |||
@@ -1,372 +0,0 @@ | |||
1 | #ifndef _ASM_M68K_UNISTD_H_ | ||
2 | #define _ASM_M68K_UNISTD_H_ | ||
3 | |||
4 | /* | ||
5 | * This file contains the system call numbers. | ||
6 | */ | ||
7 | |||
8 | #define __NR_restart_syscall 0 | ||
9 | #define __NR_exit 1 | ||
10 | #define __NR_fork 2 | ||
11 | #define __NR_read 3 | ||
12 | #define __NR_write 4 | ||
13 | #define __NR_open 5 | ||
14 | #define __NR_close 6 | ||
15 | #define __NR_waitpid 7 | ||
16 | #define __NR_creat 8 | ||
17 | #define __NR_link 9 | ||
18 | #define __NR_unlink 10 | ||
19 | #define __NR_execve 11 | ||
20 | #define __NR_chdir 12 | ||
21 | #define __NR_time 13 | ||
22 | #define __NR_mknod 14 | ||
23 | #define __NR_chmod 15 | ||
24 | #define __NR_chown 16 | ||
25 | #define __NR_break 17 | ||
26 | #define __NR_oldstat 18 | ||
27 | #define __NR_lseek 19 | ||
28 | #define __NR_getpid 20 | ||
29 | #define __NR_mount 21 | ||
30 | #define __NR_umount 22 | ||
31 | #define __NR_setuid 23 | ||
32 | #define __NR_getuid 24 | ||
33 | #define __NR_stime 25 | ||
34 | #define __NR_ptrace 26 | ||
35 | #define __NR_alarm 27 | ||
36 | #define __NR_oldfstat 28 | ||
37 | #define __NR_pause 29 | ||
38 | #define __NR_utime 30 | ||
39 | #define __NR_stty 31 | ||
40 | #define __NR_gtty 32 | ||
41 | #define __NR_access 33 | ||
42 | #define __NR_nice 34 | ||
43 | #define __NR_ftime 35 | ||
44 | #define __NR_sync 36 | ||
45 | #define __NR_kill 37 | ||
46 | #define __NR_rename 38 | ||
47 | #define __NR_mkdir 39 | ||
48 | #define __NR_rmdir 40 | ||
49 | #define __NR_dup 41 | ||
50 | #define __NR_pipe 42 | ||
51 | #define __NR_times 43 | ||
52 | #define __NR_prof 44 | ||
53 | #define __NR_brk 45 | ||
54 | #define __NR_setgid 46 | ||
55 | #define __NR_getgid 47 | ||
56 | #define __NR_signal 48 | ||
57 | #define __NR_geteuid 49 | ||
58 | #define __NR_getegid 50 | ||
59 | #define __NR_acct 51 | ||
60 | #define __NR_umount2 52 | ||
61 | #define __NR_lock 53 | ||
62 | #define __NR_ioctl 54 | ||
63 | #define __NR_fcntl 55 | ||
64 | #define __NR_mpx 56 | ||
65 | #define __NR_setpgid 57 | ||
66 | #define __NR_ulimit 58 | ||
67 | #define __NR_oldolduname 59 | ||
68 | #define __NR_umask 60 | ||
69 | #define __NR_chroot 61 | ||
70 | #define __NR_ustat 62 | ||
71 | #define __NR_dup2 63 | ||
72 | #define __NR_getppid 64 | ||
73 | #define __NR_getpgrp 65 | ||
74 | #define __NR_setsid 66 | ||
75 | #define __NR_sigaction 67 | ||
76 | #define __NR_sgetmask 68 | ||
77 | #define __NR_ssetmask 69 | ||
78 | #define __NR_setreuid 70 | ||
79 | #define __NR_setregid 71 | ||
80 | #define __NR_sigsuspend 72 | ||
81 | #define __NR_sigpending 73 | ||
82 | #define __NR_sethostname 74 | ||
83 | #define __NR_setrlimit 75 | ||
84 | #define __NR_getrlimit 76 | ||
85 | #define __NR_getrusage 77 | ||
86 | #define __NR_gettimeofday 78 | ||
87 | #define __NR_settimeofday 79 | ||
88 | #define __NR_getgroups 80 | ||
89 | #define __NR_setgroups 81 | ||
90 | #define __NR_select 82 | ||
91 | #define __NR_symlink 83 | ||
92 | #define __NR_oldlstat 84 | ||
93 | #define __NR_readlink 85 | ||
94 | #define __NR_uselib 86 | ||
95 | #define __NR_swapon 87 | ||
96 | #define __NR_reboot 88 | ||
97 | #define __NR_readdir 89 | ||
98 | #define __NR_mmap 90 | ||
99 | #define __NR_munmap 91 | ||
100 | #define __NR_truncate 92 | ||
101 | #define __NR_ftruncate 93 | ||
102 | #define __NR_fchmod 94 | ||
103 | #define __NR_fchown 95 | ||
104 | #define __NR_getpriority 96 | ||
105 | #define __NR_setpriority 97 | ||
106 | #define __NR_profil 98 | ||
107 | #define __NR_statfs 99 | ||
108 | #define __NR_fstatfs 100 | ||
109 | #define __NR_ioperm 101 | ||
110 | #define __NR_socketcall 102 | ||
111 | #define __NR_syslog 103 | ||
112 | #define __NR_setitimer 104 | ||
113 | #define __NR_getitimer 105 | ||
114 | #define __NR_stat 106 | ||
115 | #define __NR_lstat 107 | ||
116 | #define __NR_fstat 108 | ||
117 | #define __NR_olduname 109 | ||
118 | #define __NR_iopl /* 110 */ not supported | ||
119 | #define __NR_vhangup 111 | ||
120 | #define __NR_idle /* 112 */ Obsolete | ||
121 | #define __NR_vm86 /* 113 */ not supported | ||
122 | #define __NR_wait4 114 | ||
123 | #define __NR_swapoff 115 | ||
124 | #define __NR_sysinfo 116 | ||
125 | #define __NR_ipc 117 | ||
126 | #define __NR_fsync 118 | ||
127 | #define __NR_sigreturn 119 | ||
128 | #define __NR_clone 120 | ||
129 | #define __NR_setdomainname 121 | ||
130 | #define __NR_uname 122 | ||
131 | #define __NR_cacheflush 123 | ||
132 | #define __NR_adjtimex 124 | ||
133 | #define __NR_mprotect 125 | ||
134 | #define __NR_sigprocmask 126 | ||
135 | #define __NR_create_module 127 | ||
136 | #define __NR_init_module 128 | ||
137 | #define __NR_delete_module 129 | ||
138 | #define __NR_get_kernel_syms 130 | ||
139 | #define __NR_quotactl 131 | ||
140 | #define __NR_getpgid 132 | ||
141 | #define __NR_fchdir 133 | ||
142 | #define __NR_bdflush 134 | ||
143 | #define __NR_sysfs 135 | ||
144 | #define __NR_personality 136 | ||
145 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
146 | #define __NR_setfsuid 138 | ||
147 | #define __NR_setfsgid 139 | ||
148 | #define __NR__llseek 140 | ||
149 | #define __NR_getdents 141 | ||
150 | #define __NR__newselect 142 | ||
151 | #define __NR_flock 143 | ||
152 | #define __NR_msync 144 | ||
153 | #define __NR_readv 145 | ||
154 | #define __NR_writev 146 | ||
155 | #define __NR_getsid 147 | ||
156 | #define __NR_fdatasync 148 | ||
157 | #define __NR__sysctl 149 | ||
158 | #define __NR_mlock 150 | ||
159 | #define __NR_munlock 151 | ||
160 | #define __NR_mlockall 152 | ||
161 | #define __NR_munlockall 153 | ||
162 | #define __NR_sched_setparam 154 | ||
163 | #define __NR_sched_getparam 155 | ||
164 | #define __NR_sched_setscheduler 156 | ||
165 | #define __NR_sched_getscheduler 157 | ||
166 | #define __NR_sched_yield 158 | ||
167 | #define __NR_sched_get_priority_max 159 | ||
168 | #define __NR_sched_get_priority_min 160 | ||
169 | #define __NR_sched_rr_get_interval 161 | ||
170 | #define __NR_nanosleep 162 | ||
171 | #define __NR_mremap 163 | ||
172 | #define __NR_setresuid 164 | ||
173 | #define __NR_getresuid 165 | ||
174 | #define __NR_getpagesize 166 | ||
175 | #define __NR_query_module 167 | ||
176 | #define __NR_poll 168 | ||
177 | #define __NR_nfsservctl 169 | ||
178 | #define __NR_setresgid 170 | ||
179 | #define __NR_getresgid 171 | ||
180 | #define __NR_prctl 172 | ||
181 | #define __NR_rt_sigreturn 173 | ||
182 | #define __NR_rt_sigaction 174 | ||
183 | #define __NR_rt_sigprocmask 175 | ||
184 | #define __NR_rt_sigpending 176 | ||
185 | #define __NR_rt_sigtimedwait 177 | ||
186 | #define __NR_rt_sigqueueinfo 178 | ||
187 | #define __NR_rt_sigsuspend 179 | ||
188 | #define __NR_pread64 180 | ||
189 | #define __NR_pwrite64 181 | ||
190 | #define __NR_lchown 182 | ||
191 | #define __NR_getcwd 183 | ||
192 | #define __NR_capget 184 | ||
193 | #define __NR_capset 185 | ||
194 | #define __NR_sigaltstack 186 | ||
195 | #define __NR_sendfile 187 | ||
196 | #define __NR_getpmsg 188 /* some people actually want streams */ | ||
197 | #define __NR_putpmsg 189 /* some people actually want streams */ | ||
198 | #define __NR_vfork 190 | ||
199 | #define __NR_ugetrlimit 191 | ||
200 | #define __NR_mmap2 192 | ||
201 | #define __NR_truncate64 193 | ||
202 | #define __NR_ftruncate64 194 | ||
203 | #define __NR_stat64 195 | ||
204 | #define __NR_lstat64 196 | ||
205 | #define __NR_fstat64 197 | ||
206 | #define __NR_chown32 198 | ||
207 | #define __NR_getuid32 199 | ||
208 | #define __NR_getgid32 200 | ||
209 | #define __NR_geteuid32 201 | ||
210 | #define __NR_getegid32 202 | ||
211 | #define __NR_setreuid32 203 | ||
212 | #define __NR_setregid32 204 | ||
213 | #define __NR_getgroups32 205 | ||
214 | #define __NR_setgroups32 206 | ||
215 | #define __NR_fchown32 207 | ||
216 | #define __NR_setresuid32 208 | ||
217 | #define __NR_getresuid32 209 | ||
218 | #define __NR_setresgid32 210 | ||
219 | #define __NR_getresgid32 211 | ||
220 | #define __NR_lchown32 212 | ||
221 | #define __NR_setuid32 213 | ||
222 | #define __NR_setgid32 214 | ||
223 | #define __NR_setfsuid32 215 | ||
224 | #define __NR_setfsgid32 216 | ||
225 | #define __NR_pivot_root 217 | ||
226 | #define __NR_getdents64 220 | ||
227 | #define __NR_gettid 221 | ||
228 | #define __NR_tkill 222 | ||
229 | #define __NR_setxattr 223 | ||
230 | #define __NR_lsetxattr 224 | ||
231 | #define __NR_fsetxattr 225 | ||
232 | #define __NR_getxattr 226 | ||
233 | #define __NR_lgetxattr 227 | ||
234 | #define __NR_fgetxattr 228 | ||
235 | #define __NR_listxattr 229 | ||
236 | #define __NR_llistxattr 230 | ||
237 | #define __NR_flistxattr 231 | ||
238 | #define __NR_removexattr 232 | ||
239 | #define __NR_lremovexattr 233 | ||
240 | #define __NR_fremovexattr 234 | ||
241 | #define __NR_futex 235 | ||
242 | #define __NR_sendfile64 236 | ||
243 | #define __NR_mincore 237 | ||
244 | #define __NR_madvise 238 | ||
245 | #define __NR_fcntl64 239 | ||
246 | #define __NR_readahead 240 | ||
247 | #define __NR_io_setup 241 | ||
248 | #define __NR_io_destroy 242 | ||
249 | #define __NR_io_getevents 243 | ||
250 | #define __NR_io_submit 244 | ||
251 | #define __NR_io_cancel 245 | ||
252 | #define __NR_fadvise64 246 | ||
253 | #define __NR_exit_group 247 | ||
254 | #define __NR_lookup_dcookie 248 | ||
255 | #define __NR_epoll_create 249 | ||
256 | #define __NR_epoll_ctl 250 | ||
257 | #define __NR_epoll_wait 251 | ||
258 | #define __NR_remap_file_pages 252 | ||
259 | #define __NR_set_tid_address 253 | ||
260 | #define __NR_timer_create 254 | ||
261 | #define __NR_timer_settime 255 | ||
262 | #define __NR_timer_gettime 256 | ||
263 | #define __NR_timer_getoverrun 257 | ||
264 | #define __NR_timer_delete 258 | ||
265 | #define __NR_clock_settime 259 | ||
266 | #define __NR_clock_gettime 260 | ||
267 | #define __NR_clock_getres 261 | ||
268 | #define __NR_clock_nanosleep 262 | ||
269 | #define __NR_statfs64 263 | ||
270 | #define __NR_fstatfs64 264 | ||
271 | #define __NR_tgkill 265 | ||
272 | #define __NR_utimes 266 | ||
273 | #define __NR_fadvise64_64 267 | ||
274 | #define __NR_mbind 268 | ||
275 | #define __NR_get_mempolicy 269 | ||
276 | #define __NR_set_mempolicy 270 | ||
277 | #define __NR_mq_open 271 | ||
278 | #define __NR_mq_unlink 272 | ||
279 | #define __NR_mq_timedsend 273 | ||
280 | #define __NR_mq_timedreceive 274 | ||
281 | #define __NR_mq_notify 275 | ||
282 | #define __NR_mq_getsetattr 276 | ||
283 | #define __NR_waitid 277 | ||
284 | #define __NR_vserver 278 | ||
285 | #define __NR_add_key 279 | ||
286 | #define __NR_request_key 280 | ||
287 | #define __NR_keyctl 281 | ||
288 | #define __NR_ioprio_set 282 | ||
289 | #define __NR_ioprio_get 283 | ||
290 | #define __NR_inotify_init 284 | ||
291 | #define __NR_inotify_add_watch 285 | ||
292 | #define __NR_inotify_rm_watch 286 | ||
293 | #define __NR_migrate_pages 287 | ||
294 | #define __NR_openat 288 | ||
295 | #define __NR_mkdirat 289 | ||
296 | #define __NR_mknodat 290 | ||
297 | #define __NR_fchownat 291 | ||
298 | #define __NR_futimesat 292 | ||
299 | #define __NR_fstatat64 293 | ||
300 | #define __NR_unlinkat 294 | ||
301 | #define __NR_renameat 295 | ||
302 | #define __NR_linkat 296 | ||
303 | #define __NR_symlinkat 297 | ||
304 | #define __NR_readlinkat 298 | ||
305 | #define __NR_fchmodat 299 | ||
306 | #define __NR_faccessat 300 | ||
307 | #define __NR_pselect6 301 | ||
308 | #define __NR_ppoll 302 | ||
309 | #define __NR_unshare 303 | ||
310 | #define __NR_set_robust_list 304 | ||
311 | #define __NR_get_robust_list 305 | ||
312 | #define __NR_splice 306 | ||
313 | #define __NR_sync_file_range 307 | ||
314 | #define __NR_tee 308 | ||
315 | #define __NR_vmsplice 309 | ||
316 | #define __NR_move_pages 310 | ||
317 | #define __NR_sched_setaffinity 311 | ||
318 | #define __NR_sched_getaffinity 312 | ||
319 | #define __NR_kexec_load 313 | ||
320 | #define __NR_getcpu 314 | ||
321 | #define __NR_epoll_pwait 315 | ||
322 | #define __NR_utimensat 316 | ||
323 | #define __NR_signalfd 317 | ||
324 | #define __NR_timerfd_create 318 | ||
325 | #define __NR_eventfd 319 | ||
326 | #define __NR_fallocate 320 | ||
327 | #define __NR_timerfd_settime 321 | ||
328 | #define __NR_timerfd_gettime 322 | ||
329 | #define __NR_signalfd4 323 | ||
330 | #define __NR_eventfd2 324 | ||
331 | #define __NR_epoll_create1 325 | ||
332 | #define __NR_dup3 326 | ||
333 | #define __NR_pipe2 327 | ||
334 | #define __NR_inotify_init1 328 | ||
335 | |||
336 | #ifdef __KERNEL__ | ||
337 | |||
338 | #define NR_syscalls 329 | ||
339 | |||
340 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
341 | #define __ARCH_WANT_OLD_READDIR | ||
342 | #define __ARCH_WANT_OLD_STAT | ||
343 | #define __ARCH_WANT_STAT64 | ||
344 | #define __ARCH_WANT_SYS_ALARM | ||
345 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
346 | #define __ARCH_WANT_SYS_PAUSE | ||
347 | #define __ARCH_WANT_SYS_SGETMASK | ||
348 | #define __ARCH_WANT_SYS_SIGNAL | ||
349 | #define __ARCH_WANT_SYS_TIME | ||
350 | #define __ARCH_WANT_SYS_UTIME | ||
351 | #define __ARCH_WANT_SYS_WAITPID | ||
352 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
353 | #define __ARCH_WANT_SYS_FADVISE64 | ||
354 | #define __ARCH_WANT_SYS_GETPGRP | ||
355 | #define __ARCH_WANT_SYS_LLSEEK | ||
356 | #define __ARCH_WANT_SYS_NICE | ||
357 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
358 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
359 | #define __ARCH_WANT_SYS_SIGPENDING | ||
360 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
361 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
362 | |||
363 | /* | ||
364 | * "Conditional" syscalls | ||
365 | * | ||
366 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
367 | * but it doesn't work on all toolchains, so we just do it by hand | ||
368 | */ | ||
369 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
370 | |||
371 | #endif /* __KERNEL__ */ | ||
372 | #endif /* _ASM_M68K_UNISTD_H_ */ | ||
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 7db2e42d97a2..d794a637e421 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S | |||
@@ -513,6 +513,9 @@ InstructionTLBMiss: | |||
513 | rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */ | 513 | rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */ |
514 | ori r1,r1,0xe04 /* clear out reserved bits */ | 514 | ori r1,r1,0xe04 /* clear out reserved bits */ |
515 | andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */ | 515 | andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */ |
516 | BEGIN_FTR_SECTION | ||
517 | rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */ | ||
518 | END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) | ||
516 | mtspr SPRN_RPA,r1 | 519 | mtspr SPRN_RPA,r1 |
517 | mfspr r3,SPRN_IMISS | 520 | mfspr r3,SPRN_IMISS |
518 | tlbli r3 | 521 | tlbli r3 |
@@ -587,6 +590,9 @@ DataLoadTLBMiss: | |||
587 | rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */ | 590 | rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */ |
588 | ori r1,r1,0xe04 /* clear out reserved bits */ | 591 | ori r1,r1,0xe04 /* clear out reserved bits */ |
589 | andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */ | 592 | andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */ |
593 | BEGIN_FTR_SECTION | ||
594 | rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */ | ||
595 | END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) | ||
590 | mtspr SPRN_RPA,r1 | 596 | mtspr SPRN_RPA,r1 |
591 | mfspr r3,SPRN_DMISS | 597 | mfspr r3,SPRN_DMISS |
592 | tlbld r3 | 598 | tlbld r3 |
@@ -655,6 +661,9 @@ DataStoreTLBMiss: | |||
655 | rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */ | 661 | rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */ |
656 | li r1,0xe05 /* clear out reserved bits & PP lsb */ | 662 | li r1,0xe05 /* clear out reserved bits & PP lsb */ |
657 | andc r1,r3,r1 /* PP = user? 2: 0 */ | 663 | andc r1,r3,r1 /* PP = user? 2: 0 */ |
664 | BEGIN_FTR_SECTION | ||
665 | rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */ | ||
666 | END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) | ||
658 | mtspr SPRN_RPA,r1 | 667 | mtspr SPRN_RPA,r1 |
659 | mfspr r3,SPRN_DMISS | 668 | mfspr r3,SPRN_DMISS |
660 | tlbld r3 | 669 | tlbld r3 |
diff --git a/arch/sparc/include/asm/pil.h b/arch/sparc/include/asm/pil.h index 32a7efe76d00..266937030546 100644 --- a/arch/sparc/include/asm/pil.h +++ b/arch/sparc/include/asm/pil.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #define PIL_DEVICE_IRQ 5 | 24 | #define PIL_DEVICE_IRQ 5 |
25 | #define PIL_SMP_CALL_FUNC_SNGL 6 | 25 | #define PIL_SMP_CALL_FUNC_SNGL 6 |
26 | #define PIL_DEFERRED_PCR_WORK 7 | 26 | #define PIL_DEFERRED_PCR_WORK 7 |
27 | #define PIL_KGDB_CAPTURE 8 | ||
27 | #define PIL_NORMAL_MAX 14 | 28 | #define PIL_NORMAL_MAX 14 |
28 | #define PIL_NMI 15 | 29 | #define PIL_NMI 15 |
29 | 30 | ||
diff --git a/arch/sparc/kernel/kgdb_64.c b/arch/sparc/kernel/kgdb_64.c index fefbe6dc51be..f5a0fd490b59 100644 --- a/arch/sparc/kernel/kgdb_64.c +++ b/arch/sparc/kernel/kgdb_64.c | |||
@@ -108,7 +108,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) | |||
108 | } | 108 | } |
109 | 109 | ||
110 | #ifdef CONFIG_SMP | 110 | #ifdef CONFIG_SMP |
111 | void smp_kgdb_capture_client(struct pt_regs *regs) | 111 | void smp_kgdb_capture_client(int irq, struct pt_regs *regs) |
112 | { | 112 | { |
113 | unsigned long flags; | 113 | unsigned long flags; |
114 | 114 | ||
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index 64e6edf17b9d..b775658a927d 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c | |||
@@ -368,7 +368,7 @@ static void pci_register_iommu_region(struct pci_pbm_info *pbm) | |||
368 | const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 368 | const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); |
369 | 369 | ||
370 | if (vdma) { | 370 | if (vdma) { |
371 | struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL); | 371 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); |
372 | 372 | ||
373 | if (!rp) { | 373 | if (!rp) { |
374 | prom_printf("Cannot allocate IOMMU resource.\n"); | 374 | prom_printf("Cannot allocate IOMMU resource.\n"); |
diff --git a/arch/sparc/kernel/ttable.S b/arch/sparc/kernel/ttable.S index d9bdfb9d5c18..76d837fc47d3 100644 --- a/arch/sparc/kernel/ttable.S +++ b/arch/sparc/kernel/ttable.S | |||
@@ -64,7 +64,12 @@ tl0_irq6: TRAP_IRQ(smp_call_function_single_client, 6) | |||
64 | tl0_irq6: BTRAP(0x46) | 64 | tl0_irq6: BTRAP(0x46) |
65 | #endif | 65 | #endif |
66 | tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) | 66 | tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) |
67 | tl0_irq8: BTRAP(0x48) BTRAP(0x49) | 67 | #ifdef CONFIG_KGDB |
68 | tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8) | ||
69 | #else | ||
70 | tl0_irq8: BTRAP(0x48) | ||
71 | #endif | ||
72 | tl0_irq9: BTRAP(0x49) | ||
68 | tl0_irq10: BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d) | 73 | tl0_irq10: BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d) |
69 | tl0_irq14: TRAP_IRQ(timer_interrupt, 14) | 74 | tl0_irq14: TRAP_IRQ(timer_interrupt, 14) |
70 | tl0_irq15: TRAP_NMI_IRQ(perfctr_irq, 15) | 75 | tl0_irq15: TRAP_NMI_IRQ(perfctr_irq, 15) |
diff --git a/arch/sparc/mm/ultra.S b/arch/sparc/mm/ultra.S index 80c788ec7c32..b57a5942ba64 100644 --- a/arch/sparc/mm/ultra.S +++ b/arch/sparc/mm/ultra.S | |||
@@ -679,28 +679,8 @@ xcall_new_mmu_context_version: | |||
679 | #ifdef CONFIG_KGDB | 679 | #ifdef CONFIG_KGDB |
680 | .globl xcall_kgdb_capture | 680 | .globl xcall_kgdb_capture |
681 | xcall_kgdb_capture: | 681 | xcall_kgdb_capture: |
682 | 661: rdpr %pstate, %g2 | 682 | wr %g0, (1 << PIL_KGDB_CAPTURE), %set_softint |
683 | wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate | 683 | retry |
684 | .section .sun4v_2insn_patch, "ax" | ||
685 | .word 661b | ||
686 | nop | ||
687 | nop | ||
688 | .previous | ||
689 | |||
690 | rdpr %pil, %g2 | ||
691 | wrpr %g0, PIL_NORMAL_MAX, %pil | ||
692 | sethi %hi(109f), %g7 | ||
693 | ba,pt %xcc, etrap_irq | ||
694 | 109: or %g7, %lo(109b), %g7 | ||
695 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
696 | call trace_hardirqs_off | ||
697 | nop | ||
698 | #endif | ||
699 | call smp_kgdb_capture_client | ||
700 | add %sp, PTREGS_OFF, %o0 | ||
701 | /* Has to be a non-v9 branch due to the large distance. */ | ||
702 | ba rtrap_xcall | ||
703 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 | ||
704 | #endif | 684 | #endif |
705 | 685 | ||
706 | #endif /* CONFIG_SMP */ | 686 | #endif /* CONFIG_SMP */ |
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h index 5b301b7ff5f4..b3894bf52fcd 100644 --- a/arch/x86/include/asm/cacheflush.h +++ b/arch/x86/include/asm/cacheflush.h | |||
@@ -90,6 +90,9 @@ int set_memory_4k(unsigned long addr, int numpages); | |||
90 | int set_memory_array_uc(unsigned long *addr, int addrinarray); | 90 | int set_memory_array_uc(unsigned long *addr, int addrinarray); |
91 | int set_memory_array_wb(unsigned long *addr, int addrinarray); | 91 | int set_memory_array_wb(unsigned long *addr, int addrinarray); |
92 | 92 | ||
93 | int set_pages_array_uc(struct page **pages, int addrinarray); | ||
94 | int set_pages_array_wb(struct page **pages, int addrinarray); | ||
95 | |||
93 | /* | 96 | /* |
94 | * For legacy compatibility with the old APIs, a few functions | 97 | * For legacy compatibility with the old APIs, a few functions |
95 | * are provided that work on a "struct page". | 98 | * are provided that work on a "struct page". |
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h index aa32f7e6c197..fd8f9e2ca35f 100644 --- a/arch/x86/include/asm/dmi.h +++ b/arch/x86/include/asm/dmi.h | |||
@@ -1,10 +1,13 @@ | |||
1 | #ifndef _ASM_X86_DMI_H | 1 | #ifndef _ASM_X86_DMI_H |
2 | #define _ASM_X86_DMI_H | 2 | #define _ASM_X86_DMI_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | ||
5 | #include <linux/init.h> | ||
6 | |||
4 | #include <asm/io.h> | 7 | #include <asm/io.h> |
5 | #include <asm/setup.h> | 8 | #include <asm/setup.h> |
6 | 9 | ||
7 | static inline void *dmi_alloc(unsigned len) | 10 | static __always_inline __init void *dmi_alloc(unsigned len) |
8 | { | 11 | { |
9 | return extend_brk(len, sizeof(int)); | 12 | return extend_brk(len, sizeof(int)); |
10 | } | 13 | } |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index d882c03604ee..86827d85488a 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -3464,7 +3464,7 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
3464 | int ret, sub_handle; | 3464 | int ret, sub_handle; |
3465 | struct msi_desc *msidesc; | 3465 | struct msi_desc *msidesc; |
3466 | unsigned int irq_want; | 3466 | unsigned int irq_want; |
3467 | struct intel_iommu *iommu = 0; | 3467 | struct intel_iommu *iommu = NULL; |
3468 | int index = 0; | 3468 | int index = 0; |
3469 | 3469 | ||
3470 | irq_want = nr_irqs_gsi; | 3470 | irq_want = nr_irqs_gsi; |
@@ -3599,7 +3599,7 @@ static void hpet_msi_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
3599 | 3599 | ||
3600 | #endif /* CONFIG_SMP */ | 3600 | #endif /* CONFIG_SMP */ |
3601 | 3601 | ||
3602 | struct irq_chip hpet_msi_type = { | 3602 | static struct irq_chip hpet_msi_type = { |
3603 | .name = "HPET_MSI", | 3603 | .name = "HPET_MSI", |
3604 | .unmask = hpet_msi_unmask, | 3604 | .unmask = hpet_msi_unmask, |
3605 | .mask = hpet_msi_mask, | 3605 | .mask = hpet_msi_mask, |
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c index 10f92fb532f3..3475440baa54 100644 --- a/arch/x86/kernel/i8253.c +++ b/arch/x86/kernel/i8253.c | |||
@@ -3,17 +3,17 @@ | |||
3 | * | 3 | * |
4 | */ | 4 | */ |
5 | #include <linux/clockchips.h> | 5 | #include <linux/clockchips.h> |
6 | #include <linux/init.h> | ||
7 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
7 | #include <linux/spinlock.h> | ||
8 | #include <linux/jiffies.h> | 8 | #include <linux/jiffies.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/spinlock.h> | 10 | #include <linux/delay.h> |
11 | #include <linux/init.h> | ||
12 | #include <linux/io.h> | ||
11 | 13 | ||
12 | #include <asm/smp.h> | ||
13 | #include <asm/delay.h> | ||
14 | #include <asm/i8253.h> | 14 | #include <asm/i8253.h> |
15 | #include <asm/io.h> | ||
16 | #include <asm/hpet.h> | 15 | #include <asm/hpet.h> |
16 | #include <asm/smp.h> | ||
17 | 17 | ||
18 | DEFINE_SPINLOCK(i8253_lock); | 18 | DEFINE_SPINLOCK(i8253_lock); |
19 | EXPORT_SYMBOL(i8253_lock); | 19 | EXPORT_SYMBOL(i8253_lock); |
@@ -40,7 +40,7 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
40 | { | 40 | { |
41 | spin_lock(&i8253_lock); | 41 | spin_lock(&i8253_lock); |
42 | 42 | ||
43 | switch(mode) { | 43 | switch (mode) { |
44 | case CLOCK_EVT_MODE_PERIODIC: | 44 | case CLOCK_EVT_MODE_PERIODIC: |
45 | /* binary, mode 2, LSB/MSB, ch 0 */ | 45 | /* binary, mode 2, LSB/MSB, ch 0 */ |
46 | outb_pit(0x34, PIT_MODE); | 46 | outb_pit(0x34, PIT_MODE); |
@@ -95,7 +95,7 @@ static int pit_next_event(unsigned long delta, struct clock_event_device *evt) | |||
95 | * registered. This mechanism replaces the previous #ifdef LOCAL_APIC - | 95 | * registered. This mechanism replaces the previous #ifdef LOCAL_APIC - |
96 | * !using_apic_timer decisions in do_timer_interrupt_hook() | 96 | * !using_apic_timer decisions in do_timer_interrupt_hook() |
97 | */ | 97 | */ |
98 | static struct clock_event_device pit_clockevent = { | 98 | static struct clock_event_device pit_ce = { |
99 | .name = "pit", | 99 | .name = "pit", |
100 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 100 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
101 | .set_mode = init_pit_timer, | 101 | .set_mode = init_pit_timer, |
@@ -114,15 +114,13 @@ void __init setup_pit_timer(void) | |||
114 | * Start pit with the boot cpu mask and make it global after the | 114 | * Start pit with the boot cpu mask and make it global after the |
115 | * IO_APIC has been initialized. | 115 | * IO_APIC has been initialized. |
116 | */ | 116 | */ |
117 | pit_clockevent.cpumask = cpumask_of(smp_processor_id()); | 117 | pit_ce.cpumask = cpumask_of(smp_processor_id()); |
118 | pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, | 118 | pit_ce.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, pit_ce.shift); |
119 | pit_clockevent.shift); | 119 | pit_ce.max_delta_ns = clockevent_delta2ns(0x7FFF, &pit_ce); |
120 | pit_clockevent.max_delta_ns = | 120 | pit_ce.min_delta_ns = clockevent_delta2ns(0xF, &pit_ce); |
121 | clockevent_delta2ns(0x7FFF, &pit_clockevent); | 121 | |
122 | pit_clockevent.min_delta_ns = | 122 | clockevents_register_device(&pit_ce); |
123 | clockevent_delta2ns(0xF, &pit_clockevent); | 123 | global_clock_event = &pit_ce; |
124 | clockevents_register_device(&pit_clockevent); | ||
125 | global_clock_event = &pit_clockevent; | ||
126 | } | 124 | } |
127 | 125 | ||
128 | #ifndef CONFIG_X86_64 | 126 | #ifndef CONFIG_X86_64 |
@@ -133,11 +131,11 @@ void __init setup_pit_timer(void) | |||
133 | */ | 131 | */ |
134 | static cycle_t pit_read(void) | 132 | static cycle_t pit_read(void) |
135 | { | 133 | { |
134 | static int old_count; | ||
135 | static u32 old_jifs; | ||
136 | unsigned long flags; | 136 | unsigned long flags; |
137 | int count; | 137 | int count; |
138 | u32 jifs; | 138 | u32 jifs; |
139 | static int old_count; | ||
140 | static u32 old_jifs; | ||
141 | 139 | ||
142 | spin_lock_irqsave(&i8253_lock, flags); | 140 | spin_lock_irqsave(&i8253_lock, flags); |
143 | /* | 141 | /* |
@@ -179,9 +177,9 @@ static cycle_t pit_read(void) | |||
179 | * Previous attempts to handle these cases intelligently were | 177 | * Previous attempts to handle these cases intelligently were |
180 | * buggy, so we just do the simple thing now. | 178 | * buggy, so we just do the simple thing now. |
181 | */ | 179 | */ |
182 | if (count > old_count && jifs == old_jifs) { | 180 | if (count > old_count && jifs == old_jifs) |
183 | count = old_count; | 181 | count = old_count; |
184 | } | 182 | |
185 | old_count = count; | 183 | old_count = count; |
186 | old_jifs = jifs; | 184 | old_jifs = jifs; |
187 | 185 | ||
@@ -192,13 +190,13 @@ static cycle_t pit_read(void) | |||
192 | return (cycle_t)(jifs * LATCH) + count; | 190 | return (cycle_t)(jifs * LATCH) + count; |
193 | } | 191 | } |
194 | 192 | ||
195 | static struct clocksource clocksource_pit = { | 193 | static struct clocksource pit_cs = { |
196 | .name = "pit", | 194 | .name = "pit", |
197 | .rating = 110, | 195 | .rating = 110, |
198 | .read = pit_read, | 196 | .read = pit_read, |
199 | .mask = CLOCKSOURCE_MASK(32), | 197 | .mask = CLOCKSOURCE_MASK(32), |
200 | .mult = 0, | 198 | .mult = 0, |
201 | .shift = 20, | 199 | .shift = 20, |
202 | }; | 200 | }; |
203 | 201 | ||
204 | static void pit_disable_clocksource(void) | 202 | static void pit_disable_clocksource(void) |
@@ -206,9 +204,9 @@ static void pit_disable_clocksource(void) | |||
206 | /* | 204 | /* |
207 | * Use mult to check whether it is registered or not | 205 | * Use mult to check whether it is registered or not |
208 | */ | 206 | */ |
209 | if (clocksource_pit.mult) { | 207 | if (pit_cs.mult) { |
210 | clocksource_unregister(&clocksource_pit); | 208 | clocksource_unregister(&pit_cs); |
211 | clocksource_pit.mult = 0; | 209 | pit_cs.mult = 0; |
212 | } | 210 | } |
213 | } | 211 | } |
214 | 212 | ||
@@ -222,13 +220,13 @@ static int __init init_pit_clocksource(void) | |||
222 | * - when local APIC timer is active (PIT is switched off) | 220 | * - when local APIC timer is active (PIT is switched off) |
223 | */ | 221 | */ |
224 | if (num_possible_cpus() > 1 || is_hpet_enabled() || | 222 | if (num_possible_cpus() > 1 || is_hpet_enabled() || |
225 | pit_clockevent.mode != CLOCK_EVT_MODE_PERIODIC) | 223 | pit_ce.mode != CLOCK_EVT_MODE_PERIODIC) |
226 | return 0; | 224 | return 0; |
227 | 225 | ||
228 | clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, | 226 | pit_cs.mult = clocksource_hz2mult(CLOCK_TICK_RATE, pit_cs.shift); |
229 | clocksource_pit.shift); | 227 | |
230 | return clocksource_register(&clocksource_pit); | 228 | return clocksource_register(&pit_cs); |
231 | } | 229 | } |
232 | arch_initcall(init_pit_clocksource); | 230 | arch_initcall(init_pit_clocksource); |
233 | 231 | ||
234 | #endif | 232 | #endif /* !CONFIG_X86_64 */ |
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c index 720d2607aacb..a979b5bd2fc0 100644 --- a/arch/x86/kernel/io_delay.c +++ b/arch/x86/kernel/io_delay.c | |||
@@ -7,10 +7,10 @@ | |||
7 | */ | 7 | */ |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/init.h> | ||
11 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
11 | #include <linux/init.h> | ||
12 | #include <linux/dmi.h> | 12 | #include <linux/dmi.h> |
13 | #include <asm/io.h> | 13 | #include <linux/io.h> |
14 | 14 | ||
15 | int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE; | 15 | int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE; |
16 | 16 | ||
@@ -47,8 +47,7 @@ EXPORT_SYMBOL(native_io_delay); | |||
47 | static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id) | 47 | static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id) |
48 | { | 48 | { |
49 | if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) { | 49 | if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) { |
50 | printk(KERN_NOTICE "%s: using 0xed I/O delay port\n", | 50 | pr_notice("%s: using 0xed I/O delay port\n", id->ident); |
51 | id->ident); | ||
52 | io_delay_type = CONFIG_IO_DELAY_TYPE_0XED; | 51 | io_delay_type = CONFIG_IO_DELAY_TYPE_0XED; |
53 | } | 52 | } |
54 | 53 | ||
@@ -64,40 +63,40 @@ static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = { | |||
64 | .callback = dmi_io_delay_0xed_port, | 63 | .callback = dmi_io_delay_0xed_port, |
65 | .ident = "Compaq Presario V6000", | 64 | .ident = "Compaq Presario V6000", |
66 | .matches = { | 65 | .matches = { |
67 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), | 66 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), |
68 | DMI_MATCH(DMI_BOARD_NAME, "30B7") | 67 | DMI_MATCH(DMI_BOARD_NAME, "30B7") |
69 | } | 68 | } |
70 | }, | 69 | }, |
71 | { | 70 | { |
72 | .callback = dmi_io_delay_0xed_port, | 71 | .callback = dmi_io_delay_0xed_port, |
73 | .ident = "HP Pavilion dv9000z", | 72 | .ident = "HP Pavilion dv9000z", |
74 | .matches = { | 73 | .matches = { |
75 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), | 74 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), |
76 | DMI_MATCH(DMI_BOARD_NAME, "30B9") | 75 | DMI_MATCH(DMI_BOARD_NAME, "30B9") |
77 | } | 76 | } |
78 | }, | 77 | }, |
79 | { | 78 | { |
80 | .callback = dmi_io_delay_0xed_port, | 79 | .callback = dmi_io_delay_0xed_port, |
81 | .ident = "HP Pavilion dv6000", | 80 | .ident = "HP Pavilion dv6000", |
82 | .matches = { | 81 | .matches = { |
83 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), | 82 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), |
84 | DMI_MATCH(DMI_BOARD_NAME, "30B8") | 83 | DMI_MATCH(DMI_BOARD_NAME, "30B8") |
85 | } | 84 | } |
86 | }, | 85 | }, |
87 | { | 86 | { |
88 | .callback = dmi_io_delay_0xed_port, | 87 | .callback = dmi_io_delay_0xed_port, |
89 | .ident = "HP Pavilion tx1000", | 88 | .ident = "HP Pavilion tx1000", |
90 | .matches = { | 89 | .matches = { |
91 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), | 90 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), |
92 | DMI_MATCH(DMI_BOARD_NAME, "30BF") | 91 | DMI_MATCH(DMI_BOARD_NAME, "30BF") |
93 | } | 92 | } |
94 | }, | 93 | }, |
95 | { | 94 | { |
96 | .callback = dmi_io_delay_0xed_port, | 95 | .callback = dmi_io_delay_0xed_port, |
97 | .ident = "Presario F700", | 96 | .ident = "Presario F700", |
98 | .matches = { | 97 | .matches = { |
99 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), | 98 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), |
100 | DMI_MATCH(DMI_BOARD_NAME, "30D3") | 99 | DMI_MATCH(DMI_BOARD_NAME, "30D3") |
101 | } | 100 | } |
102 | }, | 101 | }, |
103 | { } | 102 | { } |
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index ff7d3b0124f1..e444357375ce 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c | |||
@@ -8,11 +8,11 @@ | |||
8 | */ | 8 | */ |
9 | #include <linux/debugfs.h> | 9 | #include <linux/debugfs.h> |
10 | #include <linux/uaccess.h> | 10 | #include <linux/uaccess.h> |
11 | #include <linux/stat.h> | 11 | #include <linux/module.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/stat.h> | ||
13 | #include <linux/io.h> | 14 | #include <linux/io.h> |
14 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
15 | #include <linux/module.h> | ||
16 | 16 | ||
17 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
18 | 18 | ||
@@ -26,9 +26,8 @@ struct setup_data_node { | |||
26 | u32 len; | 26 | u32 len; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | static ssize_t | 29 | static ssize_t setup_data_read(struct file *file, char __user *user_buf, |
30 | setup_data_read(struct file *file, char __user *user_buf, size_t count, | 30 | size_t count, loff_t *ppos) |
31 | loff_t *ppos) | ||
32 | { | 31 | { |
33 | struct setup_data_node *node = file->private_data; | 32 | struct setup_data_node *node = file->private_data; |
34 | unsigned long remain; | 33 | unsigned long remain; |
@@ -39,20 +38,21 @@ setup_data_read(struct file *file, char __user *user_buf, size_t count, | |||
39 | 38 | ||
40 | if (pos < 0) | 39 | if (pos < 0) |
41 | return -EINVAL; | 40 | return -EINVAL; |
41 | |||
42 | if (pos >= node->len) | 42 | if (pos >= node->len) |
43 | return 0; | 43 | return 0; |
44 | 44 | ||
45 | if (count > node->len - pos) | 45 | if (count > node->len - pos) |
46 | count = node->len - pos; | 46 | count = node->len - pos; |
47 | |||
47 | pa = node->paddr + sizeof(struct setup_data) + pos; | 48 | pa = node->paddr + sizeof(struct setup_data) + pos; |
48 | pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT); | 49 | pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT); |
49 | if (PageHighMem(pg)) { | 50 | if (PageHighMem(pg)) { |
50 | p = ioremap_cache(pa, count); | 51 | p = ioremap_cache(pa, count); |
51 | if (!p) | 52 | if (!p) |
52 | return -ENXIO; | 53 | return -ENXIO; |
53 | } else { | 54 | } else |
54 | p = __va(pa); | 55 | p = __va(pa); |
55 | } | ||
56 | 56 | ||
57 | remain = copy_to_user(user_buf, p, count); | 57 | remain = copy_to_user(user_buf, p, count); |
58 | 58 | ||
@@ -70,12 +70,13 @@ setup_data_read(struct file *file, char __user *user_buf, size_t count, | |||
70 | static int setup_data_open(struct inode *inode, struct file *file) | 70 | static int setup_data_open(struct inode *inode, struct file *file) |
71 | { | 71 | { |
72 | file->private_data = inode->i_private; | 72 | file->private_data = inode->i_private; |
73 | |||
73 | return 0; | 74 | return 0; |
74 | } | 75 | } |
75 | 76 | ||
76 | static const struct file_operations fops_setup_data = { | 77 | static const struct file_operations fops_setup_data = { |
77 | .read = setup_data_read, | 78 | .read = setup_data_read, |
78 | .open = setup_data_open, | 79 | .open = setup_data_open, |
79 | }; | 80 | }; |
80 | 81 | ||
81 | static int __init | 82 | static int __init |
@@ -84,57 +85,50 @@ create_setup_data_node(struct dentry *parent, int no, | |||
84 | { | 85 | { |
85 | struct dentry *d, *type, *data; | 86 | struct dentry *d, *type, *data; |
86 | char buf[16]; | 87 | char buf[16]; |
87 | int error; | ||
88 | 88 | ||
89 | sprintf(buf, "%d", no); | 89 | sprintf(buf, "%d", no); |
90 | d = debugfs_create_dir(buf, parent); | 90 | d = debugfs_create_dir(buf, parent); |
91 | if (!d) { | 91 | if (!d) |
92 | error = -ENOMEM; | 92 | return -ENOMEM; |
93 | goto err_return; | 93 | |
94 | } | ||
95 | type = debugfs_create_x32("type", S_IRUGO, d, &node->type); | 94 | type = debugfs_create_x32("type", S_IRUGO, d, &node->type); |
96 | if (!type) { | 95 | if (!type) |
97 | error = -ENOMEM; | ||
98 | goto err_dir; | 96 | goto err_dir; |
99 | } | 97 | |
100 | data = debugfs_create_file("data", S_IRUGO, d, node, &fops_setup_data); | 98 | data = debugfs_create_file("data", S_IRUGO, d, node, &fops_setup_data); |
101 | if (!data) { | 99 | if (!data) |
102 | error = -ENOMEM; | ||
103 | goto err_type; | 100 | goto err_type; |
104 | } | 101 | |
105 | return 0; | 102 | return 0; |
106 | 103 | ||
107 | err_type: | 104 | err_type: |
108 | debugfs_remove(type); | 105 | debugfs_remove(type); |
109 | err_dir: | 106 | err_dir: |
110 | debugfs_remove(d); | 107 | debugfs_remove(d); |
111 | err_return: | 108 | return -ENOMEM; |
112 | return error; | ||
113 | } | 109 | } |
114 | 110 | ||
115 | static int __init create_setup_data_nodes(struct dentry *parent) | 111 | static int __init create_setup_data_nodes(struct dentry *parent) |
116 | { | 112 | { |
117 | struct setup_data_node *node; | 113 | struct setup_data_node *node; |
118 | struct setup_data *data; | 114 | struct setup_data *data; |
119 | int error, no = 0; | 115 | int error = -ENOMEM; |
120 | struct dentry *d; | 116 | struct dentry *d; |
121 | struct page *pg; | 117 | struct page *pg; |
122 | u64 pa_data; | 118 | u64 pa_data; |
119 | int no = 0; | ||
123 | 120 | ||
124 | d = debugfs_create_dir("setup_data", parent); | 121 | d = debugfs_create_dir("setup_data", parent); |
125 | if (!d) { | 122 | if (!d) |
126 | error = -ENOMEM; | 123 | return -ENOMEM; |
127 | goto err_return; | ||
128 | } | ||
129 | 124 | ||
130 | pa_data = boot_params.hdr.setup_data; | 125 | pa_data = boot_params.hdr.setup_data; |
131 | 126 | ||
132 | while (pa_data) { | 127 | while (pa_data) { |
133 | node = kmalloc(sizeof(*node), GFP_KERNEL); | 128 | node = kmalloc(sizeof(*node), GFP_KERNEL); |
134 | if (!node) { | 129 | if (!node) |
135 | error = -ENOMEM; | ||
136 | goto err_dir; | 130 | goto err_dir; |
137 | } | 131 | |
138 | pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT); | 132 | pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT); |
139 | if (PageHighMem(pg)) { | 133 | if (PageHighMem(pg)) { |
140 | data = ioremap_cache(pa_data, sizeof(*data)); | 134 | data = ioremap_cache(pa_data, sizeof(*data)); |
@@ -143,9 +137,8 @@ static int __init create_setup_data_nodes(struct dentry *parent) | |||
143 | error = -ENXIO; | 137 | error = -ENXIO; |
144 | goto err_dir; | 138 | goto err_dir; |
145 | } | 139 | } |
146 | } else { | 140 | } else |
147 | data = __va(pa_data); | 141 | data = __va(pa_data); |
148 | } | ||
149 | 142 | ||
150 | node->paddr = pa_data; | 143 | node->paddr = pa_data; |
151 | node->type = data->type; | 144 | node->type = data->type; |
@@ -159,11 +152,11 @@ static int __init create_setup_data_nodes(struct dentry *parent) | |||
159 | goto err_dir; | 152 | goto err_dir; |
160 | no++; | 153 | no++; |
161 | } | 154 | } |
155 | |||
162 | return 0; | 156 | return 0; |
163 | 157 | ||
164 | err_dir: | 158 | err_dir: |
165 | debugfs_remove(d); | 159 | debugfs_remove(d); |
166 | err_return: | ||
167 | return error; | 160 | return error; |
168 | } | 161 | } |
169 | 162 | ||
@@ -175,28 +168,26 @@ static struct debugfs_blob_wrapper boot_params_blob = { | |||
175 | static int __init boot_params_kdebugfs_init(void) | 168 | static int __init boot_params_kdebugfs_init(void) |
176 | { | 169 | { |
177 | struct dentry *dbp, *version, *data; | 170 | struct dentry *dbp, *version, *data; |
178 | int error; | 171 | int error = -ENOMEM; |
179 | 172 | ||
180 | dbp = debugfs_create_dir("boot_params", NULL); | 173 | dbp = debugfs_create_dir("boot_params", NULL); |
181 | if (!dbp) { | 174 | if (!dbp) |
182 | error = -ENOMEM; | 175 | return -ENOMEM; |
183 | goto err_return; | 176 | |
184 | } | ||
185 | version = debugfs_create_x16("version", S_IRUGO, dbp, | 177 | version = debugfs_create_x16("version", S_IRUGO, dbp, |
186 | &boot_params.hdr.version); | 178 | &boot_params.hdr.version); |
187 | if (!version) { | 179 | if (!version) |
188 | error = -ENOMEM; | ||
189 | goto err_dir; | 180 | goto err_dir; |
190 | } | 181 | |
191 | data = debugfs_create_blob("data", S_IRUGO, dbp, | 182 | data = debugfs_create_blob("data", S_IRUGO, dbp, |
192 | &boot_params_blob); | 183 | &boot_params_blob); |
193 | if (!data) { | 184 | if (!data) |
194 | error = -ENOMEM; | ||
195 | goto err_version; | 185 | goto err_version; |
196 | } | 186 | |
197 | error = create_setup_data_nodes(dbp); | 187 | error = create_setup_data_nodes(dbp); |
198 | if (error) | 188 | if (error) |
199 | goto err_data; | 189 | goto err_data; |
190 | |||
200 | return 0; | 191 | return 0; |
201 | 192 | ||
202 | err_data: | 193 | err_data: |
@@ -205,10 +196,9 @@ err_version: | |||
205 | debugfs_remove(version); | 196 | debugfs_remove(version); |
206 | err_dir: | 197 | err_dir: |
207 | debugfs_remove(dbp); | 198 | debugfs_remove(dbp); |
208 | err_return: | ||
209 | return error; | 199 | return error; |
210 | } | 200 | } |
211 | #endif | 201 | #endif /* CONFIG_DEBUG_BOOT_PARAMS */ |
212 | 202 | ||
213 | static int __init arch_kdebugfs_init(void) | 203 | static int __init arch_kdebugfs_init(void) |
214 | { | 204 | { |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 290cb57f4697..dce99dca6cf8 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -282,6 +282,14 @@ static void skip_entry(unsigned char **ptr, int *count, int size) | |||
282 | *count += size; | 282 | *count += size; |
283 | } | 283 | } |
284 | 284 | ||
285 | static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) | ||
286 | { | ||
287 | printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n" | ||
288 | "type %x\n", *mpt); | ||
289 | print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, | ||
290 | 1, mpc, mpc->length, 1); | ||
291 | } | ||
292 | |||
285 | static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) | 293 | static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) |
286 | { | 294 | { |
287 | char str[16]; | 295 | char str[16]; |
@@ -340,10 +348,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) | |||
340 | break; | 348 | break; |
341 | default: | 349 | default: |
342 | /* wrong mptable */ | 350 | /* wrong mptable */ |
343 | printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); | 351 | smp_dump_mptable(mpc, mpt); |
344 | printk(KERN_ERR "type %x\n", *mpt); | ||
345 | print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, | ||
346 | 1, mpc, mpc->length, 1); | ||
347 | count = mpc->length; | 352 | count = mpc->length; |
348 | break; | 353 | break; |
349 | } | 354 | } |
@@ -550,6 +555,55 @@ static unsigned long __init get_mpc_size(unsigned long physptr) | |||
550 | return size; | 555 | return size; |
551 | } | 556 | } |
552 | 557 | ||
558 | static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) | ||
559 | { | ||
560 | struct mpc_table *mpc; | ||
561 | unsigned long size; | ||
562 | |||
563 | size = get_mpc_size(mpf->physptr); | ||
564 | mpc = early_ioremap(mpf->physptr, size); | ||
565 | /* | ||
566 | * Read the physical hardware table. Anything here will | ||
567 | * override the defaults. | ||
568 | */ | ||
569 | if (!smp_read_mpc(mpc, early)) { | ||
570 | #ifdef CONFIG_X86_LOCAL_APIC | ||
571 | smp_found_config = 0; | ||
572 | #endif | ||
573 | printk(KERN_ERR "BIOS bug, MP table errors detected!...\n" | ||
574 | "... disabling SMP support. (tell your hw vendor)\n"); | ||
575 | early_iounmap(mpc, size); | ||
576 | return -1; | ||
577 | } | ||
578 | early_iounmap(mpc, size); | ||
579 | |||
580 | if (early) | ||
581 | return -1; | ||
582 | |||
583 | #ifdef CONFIG_X86_IO_APIC | ||
584 | /* | ||
585 | * If there are no explicit MP IRQ entries, then we are | ||
586 | * broken. We set up most of the low 16 IO-APIC pins to | ||
587 | * ISA defaults and hope it will work. | ||
588 | */ | ||
589 | if (!mp_irq_entries) { | ||
590 | struct mpc_bus bus; | ||
591 | |||
592 | printk(KERN_ERR "BIOS bug, no explicit IRQ entries, " | ||
593 | "using default mptable. (tell your hw vendor)\n"); | ||
594 | |||
595 | bus.type = MP_BUS; | ||
596 | bus.busid = 0; | ||
597 | memcpy(bus.bustype, "ISA ", 6); | ||
598 | MP_bus_info(&bus); | ||
599 | |||
600 | construct_default_ioirq_mptable(0); | ||
601 | } | ||
602 | #endif | ||
603 | |||
604 | return 0; | ||
605 | } | ||
606 | |||
553 | /* | 607 | /* |
554 | * Scan the memory blocks for an SMP configuration block. | 608 | * Scan the memory blocks for an SMP configuration block. |
555 | */ | 609 | */ |
@@ -603,51 +657,8 @@ static void __init __get_smp_config(unsigned int early) | |||
603 | construct_default_ISA_mptable(mpf->feature1); | 657 | construct_default_ISA_mptable(mpf->feature1); |
604 | 658 | ||
605 | } else if (mpf->physptr) { | 659 | } else if (mpf->physptr) { |
606 | struct mpc_table *mpc; | 660 | if (check_physptr(mpf, early)) |
607 | unsigned long size; | ||
608 | |||
609 | size = get_mpc_size(mpf->physptr); | ||
610 | mpc = early_ioremap(mpf->physptr, size); | ||
611 | /* | ||
612 | * Read the physical hardware table. Anything here will | ||
613 | * override the defaults. | ||
614 | */ | ||
615 | if (!smp_read_mpc(mpc, early)) { | ||
616 | #ifdef CONFIG_X86_LOCAL_APIC | ||
617 | smp_found_config = 0; | ||
618 | #endif | ||
619 | printk(KERN_ERR | ||
620 | "BIOS bug, MP table errors detected!...\n"); | ||
621 | printk(KERN_ERR "... disabling SMP support. " | ||
622 | "(tell your hw vendor)\n"); | ||
623 | early_iounmap(mpc, size); | ||
624 | return; | 661 | return; |
625 | } | ||
626 | early_iounmap(mpc, size); | ||
627 | |||
628 | if (early) | ||
629 | return; | ||
630 | #ifdef CONFIG_X86_IO_APIC | ||
631 | /* | ||
632 | * If there are no explicit MP IRQ entries, then we are | ||
633 | * broken. We set up most of the low 16 IO-APIC pins to | ||
634 | * ISA defaults and hope it will work. | ||
635 | */ | ||
636 | if (!mp_irq_entries) { | ||
637 | struct mpc_bus bus; | ||
638 | |||
639 | printk(KERN_ERR "BIOS bug, no explicit IRQ entries, " | ||
640 | "using default mptable. " | ||
641 | "(tell your hw vendor)\n"); | ||
642 | |||
643 | bus.type = MP_BUS; | ||
644 | bus.busid = 0; | ||
645 | memcpy(bus.bustype, "ISA ", 6); | ||
646 | MP_bus_info(&bus); | ||
647 | |||
648 | construct_default_ioirq_mptable(0); | ||
649 | } | ||
650 | #endif | ||
651 | } else | 662 | } else |
652 | BUG(); | 663 | BUG(); |
653 | 664 | ||
@@ -910,10 +921,7 @@ static int __init replace_intsrc_all(struct mpc_table *mpc, | |||
910 | break; | 921 | break; |
911 | default: | 922 | default: |
912 | /* wrong mptable */ | 923 | /* wrong mptable */ |
913 | printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); | 924 | smp_dump_mptable(mpc, mpt); |
914 | printk(KERN_ERR "type %x\n", *mpt); | ||
915 | print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, | ||
916 | 1, mpc, mpc->length, 1); | ||
917 | goto out; | 925 | goto out; |
918 | } | 926 | } |
919 | } | 927 | } |
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index c70ab5a5d4c8..8b02a3936d42 100644 --- a/arch/x86/kernel/pci-nommu.c +++ b/arch/x86/kernel/pci-nommu.c | |||
@@ -1,14 +1,14 @@ | |||
1 | /* Fallback functions when the main IOMMU code is not compiled in. This | 1 | /* Fallback functions when the main IOMMU code is not compiled in. This |
2 | code is roughly equivalent to i386. */ | 2 | code is roughly equivalent to i386. */ |
3 | #include <linux/mm.h> | ||
4 | #include <linux/init.h> | ||
5 | #include <linux/pci.h> | ||
6 | #include <linux/string.h> | ||
7 | #include <linux/dma-mapping.h> | 3 | #include <linux/dma-mapping.h> |
8 | #include <linux/scatterlist.h> | 4 | #include <linux/scatterlist.h> |
5 | #include <linux/string.h> | ||
6 | #include <linux/init.h> | ||
7 | #include <linux/pci.h> | ||
8 | #include <linux/mm.h> | ||
9 | 9 | ||
10 | #include <asm/iommu.h> | ||
11 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
11 | #include <asm/iommu.h> | ||
12 | #include <asm/dma.h> | 12 | #include <asm/dma.h> |
13 | 13 | ||
14 | static int | 14 | static int |
@@ -79,11 +79,11 @@ static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
79 | } | 79 | } |
80 | 80 | ||
81 | struct dma_mapping_ops nommu_dma_ops = { | 81 | struct dma_mapping_ops nommu_dma_ops = { |
82 | .alloc_coherent = dma_generic_alloc_coherent, | 82 | .alloc_coherent = dma_generic_alloc_coherent, |
83 | .free_coherent = nommu_free_coherent, | 83 | .free_coherent = nommu_free_coherent, |
84 | .map_single = nommu_map_single, | 84 | .map_single = nommu_map_single, |
85 | .map_sg = nommu_map_sg, | 85 | .map_sg = nommu_map_sg, |
86 | .is_phys = 1, | 86 | .is_phys = 1, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | void __init no_iommu_init(void) | 89 | void __init no_iommu_init(void) |
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index dd6f2b71561b..5d465b207e72 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * RTC related functions | 2 | * RTC related functions |
3 | */ | 3 | */ |
4 | #include <linux/platform_device.h> | ||
5 | #include <linux/mc146818rtc.h> | ||
4 | #include <linux/acpi.h> | 6 | #include <linux/acpi.h> |
5 | #include <linux/bcd.h> | 7 | #include <linux/bcd.h> |
6 | #include <linux/mc146818rtc.h> | ||
7 | #include <linux/platform_device.h> | ||
8 | #include <linux/pnp.h> | 8 | #include <linux/pnp.h> |
9 | 9 | ||
10 | #include <asm/time.h> | ||
11 | #include <asm/vsyscall.h> | 10 | #include <asm/vsyscall.h> |
11 | #include <asm/time.h> | ||
12 | 12 | ||
13 | #ifdef CONFIG_X86_32 | 13 | #ifdef CONFIG_X86_32 |
14 | /* | 14 | /* |
@@ -16,9 +16,9 @@ | |||
16 | * register we are working with. It is required for NMI access to the | 16 | * register we are working with. It is required for NMI access to the |
17 | * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details. | 17 | * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details. |
18 | */ | 18 | */ |
19 | volatile unsigned long cmos_lock = 0; | 19 | volatile unsigned long cmos_lock; |
20 | EXPORT_SYMBOL(cmos_lock); | 20 | EXPORT_SYMBOL(cmos_lock); |
21 | #endif | 21 | #endif /* CONFIG_X86_32 */ |
22 | 22 | ||
23 | /* For two digit years assume time is always after that */ | 23 | /* For two digit years assume time is always after that */ |
24 | #define CMOS_YEARS_OFFS 2000 | 24 | #define CMOS_YEARS_OFFS 2000 |
@@ -38,9 +38,9 @@ EXPORT_SYMBOL(rtc_lock); | |||
38 | */ | 38 | */ |
39 | int mach_set_rtc_mmss(unsigned long nowtime) | 39 | int mach_set_rtc_mmss(unsigned long nowtime) |
40 | { | 40 | { |
41 | int retval = 0; | ||
42 | int real_seconds, real_minutes, cmos_minutes; | 41 | int real_seconds, real_minutes, cmos_minutes; |
43 | unsigned char save_control, save_freq_select; | 42 | unsigned char save_control, save_freq_select; |
43 | int retval = 0; | ||
44 | 44 | ||
45 | /* tell the clock it's being set */ | 45 | /* tell the clock it's being set */ |
46 | save_control = CMOS_READ(RTC_CONTROL); | 46 | save_control = CMOS_READ(RTC_CONTROL); |
@@ -72,8 +72,8 @@ int mach_set_rtc_mmss(unsigned long nowtime) | |||
72 | real_seconds = bin2bcd(real_seconds); | 72 | real_seconds = bin2bcd(real_seconds); |
73 | real_minutes = bin2bcd(real_minutes); | 73 | real_minutes = bin2bcd(real_minutes); |
74 | } | 74 | } |
75 | CMOS_WRITE(real_seconds,RTC_SECONDS); | 75 | CMOS_WRITE(real_seconds, RTC_SECONDS); |
76 | CMOS_WRITE(real_minutes,RTC_MINUTES); | 76 | CMOS_WRITE(real_minutes, RTC_MINUTES); |
77 | } else { | 77 | } else { |
78 | printk(KERN_WARNING | 78 | printk(KERN_WARNING |
79 | "set_rtc_mmss: can't update from %d to %d\n", | 79 | "set_rtc_mmss: can't update from %d to %d\n", |
@@ -151,6 +151,7 @@ unsigned char rtc_cmos_read(unsigned char addr) | |||
151 | outb(addr, RTC_PORT(0)); | 151 | outb(addr, RTC_PORT(0)); |
152 | val = inb(RTC_PORT(1)); | 152 | val = inb(RTC_PORT(1)); |
153 | lock_cmos_suffix(addr); | 153 | lock_cmos_suffix(addr); |
154 | |||
154 | return val; | 155 | return val; |
155 | } | 156 | } |
156 | EXPORT_SYMBOL(rtc_cmos_read); | 157 | EXPORT_SYMBOL(rtc_cmos_read); |
@@ -166,8 +167,8 @@ EXPORT_SYMBOL(rtc_cmos_write); | |||
166 | 167 | ||
167 | static int set_rtc_mmss(unsigned long nowtime) | 168 | static int set_rtc_mmss(unsigned long nowtime) |
168 | { | 169 | { |
169 | int retval; | ||
170 | unsigned long flags; | 170 | unsigned long flags; |
171 | int retval; | ||
171 | 172 | ||
172 | spin_lock_irqsave(&rtc_lock, flags); | 173 | spin_lock_irqsave(&rtc_lock, flags); |
173 | retval = set_wallclock(nowtime); | 174 | retval = set_wallclock(nowtime); |
@@ -242,6 +243,7 @@ static __init int add_rtc_cmos(void) | |||
242 | platform_device_register(&rtc_device); | 243 | platform_device_register(&rtc_device); |
243 | dev_info(&rtc_device.dev, | 244 | dev_info(&rtc_device.dev, |
244 | "registered platform RTC device (no PNP device found)\n"); | 245 | "registered platform RTC device (no PNP device found)\n"); |
246 | |||
245 | return 0; | 247 | return 0; |
246 | } | 248 | } |
247 | device_initcall(add_rtc_cmos); | 249 | device_initcall(add_rtc_cmos); |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index d2cc6428c587..dfcc74ab0ab6 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -211,31 +211,27 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size, | |||
211 | { | 211 | { |
212 | /* Default to using normal stack */ | 212 | /* Default to using normal stack */ |
213 | unsigned long sp = regs->sp; | 213 | unsigned long sp = regs->sp; |
214 | int onsigstack = on_sig_stack(sp); | ||
214 | 215 | ||
215 | #ifdef CONFIG_X86_64 | 216 | #ifdef CONFIG_X86_64 |
216 | /* redzone */ | 217 | /* redzone */ |
217 | sp -= 128; | 218 | sp -= 128; |
218 | #endif /* CONFIG_X86_64 */ | 219 | #endif /* CONFIG_X86_64 */ |
219 | 220 | ||
220 | /* | 221 | if (!onsigstack) { |
221 | * If we are on the alternate signal stack and would overflow it, don't. | 222 | /* This is the X/Open sanctioned signal stack switching. */ |
222 | * Return an always-bogus address instead so we will die with SIGSEGV. | 223 | if (ka->sa.sa_flags & SA_ONSTACK) { |
223 | */ | 224 | if (sas_ss_flags(sp) == 0) |
224 | if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size))) | 225 | sp = current->sas_ss_sp + current->sas_ss_size; |
225 | return (void __user *) -1L; | 226 | } else { |
226 | |||
227 | /* This is the X/Open sanctioned signal stack switching. */ | ||
228 | if (ka->sa.sa_flags & SA_ONSTACK) { | ||
229 | if (sas_ss_flags(sp) == 0) | ||
230 | sp = current->sas_ss_sp + current->sas_ss_size; | ||
231 | } else { | ||
232 | #ifdef CONFIG_X86_32 | 227 | #ifdef CONFIG_X86_32 |
233 | /* This is the legacy signal stack switching. */ | 228 | /* This is the legacy signal stack switching. */ |
234 | if ((regs->ss & 0xffff) != __USER_DS && | 229 | if ((regs->ss & 0xffff) != __USER_DS && |
235 | !(ka->sa.sa_flags & SA_RESTORER) && | 230 | !(ka->sa.sa_flags & SA_RESTORER) && |
236 | ka->sa.sa_restorer) | 231 | ka->sa.sa_restorer) |
237 | sp = (unsigned long) ka->sa.sa_restorer; | 232 | sp = (unsigned long) ka->sa.sa_restorer; |
238 | #endif /* CONFIG_X86_32 */ | 233 | #endif /* CONFIG_X86_32 */ |
234 | } | ||
239 | } | 235 | } |
240 | 236 | ||
241 | if (used_math()) { | 237 | if (used_math()) { |
@@ -244,12 +240,22 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size, | |||
244 | sp = round_down(sp, 64); | 240 | sp = round_down(sp, 64); |
245 | #endif /* CONFIG_X86_64 */ | 241 | #endif /* CONFIG_X86_64 */ |
246 | *fpstate = (void __user *)sp; | 242 | *fpstate = (void __user *)sp; |
247 | |||
248 | if (save_i387_xstate(*fpstate) < 0) | ||
249 | return (void __user *)-1L; | ||
250 | } | 243 | } |
251 | 244 | ||
252 | return (void __user *)align_sigframe(sp - frame_size); | 245 | sp = align_sigframe(sp - frame_size); |
246 | |||
247 | /* | ||
248 | * If we are on the alternate signal stack and would overflow it, don't. | ||
249 | * Return an always-bogus address instead so we will die with SIGSEGV. | ||
250 | */ | ||
251 | if (onsigstack && !likely(on_sig_stack(sp))) | ||
252 | return (void __user *)-1L; | ||
253 | |||
254 | /* save i387 state */ | ||
255 | if (used_math() && save_i387_xstate(*fpstate) < 0) | ||
256 | return (void __user *)-1L; | ||
257 | |||
258 | return (void __user *)sp; | ||
253 | } | 259 | } |
254 | 260 | ||
255 | #ifdef CONFIG_X86_32 | 261 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index 0fcc95a354f7..7e4515957a1c 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c | |||
@@ -25,10 +25,10 @@ | |||
25 | * | 25 | * |
26 | * Send feedback to <colpatch@us.ibm.com> | 26 | * Send feedback to <colpatch@us.ibm.com> |
27 | */ | 27 | */ |
28 | #include <linux/init.h> | ||
29 | #include <linux/smp.h> | ||
30 | #include <linux/nodemask.h> | 28 | #include <linux/nodemask.h> |
31 | #include <linux/mmzone.h> | 29 | #include <linux/mmzone.h> |
30 | #include <linux/init.h> | ||
31 | #include <linux/smp.h> | ||
32 | #include <asm/cpu.h> | 32 | #include <asm/cpu.h> |
33 | 33 | ||
34 | static DEFINE_PER_CPU(struct x86_cpu, cpu_devices); | 34 | static DEFINE_PER_CPU(struct x86_cpu, cpu_devices); |
@@ -47,6 +47,7 @@ int __ref arch_register_cpu(int num) | |||
47 | */ | 47 | */ |
48 | if (num) | 48 | if (num) |
49 | per_cpu(cpu_devices, num).cpu.hotpluggable = 1; | 49 | per_cpu(cpu_devices, num).cpu.hotpluggable = 1; |
50 | |||
50 | return register_cpu(&per_cpu(cpu_devices, num).cpu, num); | 51 | return register_cpu(&per_cpu(cpu_devices, num).cpu, num); |
51 | } | 52 | } |
52 | EXPORT_SYMBOL(arch_register_cpu); | 53 | EXPORT_SYMBOL(arch_register_cpu); |
@@ -56,12 +57,13 @@ void arch_unregister_cpu(int num) | |||
56 | unregister_cpu(&per_cpu(cpu_devices, num).cpu); | 57 | unregister_cpu(&per_cpu(cpu_devices, num).cpu); |
57 | } | 58 | } |
58 | EXPORT_SYMBOL(arch_unregister_cpu); | 59 | EXPORT_SYMBOL(arch_unregister_cpu); |
59 | #else | 60 | #else /* CONFIG_HOTPLUG_CPU */ |
61 | |||
60 | static int __init arch_register_cpu(int num) | 62 | static int __init arch_register_cpu(int num) |
61 | { | 63 | { |
62 | return register_cpu(&per_cpu(cpu_devices, num).cpu, num); | 64 | return register_cpu(&per_cpu(cpu_devices, num).cpu, num); |
63 | } | 65 | } |
64 | #endif /*CONFIG_HOTPLUG_CPU*/ | 66 | #endif /* CONFIG_HOTPLUG_CPU */ |
65 | 67 | ||
66 | static int __init topology_init(void) | 68 | static int __init topology_init(void) |
67 | { | 69 | { |
@@ -70,11 +72,11 @@ static int __init topology_init(void) | |||
70 | #ifdef CONFIG_NUMA | 72 | #ifdef CONFIG_NUMA |
71 | for_each_online_node(i) | 73 | for_each_online_node(i) |
72 | register_one_node(i); | 74 | register_one_node(i); |
73 | #endif /* CONFIG_NUMA */ | 75 | #endif |
74 | 76 | ||
75 | for_each_present_cpu(i) | 77 | for_each_present_cpu(i) |
76 | arch_register_cpu(i); | 78 | arch_register_cpu(i); |
79 | |||
77 | return 0; | 80 | return 0; |
78 | } | 81 | } |
79 | |||
80 | subsys_initcall(topology_init); | 82 | subsys_initcall(topology_init); |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 55e127f71ed9..83ed74affba9 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -487,12 +487,7 @@ static int __init early_ioremap_debug_setup(char *str) | |||
487 | early_param("early_ioremap_debug", early_ioremap_debug_setup); | 487 | early_param("early_ioremap_debug", early_ioremap_debug_setup); |
488 | 488 | ||
489 | static __initdata int after_paging_init; | 489 | static __initdata int after_paging_init; |
490 | #define __FIXADDR_TOP (-PAGE_SIZE) | 490 | static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss; |
491 | static pte_t bm_pte[(__fix_to_virt(FIX_DBGP_BASE) | ||
492 | ^ __fix_to_virt(FIX_BTMAP_BEGIN)) >> PMD_SHIFT | ||
493 | ? PAGE_SIZE / sizeof(pte_t) : 0] __page_aligned_bss; | ||
494 | #undef __FIXADDR_TOP | ||
495 | static __initdata pte_t *bm_ptep; | ||
496 | 491 | ||
497 | static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) | 492 | static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) |
498 | { | 493 | { |
@@ -507,8 +502,6 @@ static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) | |||
507 | 502 | ||
508 | static inline pte_t * __init early_ioremap_pte(unsigned long addr) | 503 | static inline pte_t * __init early_ioremap_pte(unsigned long addr) |
509 | { | 504 | { |
510 | if (!sizeof(bm_pte)) | ||
511 | return &bm_ptep[pte_index(addr)]; | ||
512 | return &bm_pte[pte_index(addr)]; | 505 | return &bm_pte[pte_index(addr)]; |
513 | } | 506 | } |
514 | 507 | ||
@@ -526,14 +519,8 @@ void __init early_ioremap_init(void) | |||
526 | slot_virt[i] = fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i); | 519 | slot_virt[i] = fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i); |
527 | 520 | ||
528 | pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); | 521 | pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); |
529 | if (sizeof(bm_pte)) { | 522 | memset(bm_pte, 0, sizeof(bm_pte)); |
530 | memset(bm_pte, 0, sizeof(bm_pte)); | 523 | pmd_populate_kernel(&init_mm, pmd, bm_pte); |
531 | pmd_populate_kernel(&init_mm, pmd, bm_pte); | ||
532 | } else { | ||
533 | bm_ptep = pte_offset_kernel(pmd, 0); | ||
534 | if (early_ioremap_debug) | ||
535 | printk(KERN_INFO "bm_ptep=%p\n", bm_ptep); | ||
536 | } | ||
537 | 524 | ||
538 | /* | 525 | /* |
539 | * The boot-ioremap range spans multiple pmds, for which | 526 | * The boot-ioremap range spans multiple pmds, for which |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 1280565670e4..d71e1b636ce6 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -34,6 +34,7 @@ struct cpa_data { | |||
34 | unsigned long pfn; | 34 | unsigned long pfn; |
35 | unsigned force_split : 1; | 35 | unsigned force_split : 1; |
36 | int curpage; | 36 | int curpage; |
37 | struct page **pages; | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | /* | 40 | /* |
@@ -46,6 +47,7 @@ static DEFINE_SPINLOCK(cpa_lock); | |||
46 | 47 | ||
47 | #define CPA_FLUSHTLB 1 | 48 | #define CPA_FLUSHTLB 1 |
48 | #define CPA_ARRAY 2 | 49 | #define CPA_ARRAY 2 |
50 | #define CPA_PAGES_ARRAY 4 | ||
49 | 51 | ||
50 | #ifdef CONFIG_PROC_FS | 52 | #ifdef CONFIG_PROC_FS |
51 | static unsigned long direct_pages_count[PG_LEVEL_NUM]; | 53 | static unsigned long direct_pages_count[PG_LEVEL_NUM]; |
@@ -202,10 +204,10 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache) | |||
202 | } | 204 | } |
203 | } | 205 | } |
204 | 206 | ||
205 | static void cpa_flush_array(unsigned long *start, int numpages, int cache) | 207 | static void cpa_flush_array(unsigned long *start, int numpages, int cache, |
208 | int in_flags, struct page **pages) | ||
206 | { | 209 | { |
207 | unsigned int i, level; | 210 | unsigned int i, level; |
208 | unsigned long *addr; | ||
209 | 211 | ||
210 | BUG_ON(irqs_disabled()); | 212 | BUG_ON(irqs_disabled()); |
211 | 213 | ||
@@ -226,14 +228,22 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache) | |||
226 | * will cause all other CPUs to flush the same | 228 | * will cause all other CPUs to flush the same |
227 | * cachelines: | 229 | * cachelines: |
228 | */ | 230 | */ |
229 | for (i = 0, addr = start; i < numpages; i++, addr++) { | 231 | for (i = 0; i < numpages; i++) { |
230 | pte_t *pte = lookup_address(*addr, &level); | 232 | unsigned long addr; |
233 | pte_t *pte; | ||
234 | |||
235 | if (in_flags & CPA_PAGES_ARRAY) | ||
236 | addr = (unsigned long)page_address(pages[i]); | ||
237 | else | ||
238 | addr = start[i]; | ||
239 | |||
240 | pte = lookup_address(addr, &level); | ||
231 | 241 | ||
232 | /* | 242 | /* |
233 | * Only flush present addresses: | 243 | * Only flush present addresses: |
234 | */ | 244 | */ |
235 | if (pte && (pte_val(*pte) & _PAGE_PRESENT)) | 245 | if (pte && (pte_val(*pte) & _PAGE_PRESENT)) |
236 | clflush_cache_range((void *) *addr, PAGE_SIZE); | 246 | clflush_cache_range((void *)addr, PAGE_SIZE); |
237 | } | 247 | } |
238 | } | 248 | } |
239 | 249 | ||
@@ -585,7 +595,9 @@ static int __change_page_attr(struct cpa_data *cpa, int primary) | |||
585 | unsigned int level; | 595 | unsigned int level; |
586 | pte_t *kpte, old_pte; | 596 | pte_t *kpte, old_pte; |
587 | 597 | ||
588 | if (cpa->flags & CPA_ARRAY) | 598 | if (cpa->flags & CPA_PAGES_ARRAY) |
599 | address = (unsigned long)page_address(cpa->pages[cpa->curpage]); | ||
600 | else if (cpa->flags & CPA_ARRAY) | ||
589 | address = cpa->vaddr[cpa->curpage]; | 601 | address = cpa->vaddr[cpa->curpage]; |
590 | else | 602 | else |
591 | address = *cpa->vaddr; | 603 | address = *cpa->vaddr; |
@@ -688,7 +700,9 @@ static int cpa_process_alias(struct cpa_data *cpa) | |||
688 | * No need to redo, when the primary call touched the direct | 700 | * No need to redo, when the primary call touched the direct |
689 | * mapping already: | 701 | * mapping already: |
690 | */ | 702 | */ |
691 | if (cpa->flags & CPA_ARRAY) | 703 | if (cpa->flags & CPA_PAGES_ARRAY) |
704 | vaddr = (unsigned long)page_address(cpa->pages[cpa->curpage]); | ||
705 | else if (cpa->flags & CPA_ARRAY) | ||
692 | vaddr = cpa->vaddr[cpa->curpage]; | 706 | vaddr = cpa->vaddr[cpa->curpage]; |
693 | else | 707 | else |
694 | vaddr = *cpa->vaddr; | 708 | vaddr = *cpa->vaddr; |
@@ -699,7 +713,7 @@ static int cpa_process_alias(struct cpa_data *cpa) | |||
699 | alias_cpa = *cpa; | 713 | alias_cpa = *cpa; |
700 | temp_cpa_vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT); | 714 | temp_cpa_vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT); |
701 | alias_cpa.vaddr = &temp_cpa_vaddr; | 715 | alias_cpa.vaddr = &temp_cpa_vaddr; |
702 | alias_cpa.flags &= ~CPA_ARRAY; | 716 | alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY); |
703 | 717 | ||
704 | 718 | ||
705 | ret = __change_page_attr_set_clr(&alias_cpa, 0); | 719 | ret = __change_page_attr_set_clr(&alias_cpa, 0); |
@@ -725,7 +739,7 @@ static int cpa_process_alias(struct cpa_data *cpa) | |||
725 | alias_cpa = *cpa; | 739 | alias_cpa = *cpa; |
726 | temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) + __START_KERNEL_map - phys_base; | 740 | temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) + __START_KERNEL_map - phys_base; |
727 | alias_cpa.vaddr = &temp_cpa_vaddr; | 741 | alias_cpa.vaddr = &temp_cpa_vaddr; |
728 | alias_cpa.flags &= ~CPA_ARRAY; | 742 | alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY); |
729 | 743 | ||
730 | /* | 744 | /* |
731 | * The high mapping range is imprecise, so ignore the return value. | 745 | * The high mapping range is imprecise, so ignore the return value. |
@@ -746,7 +760,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias) | |||
746 | */ | 760 | */ |
747 | cpa->numpages = numpages; | 761 | cpa->numpages = numpages; |
748 | /* for array changes, we can't use large page */ | 762 | /* for array changes, we can't use large page */ |
749 | if (cpa->flags & CPA_ARRAY) | 763 | if (cpa->flags & (CPA_ARRAY | CPA_PAGES_ARRAY)) |
750 | cpa->numpages = 1; | 764 | cpa->numpages = 1; |
751 | 765 | ||
752 | if (!debug_pagealloc) | 766 | if (!debug_pagealloc) |
@@ -770,7 +784,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias) | |||
770 | */ | 784 | */ |
771 | BUG_ON(cpa->numpages > numpages); | 785 | BUG_ON(cpa->numpages > numpages); |
772 | numpages -= cpa->numpages; | 786 | numpages -= cpa->numpages; |
773 | if (cpa->flags & CPA_ARRAY) | 787 | if (cpa->flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) |
774 | cpa->curpage++; | 788 | cpa->curpage++; |
775 | else | 789 | else |
776 | *cpa->vaddr += cpa->numpages * PAGE_SIZE; | 790 | *cpa->vaddr += cpa->numpages * PAGE_SIZE; |
@@ -787,7 +801,8 @@ static inline int cache_attr(pgprot_t attr) | |||
787 | 801 | ||
788 | static int change_page_attr_set_clr(unsigned long *addr, int numpages, | 802 | static int change_page_attr_set_clr(unsigned long *addr, int numpages, |
789 | pgprot_t mask_set, pgprot_t mask_clr, | 803 | pgprot_t mask_set, pgprot_t mask_clr, |
790 | int force_split, int array) | 804 | int force_split, int in_flag, |
805 | struct page **pages) | ||
791 | { | 806 | { |
792 | struct cpa_data cpa; | 807 | struct cpa_data cpa; |
793 | int ret, cache, checkalias; | 808 | int ret, cache, checkalias; |
@@ -802,15 +817,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
802 | return 0; | 817 | return 0; |
803 | 818 | ||
804 | /* Ensure we are PAGE_SIZE aligned */ | 819 | /* Ensure we are PAGE_SIZE aligned */ |
805 | if (!array) { | 820 | if (in_flag & CPA_ARRAY) { |
806 | if (*addr & ~PAGE_MASK) { | ||
807 | *addr &= PAGE_MASK; | ||
808 | /* | ||
809 | * People should not be passing in unaligned addresses: | ||
810 | */ | ||
811 | WARN_ON_ONCE(1); | ||
812 | } | ||
813 | } else { | ||
814 | int i; | 821 | int i; |
815 | for (i = 0; i < numpages; i++) { | 822 | for (i = 0; i < numpages; i++) { |
816 | if (addr[i] & ~PAGE_MASK) { | 823 | if (addr[i] & ~PAGE_MASK) { |
@@ -818,6 +825,18 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
818 | WARN_ON_ONCE(1); | 825 | WARN_ON_ONCE(1); |
819 | } | 826 | } |
820 | } | 827 | } |
828 | } else if (!(in_flag & CPA_PAGES_ARRAY)) { | ||
829 | /* | ||
830 | * in_flag of CPA_PAGES_ARRAY implies it is aligned. | ||
831 | * No need to cehck in that case | ||
832 | */ | ||
833 | if (*addr & ~PAGE_MASK) { | ||
834 | *addr &= PAGE_MASK; | ||
835 | /* | ||
836 | * People should not be passing in unaligned addresses: | ||
837 | */ | ||
838 | WARN_ON_ONCE(1); | ||
839 | } | ||
821 | } | 840 | } |
822 | 841 | ||
823 | /* Must avoid aliasing mappings in the highmem code */ | 842 | /* Must avoid aliasing mappings in the highmem code */ |
@@ -833,6 +852,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
833 | arch_flush_lazy_mmu_mode(); | 852 | arch_flush_lazy_mmu_mode(); |
834 | 853 | ||
835 | cpa.vaddr = addr; | 854 | cpa.vaddr = addr; |
855 | cpa.pages = pages; | ||
836 | cpa.numpages = numpages; | 856 | cpa.numpages = numpages; |
837 | cpa.mask_set = mask_set; | 857 | cpa.mask_set = mask_set; |
838 | cpa.mask_clr = mask_clr; | 858 | cpa.mask_clr = mask_clr; |
@@ -840,8 +860,8 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
840 | cpa.curpage = 0; | 860 | cpa.curpage = 0; |
841 | cpa.force_split = force_split; | 861 | cpa.force_split = force_split; |
842 | 862 | ||
843 | if (array) | 863 | if (in_flag & (CPA_ARRAY | CPA_PAGES_ARRAY)) |
844 | cpa.flags |= CPA_ARRAY; | 864 | cpa.flags |= in_flag; |
845 | 865 | ||
846 | /* No alias checking for _NX bit modifications */ | 866 | /* No alias checking for _NX bit modifications */ |
847 | checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX; | 867 | checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX; |
@@ -867,9 +887,10 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
867 | * wbindv): | 887 | * wbindv): |
868 | */ | 888 | */ |
869 | if (!ret && cpu_has_clflush) { | 889 | if (!ret && cpu_has_clflush) { |
870 | if (cpa.flags & CPA_ARRAY) | 890 | if (cpa.flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) { |
871 | cpa_flush_array(addr, numpages, cache); | 891 | cpa_flush_array(addr, numpages, cache, |
872 | else | 892 | cpa.flags, pages); |
893 | } else | ||
873 | cpa_flush_range(*addr, numpages, cache); | 894 | cpa_flush_range(*addr, numpages, cache); |
874 | } else | 895 | } else |
875 | cpa_flush_all(cache); | 896 | cpa_flush_all(cache); |
@@ -889,14 +910,28 @@ static inline int change_page_attr_set(unsigned long *addr, int numpages, | |||
889 | pgprot_t mask, int array) | 910 | pgprot_t mask, int array) |
890 | { | 911 | { |
891 | return change_page_attr_set_clr(addr, numpages, mask, __pgprot(0), 0, | 912 | return change_page_attr_set_clr(addr, numpages, mask, __pgprot(0), 0, |
892 | array); | 913 | (array ? CPA_ARRAY : 0), NULL); |
893 | } | 914 | } |
894 | 915 | ||
895 | static inline int change_page_attr_clear(unsigned long *addr, int numpages, | 916 | static inline int change_page_attr_clear(unsigned long *addr, int numpages, |
896 | pgprot_t mask, int array) | 917 | pgprot_t mask, int array) |
897 | { | 918 | { |
898 | return change_page_attr_set_clr(addr, numpages, __pgprot(0), mask, 0, | 919 | return change_page_attr_set_clr(addr, numpages, __pgprot(0), mask, 0, |
899 | array); | 920 | (array ? CPA_ARRAY : 0), NULL); |
921 | } | ||
922 | |||
923 | static inline int cpa_set_pages_array(struct page **pages, int numpages, | ||
924 | pgprot_t mask) | ||
925 | { | ||
926 | return change_page_attr_set_clr(NULL, numpages, mask, __pgprot(0), 0, | ||
927 | CPA_PAGES_ARRAY, pages); | ||
928 | } | ||
929 | |||
930 | static inline int cpa_clear_pages_array(struct page **pages, int numpages, | ||
931 | pgprot_t mask) | ||
932 | { | ||
933 | return change_page_attr_set_clr(NULL, numpages, __pgprot(0), mask, 0, | ||
934 | CPA_PAGES_ARRAY, pages); | ||
900 | } | 935 | } |
901 | 936 | ||
902 | int _set_memory_uc(unsigned long addr, int numpages) | 937 | int _set_memory_uc(unsigned long addr, int numpages) |
@@ -1044,7 +1079,7 @@ int set_memory_np(unsigned long addr, int numpages) | |||
1044 | int set_memory_4k(unsigned long addr, int numpages) | 1079 | int set_memory_4k(unsigned long addr, int numpages) |
1045 | { | 1080 | { |
1046 | return change_page_attr_set_clr(&addr, numpages, __pgprot(0), | 1081 | return change_page_attr_set_clr(&addr, numpages, __pgprot(0), |
1047 | __pgprot(0), 1, 0); | 1082 | __pgprot(0), 1, 0, NULL); |
1048 | } | 1083 | } |
1049 | 1084 | ||
1050 | int set_pages_uc(struct page *page, int numpages) | 1085 | int set_pages_uc(struct page *page, int numpages) |
@@ -1055,6 +1090,35 @@ int set_pages_uc(struct page *page, int numpages) | |||
1055 | } | 1090 | } |
1056 | EXPORT_SYMBOL(set_pages_uc); | 1091 | EXPORT_SYMBOL(set_pages_uc); |
1057 | 1092 | ||
1093 | int set_pages_array_uc(struct page **pages, int addrinarray) | ||
1094 | { | ||
1095 | unsigned long start; | ||
1096 | unsigned long end; | ||
1097 | int i; | ||
1098 | int free_idx; | ||
1099 | |||
1100 | for (i = 0; i < addrinarray; i++) { | ||
1101 | start = (unsigned long)page_address(pages[i]); | ||
1102 | end = start + PAGE_SIZE; | ||
1103 | if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL)) | ||
1104 | goto err_out; | ||
1105 | } | ||
1106 | |||
1107 | if (cpa_set_pages_array(pages, addrinarray, | ||
1108 | __pgprot(_PAGE_CACHE_UC_MINUS)) == 0) { | ||
1109 | return 0; /* Success */ | ||
1110 | } | ||
1111 | err_out: | ||
1112 | free_idx = i; | ||
1113 | for (i = 0; i < free_idx; i++) { | ||
1114 | start = (unsigned long)page_address(pages[i]); | ||
1115 | end = start + PAGE_SIZE; | ||
1116 | free_memtype(start, end); | ||
1117 | } | ||
1118 | return -EINVAL; | ||
1119 | } | ||
1120 | EXPORT_SYMBOL(set_pages_array_uc); | ||
1121 | |||
1058 | int set_pages_wb(struct page *page, int numpages) | 1122 | int set_pages_wb(struct page *page, int numpages) |
1059 | { | 1123 | { |
1060 | unsigned long addr = (unsigned long)page_address(page); | 1124 | unsigned long addr = (unsigned long)page_address(page); |
@@ -1063,6 +1127,26 @@ int set_pages_wb(struct page *page, int numpages) | |||
1063 | } | 1127 | } |
1064 | EXPORT_SYMBOL(set_pages_wb); | 1128 | EXPORT_SYMBOL(set_pages_wb); |
1065 | 1129 | ||
1130 | int set_pages_array_wb(struct page **pages, int addrinarray) | ||
1131 | { | ||
1132 | int retval; | ||
1133 | unsigned long start; | ||
1134 | unsigned long end; | ||
1135 | int i; | ||
1136 | |||
1137 | retval = cpa_clear_pages_array(pages, addrinarray, | ||
1138 | __pgprot(_PAGE_CACHE_MASK)); | ||
1139 | |||
1140 | for (i = 0; i < addrinarray; i++) { | ||
1141 | start = (unsigned long)page_address(pages[i]); | ||
1142 | end = start + PAGE_SIZE; | ||
1143 | free_memtype(start, end); | ||
1144 | } | ||
1145 | |||
1146 | return retval; | ||
1147 | } | ||
1148 | EXPORT_SYMBOL(set_pages_array_wb); | ||
1149 | |||
1066 | int set_pages_x(struct page *page, int numpages) | 1150 | int set_pages_x(struct page *page, int numpages) |
1067 | { | 1151 | { |
1068 | unsigned long addr = (unsigned long)page_address(page); | 1152 | unsigned long addr = (unsigned long)page_address(page); |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 5ead808dd70c..f234a37bd428 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -319,6 +319,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
319 | return -EINVAL; | 319 | return -EINVAL; |
320 | } | 320 | } |
321 | flags = new_flags; | 321 | flags = new_flags; |
322 | vma->vm_page_prot = __pgprot( | ||
323 | (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK) | | ||
324 | flags); | ||
322 | } | 325 | } |
323 | 326 | ||
324 | if (((vma->vm_pgoff < max_low_pfn_mapped) || | 327 | if (((vma->vm_pgoff < max_low_pfn_mapped) || |
diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c index bb538b9690e0..ee916c9857ee 100644 --- a/drivers/dca/dca-sysfs.c +++ b/drivers/dca/dca-sysfs.c | |||
@@ -1,3 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the Free | ||
6 | * Software Foundation; either version 2 of the License, or (at your option) | ||
7 | * any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 | ||
16 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | ||
19 | * file called COPYING. | ||
20 | */ | ||
21 | |||
1 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
2 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
3 | #include <linux/device.h> | 24 | #include <linux/device.h> |
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index 18dd8aacbe8d..831ddce1467b 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c | |||
@@ -46,6 +46,9 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode"); | |||
46 | /* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ | 46 | /* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ |
47 | #define IF_WRITEBUF 264 | 47 | #define IF_WRITEBUF 264 |
48 | 48 | ||
49 | /* interrupt pipe message size according to ibid. ch. 2.2 */ | ||
50 | #define IP_MSGSIZE 3 | ||
51 | |||
49 | /* Values for the Gigaset 307x */ | 52 | /* Values for the Gigaset 307x */ |
50 | #define USB_GIGA_VENDOR_ID 0x0681 | 53 | #define USB_GIGA_VENDOR_ID 0x0681 |
51 | #define USB_3070_PRODUCT_ID 0x0001 | 54 | #define USB_3070_PRODUCT_ID 0x0001 |
@@ -110,7 +113,7 @@ struct bas_cardstate { | |||
110 | unsigned char *rcvbuf; /* AT reply receive buffer */ | 113 | unsigned char *rcvbuf; /* AT reply receive buffer */ |
111 | 114 | ||
112 | struct urb *urb_int_in; /* URB for interrupt pipe */ | 115 | struct urb *urb_int_in; /* URB for interrupt pipe */ |
113 | unsigned char int_in_buf[3]; | 116 | unsigned char *int_in_buf; |
114 | 117 | ||
115 | spinlock_t lock; /* locks all following */ | 118 | spinlock_t lock; /* locks all following */ |
116 | int basstate; /* bitmap (BS_*) */ | 119 | int basstate; /* bitmap (BS_*) */ |
@@ -657,7 +660,7 @@ static void read_int_callback(struct urb *urb) | |||
657 | } | 660 | } |
658 | 661 | ||
659 | /* drop incomplete packets even if the missing bytes wouldn't matter */ | 662 | /* drop incomplete packets even if the missing bytes wouldn't matter */ |
660 | if (unlikely(urb->actual_length < 3)) { | 663 | if (unlikely(urb->actual_length < IP_MSGSIZE)) { |
661 | dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n", | 664 | dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n", |
662 | urb->actual_length); | 665 | urb->actual_length); |
663 | goto resubmit; | 666 | goto resubmit; |
@@ -2127,6 +2130,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs) | |||
2127 | static void gigaset_freecshw(struct cardstate *cs) | 2130 | static void gigaset_freecshw(struct cardstate *cs) |
2128 | { | 2131 | { |
2129 | /* timers, URBs and rcvbuf are disposed of in disconnect */ | 2132 | /* timers, URBs and rcvbuf are disposed of in disconnect */ |
2133 | kfree(cs->hw.bas->int_in_buf); | ||
2130 | kfree(cs->hw.bas); | 2134 | kfree(cs->hw.bas); |
2131 | cs->hw.bas = NULL; | 2135 | cs->hw.bas = NULL; |
2132 | } | 2136 | } |
@@ -2140,6 +2144,12 @@ static int gigaset_initcshw(struct cardstate *cs) | |||
2140 | pr_err("out of memory\n"); | 2144 | pr_err("out of memory\n"); |
2141 | return 0; | 2145 | return 0; |
2142 | } | 2146 | } |
2147 | ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL); | ||
2148 | if (!ucs->int_in_buf) { | ||
2149 | kfree(ucs); | ||
2150 | pr_err("out of memory\n"); | ||
2151 | return 0; | ||
2152 | } | ||
2143 | 2153 | ||
2144 | ucs->urb_cmd_in = NULL; | 2154 | ucs->urb_cmd_in = NULL; |
2145 | ucs->urb_cmd_out = NULL; | 2155 | ucs->urb_cmd_out = NULL; |
@@ -2292,7 +2302,7 @@ static int gigaset_probe(struct usb_interface *interface, | |||
2292 | usb_fill_int_urb(ucs->urb_int_in, udev, | 2302 | usb_fill_int_urb(ucs->urb_int_in, udev, |
2293 | usb_rcvintpipe(udev, | 2303 | usb_rcvintpipe(udev, |
2294 | (endpoint->bEndpointAddress) & 0x0f), | 2304 | (endpoint->bEndpointAddress) & 0x0f), |
2295 | ucs->int_in_buf, 3, read_int_callback, cs, | 2305 | ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs, |
2296 | endpoint->bInterval); | 2306 | endpoint->bInterval); |
2297 | if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) { | 2307 | if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) { |
2298 | dev_err(cs->dev, "could not submit interrupt URB: %s\n", | 2308 | dev_err(cs->dev, "could not submit interrupt URB: %s\n", |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 435e2e3a82c8..62d732a886f1 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1042,7 +1042,7 @@ config NI65 | |||
1042 | 1042 | ||
1043 | config DNET | 1043 | config DNET |
1044 | tristate "Dave ethernet support (DNET)" | 1044 | tristate "Dave ethernet support (DNET)" |
1045 | depends on NET_ETHERNET | 1045 | depends on NET_ETHERNET && HAS_IOMEM |
1046 | select PHYLIB | 1046 | select PHYLIB |
1047 | help | 1047 | help |
1048 | The Dave ethernet interface (DNET) is found on Qong Board FPGA. | 1048 | The Dave ethernet interface (DNET) is found on Qong Board FPGA. |
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 63d593d53153..f327be57ca96 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -194,6 +194,7 @@ struct be_adapter { | |||
194 | struct be_eq_obj rx_eq; | 194 | struct be_eq_obj rx_eq; |
195 | struct be_rx_obj rx_obj; | 195 | struct be_rx_obj rx_obj; |
196 | u32 big_page_size; /* Compounded page size shared by rx wrbs */ | 196 | u32 big_page_size; /* Compounded page size shared by rx wrbs */ |
197 | bool rx_post_starved; /* Zero rx frags have been posted to BE */ | ||
197 | 198 | ||
198 | struct vlan_group *vlan_grp; | 199 | struct vlan_group *vlan_grp; |
199 | u16 num_vlans; | 200 | u16 num_vlans; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 897a63de5bdb..0ecaffb70e58 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -273,26 +273,6 @@ static void be_rx_eqd_update(struct be_adapter *adapter) | |||
273 | rx_eq->cur_eqd = eqd; | 273 | rx_eq->cur_eqd = eqd; |
274 | } | 274 | } |
275 | 275 | ||
276 | static void be_worker(struct work_struct *work) | ||
277 | { | ||
278 | struct be_adapter *adapter = | ||
279 | container_of(work, struct be_adapter, work.work); | ||
280 | int status; | ||
281 | |||
282 | /* Check link */ | ||
283 | be_link_status_update(adapter); | ||
284 | |||
285 | /* Get Stats */ | ||
286 | status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd); | ||
287 | if (!status) | ||
288 | netdev_stats_update(adapter); | ||
289 | |||
290 | /* Set EQ delay */ | ||
291 | be_rx_eqd_update(adapter); | ||
292 | |||
293 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); | ||
294 | } | ||
295 | |||
296 | static struct net_device_stats *be_get_stats(struct net_device *dev) | 276 | static struct net_device_stats *be_get_stats(struct net_device *dev) |
297 | { | 277 | { |
298 | struct be_adapter *adapter = netdev_priv(dev); | 278 | struct be_adapter *adapter = netdev_priv(dev); |
@@ -493,7 +473,7 @@ static int be_change_mtu(struct net_device *netdev, int new_mtu) | |||
493 | * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured, | 473 | * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured, |
494 | * set the BE in promiscuous VLAN mode. | 474 | * set the BE in promiscuous VLAN mode. |
495 | */ | 475 | */ |
496 | static void be_vids_config(struct net_device *netdev) | 476 | static void be_vid_config(struct net_device *netdev) |
497 | { | 477 | { |
498 | struct be_adapter *adapter = netdev_priv(netdev); | 478 | struct be_adapter *adapter = netdev_priv(netdev); |
499 | u16 vtag[BE_NUM_VLANS_SUPPORTED]; | 479 | u16 vtag[BE_NUM_VLANS_SUPPORTED]; |
@@ -536,7 +516,7 @@ static void be_vlan_add_vid(struct net_device *netdev, u16 vid) | |||
536 | adapter->num_vlans++; | 516 | adapter->num_vlans++; |
537 | adapter->vlan_tag[vid] = 1; | 517 | adapter->vlan_tag[vid] = 1; |
538 | 518 | ||
539 | be_vids_config(netdev); | 519 | be_vid_config(netdev); |
540 | } | 520 | } |
541 | 521 | ||
542 | static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) | 522 | static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) |
@@ -547,7 +527,7 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) | |||
547 | adapter->vlan_tag[vid] = 0; | 527 | adapter->vlan_tag[vid] = 0; |
548 | 528 | ||
549 | vlan_group_set_device(adapter->vlan_grp, vid, NULL); | 529 | vlan_group_set_device(adapter->vlan_grp, vid, NULL); |
550 | be_vids_config(netdev); | 530 | be_vid_config(netdev); |
551 | } | 531 | } |
552 | 532 | ||
553 | static void be_set_multicast_filter(struct net_device *netdev) | 533 | static void be_set_multicast_filter(struct net_device *netdev) |
@@ -900,8 +880,11 @@ static void be_post_rx_frags(struct be_adapter *adapter) | |||
900 | page_info->last_page_user = true; | 880 | page_info->last_page_user = true; |
901 | 881 | ||
902 | if (posted) { | 882 | if (posted) { |
903 | be_rxq_notify(&adapter->ctrl, rxq->id, posted); | ||
904 | atomic_add(posted, &rxq->used); | 883 | atomic_add(posted, &rxq->used); |
884 | be_rxq_notify(&adapter->ctrl, rxq->id, posted); | ||
885 | } else if (atomic_read(&rxq->used) == 0) { | ||
886 | /* Let be_worker replenish when memory is available */ | ||
887 | adapter->rx_post_starved = true; | ||
905 | } | 888 | } |
906 | 889 | ||
907 | return; | 890 | return; |
@@ -1305,6 +1288,31 @@ int be_poll_tx(struct napi_struct *napi, int budget) | |||
1305 | return 1; | 1288 | return 1; |
1306 | } | 1289 | } |
1307 | 1290 | ||
1291 | static void be_worker(struct work_struct *work) | ||
1292 | { | ||
1293 | struct be_adapter *adapter = | ||
1294 | container_of(work, struct be_adapter, work.work); | ||
1295 | int status; | ||
1296 | |||
1297 | /* Check link */ | ||
1298 | be_link_status_update(adapter); | ||
1299 | |||
1300 | /* Get Stats */ | ||
1301 | status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd); | ||
1302 | if (!status) | ||
1303 | netdev_stats_update(adapter); | ||
1304 | |||
1305 | /* Set EQ delay */ | ||
1306 | be_rx_eqd_update(adapter); | ||
1307 | |||
1308 | if (adapter->rx_post_starved) { | ||
1309 | adapter->rx_post_starved = false; | ||
1310 | be_post_rx_frags(adapter); | ||
1311 | } | ||
1312 | |||
1313 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); | ||
1314 | } | ||
1315 | |||
1308 | static void be_msix_enable(struct be_adapter *adapter) | 1316 | static void be_msix_enable(struct be_adapter *adapter) |
1309 | { | 1317 | { |
1310 | int i, status; | 1318 | int i, status; |
@@ -1422,6 +1430,8 @@ static int be_open(struct net_device *netdev) | |||
1422 | if (status != 0) | 1430 | if (status != 0) |
1423 | goto do_none; | 1431 | goto do_none; |
1424 | 1432 | ||
1433 | be_vid_config(netdev); | ||
1434 | |||
1425 | status = be_cmd_set_flow_control(ctrl, true, true); | 1435 | status = be_cmd_set_flow_control(ctrl, true, true); |
1426 | if (status != 0) | 1436 | if (status != 0) |
1427 | goto if_destroy; | 1437 | goto if_destroy; |
@@ -1856,8 +1866,6 @@ static int be_resume(struct pci_dev *pdev) | |||
1856 | pci_set_power_state(pdev, 0); | 1866 | pci_set_power_state(pdev, 0); |
1857 | pci_restore_state(pdev); | 1867 | pci_restore_state(pdev); |
1858 | 1868 | ||
1859 | be_vids_config(netdev); | ||
1860 | |||
1861 | if (netif_running(netdev)) { | 1869 | if (netif_running(netdev)) { |
1862 | rtnl_lock(); | 1870 | rtnl_lock(); |
1863 | be_open(netdev); | 1871 | be_open(netdev); |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 6500b7c4739f..6b6530ffdf19 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -57,8 +57,8 @@ | |||
57 | 57 | ||
58 | #define DRV_MODULE_NAME "bnx2" | 58 | #define DRV_MODULE_NAME "bnx2" |
59 | #define PFX DRV_MODULE_NAME ": " | 59 | #define PFX DRV_MODULE_NAME ": " |
60 | #define DRV_MODULE_VERSION "1.9.2" | 60 | #define DRV_MODULE_VERSION "1.9.3" |
61 | #define DRV_MODULE_RELDATE "Feb 11, 2009" | 61 | #define DRV_MODULE_RELDATE "March 17, 2009" |
62 | 62 | ||
63 | #define RUN_AT(x) (jiffies + (x)) | 63 | #define RUN_AT(x) (jiffies + (x)) |
64 | 64 | ||
@@ -5843,9 +5843,6 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs) | |||
5843 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) { | 5843 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) { |
5844 | msix_ent[i].entry = i; | 5844 | msix_ent[i].entry = i; |
5845 | msix_ent[i].vector = 0; | 5845 | msix_ent[i].vector = 0; |
5846 | |||
5847 | snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i); | ||
5848 | bp->irq_tbl[i].handler = bnx2_msi_1shot; | ||
5849 | } | 5846 | } |
5850 | 5847 | ||
5851 | rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC); | 5848 | rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC); |
@@ -5854,8 +5851,11 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs) | |||
5854 | 5851 | ||
5855 | bp->irq_nvecs = msix_vecs; | 5852 | bp->irq_nvecs = msix_vecs; |
5856 | bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI; | 5853 | bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI; |
5857 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) | 5854 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) { |
5858 | bp->irq_tbl[i].vector = msix_ent[i].vector; | 5855 | bp->irq_tbl[i].vector = msix_ent[i].vector; |
5856 | snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i); | ||
5857 | bp->irq_tbl[i].handler = bnx2_msi_1shot; | ||
5858 | } | ||
5859 | } | 5859 | } |
5860 | 5860 | ||
5861 | static void | 5861 | static void |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e0578fe8c0db..3d76686dceca 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3537,11 +3537,26 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave | |||
3537 | } | 3537 | } |
3538 | break; | 3538 | break; |
3539 | case NETDEV_CHANGE: | 3539 | case NETDEV_CHANGE: |
3540 | /* | 3540 | if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) { |
3541 | * TODO: is this what we get if somebody | 3541 | struct slave *slave; |
3542 | * sets up a hierarchical bond, then rmmod's | 3542 | |
3543 | * one of the slave bonding devices? | 3543 | slave = bond_get_slave_by_dev(bond, slave_dev); |
3544 | */ | 3544 | if (slave) { |
3545 | u16 old_speed = slave->speed; | ||
3546 | u16 old_duplex = slave->duplex; | ||
3547 | |||
3548 | bond_update_speed_duplex(slave); | ||
3549 | |||
3550 | if (bond_is_lb(bond)) | ||
3551 | break; | ||
3552 | |||
3553 | if (old_speed != slave->speed) | ||
3554 | bond_3ad_adapter_speed_changed(slave); | ||
3555 | if (old_duplex != slave->duplex) | ||
3556 | bond_3ad_adapter_duplex_changed(slave); | ||
3557 | } | ||
3558 | } | ||
3559 | |||
3545 | break; | 3560 | break; |
3546 | case NETDEV_DOWN: | 3561 | case NETDEV_DOWN: |
3547 | /* | 3562 | /* |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index bcf92917bbf3..254ec62b5f58 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -930,13 +930,15 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id) | |||
930 | struct net_device *dev = dev_id; | 930 | struct net_device *dev = dev_id; |
931 | board_info_t *db = netdev_priv(dev); | 931 | board_info_t *db = netdev_priv(dev); |
932 | int int_status; | 932 | int int_status; |
933 | unsigned long flags; | ||
933 | u8 reg_save; | 934 | u8 reg_save; |
934 | 935 | ||
935 | dm9000_dbg(db, 3, "entering %s\n", __func__); | 936 | dm9000_dbg(db, 3, "entering %s\n", __func__); |
936 | 937 | ||
937 | /* A real interrupt coming */ | 938 | /* A real interrupt coming */ |
938 | 939 | ||
939 | spin_lock(&db->lock); | 940 | /* holders of db->lock must always block IRQs */ |
941 | spin_lock_irqsave(&db->lock, flags); | ||
940 | 942 | ||
941 | /* Save previous register address */ | 943 | /* Save previous register address */ |
942 | reg_save = readb(db->io_addr); | 944 | reg_save = readb(db->io_addr); |
@@ -972,7 +974,7 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id) | |||
972 | /* Restore previous register address */ | 974 | /* Restore previous register address */ |
973 | writeb(reg_save, db->io_addr); | 975 | writeb(reg_save, db->io_addr); |
974 | 976 | ||
975 | spin_unlock(&db->lock); | 977 | spin_unlock_irqrestore(&db->lock, flags); |
976 | 978 | ||
977 | return IRQ_HANDLED; | 979 | return IRQ_HANDLED; |
978 | } | 980 | } |
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index 5c347f70cb67..1b4063222a82 100644 --- a/drivers/net/dnet.c +++ b/drivers/net/dnet.c | |||
@@ -280,11 +280,11 @@ static int dnet_mii_probe(struct net_device *dev) | |||
280 | 280 | ||
281 | /* attach the mac to the phy */ | 281 | /* attach the mac to the phy */ |
282 | if (bp->capabilities & DNET_HAS_RMII) { | 282 | if (bp->capabilities & DNET_HAS_RMII) { |
283 | phydev = phy_connect(dev, phydev->dev.bus_id, | 283 | phydev = phy_connect(dev, dev_name(&phydev->dev), |
284 | &dnet_handle_link_change, 0, | 284 | &dnet_handle_link_change, 0, |
285 | PHY_INTERFACE_MODE_RMII); | 285 | PHY_INTERFACE_MODE_RMII); |
286 | } else { | 286 | } else { |
287 | phydev = phy_connect(dev, phydev->dev.bus_id, | 287 | phydev = phy_connect(dev, dev_name(&phydev->dev), |
288 | &dnet_handle_link_change, 0, | 288 | &dnet_handle_link_change, 0, |
289 | PHY_INTERFACE_MODE_MII); | 289 | PHY_INTERFACE_MODE_MII); |
290 | } | 290 | } |
@@ -927,7 +927,7 @@ static int __devinit dnet_probe(struct platform_device *pdev) | |||
927 | phydev = bp->phy_dev; | 927 | phydev = bp->phy_dev; |
928 | dev_info(&pdev->dev, "attached PHY driver [%s] " | 928 | dev_info(&pdev->dev, "attached PHY driver [%s] " |
929 | "(mii_bus:phy_addr=%s, irq=%d)\n", | 929 | "(mii_bus:phy_addr=%s, irq=%d)\n", |
930 | phydev->drv->name, phydev->dev.bus_id, phydev->irq); | 930 | phydev->drv->name, dev_name(&phydev->dev), phydev->irq); |
931 | 931 | ||
932 | return 0; | 932 | return 0; |
933 | 933 | ||
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 7f8e514eb5e9..7b1882765a0c 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -687,6 +687,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
687 | { | 687 | { |
688 | struct net_device *ndev = netdev; | 688 | struct net_device *ndev = netdev; |
689 | struct sh_eth_private *mdp = netdev_priv(ndev); | 689 | struct sh_eth_private *mdp = netdev_priv(ndev); |
690 | irqreturn_t ret = IRQ_NONE; | ||
690 | u32 ioaddr, boguscnt = RX_RING_SIZE; | 691 | u32 ioaddr, boguscnt = RX_RING_SIZE; |
691 | u32 intr_status = 0; | 692 | u32 intr_status = 0; |
692 | 693 | ||
@@ -696,7 +697,13 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
696 | /* Get interrpt stat */ | 697 | /* Get interrpt stat */ |
697 | intr_status = ctrl_inl(ioaddr + EESR); | 698 | intr_status = ctrl_inl(ioaddr + EESR); |
698 | /* Clear interrupt */ | 699 | /* Clear interrupt */ |
699 | ctrl_outl(intr_status, ioaddr + EESR); | 700 | if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF | |
701 | EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF | | ||
702 | TX_CHECK | EESR_ERR_CHECK)) { | ||
703 | ctrl_outl(intr_status, ioaddr + EESR); | ||
704 | ret = IRQ_HANDLED; | ||
705 | } else | ||
706 | goto other_irq; | ||
700 | 707 | ||
701 | if (intr_status & (EESR_FRC | /* Frame recv*/ | 708 | if (intr_status & (EESR_FRC | /* Frame recv*/ |
702 | EESR_RMAF | /* Multi cast address recv*/ | 709 | EESR_RMAF | /* Multi cast address recv*/ |
@@ -723,9 +730,10 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
723 | ndev->name, intr_status); | 730 | ndev->name, intr_status); |
724 | } | 731 | } |
725 | 732 | ||
733 | other_irq: | ||
726 | spin_unlock(&mdp->lock); | 734 | spin_unlock(&mdp->lock); |
727 | 735 | ||
728 | return IRQ_HANDLED; | 736 | return ret; |
729 | } | 737 | } |
730 | 738 | ||
731 | static void sh_eth_timer(unsigned long data) | 739 | static void sh_eth_timer(unsigned long data) |
@@ -844,7 +852,13 @@ static int sh_eth_open(struct net_device *ndev) | |||
844 | int ret = 0; | 852 | int ret = 0; |
845 | struct sh_eth_private *mdp = netdev_priv(ndev); | 853 | struct sh_eth_private *mdp = netdev_priv(ndev); |
846 | 854 | ||
847 | ret = request_irq(ndev->irq, &sh_eth_interrupt, 0, ndev->name, ndev); | 855 | ret = request_irq(ndev->irq, &sh_eth_interrupt, |
856 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) || defined(CONFIG_CPU_SUBTYPE_SH7764) | ||
857 | IRQF_SHARED, | ||
858 | #else | ||
859 | 0, | ||
860 | #endif | ||
861 | ndev->name, ndev); | ||
848 | if (ret) { | 862 | if (ret) { |
849 | printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME); | 863 | printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME); |
850 | return ret; | 864 | return ret; |
diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h index 73bc7181cc18..1537e13e623d 100644 --- a/drivers/net/sh_eth.h +++ b/drivers/net/sh_eth.h | |||
@@ -43,8 +43,8 @@ | |||
43 | 43 | ||
44 | #define SH7763_SKB_ALIGN 32 | 44 | #define SH7763_SKB_ALIGN 32 |
45 | /* Chip Base Address */ | 45 | /* Chip Base Address */ |
46 | # define SH_TSU_ADDR 0xFFE01800 | 46 | # define SH_TSU_ADDR 0xFEE01800 |
47 | # define ARSTR 0xFFE01800 | 47 | # define ARSTR SH_TSU_ADDR |
48 | 48 | ||
49 | /* Chip Registers */ | 49 | /* Chip Registers */ |
50 | /* E-DMAC */ | 50 | /* E-DMAC */ |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 9a78daec2fe9..d1590ac55e4b 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -1225,6 +1225,10 @@ static int smsc911x_open(struct net_device *dev) | |||
1225 | dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n", | 1225 | dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n", |
1226 | (unsigned long)pdata->ioaddr, dev->irq); | 1226 | (unsigned long)pdata->ioaddr, dev->irq); |
1227 | 1227 | ||
1228 | /* Reset the last known duplex and carrier */ | ||
1229 | pdata->last_duplex = -1; | ||
1230 | pdata->last_carrier = -1; | ||
1231 | |||
1228 | /* Bring the PHY up */ | 1232 | /* Bring the PHY up */ |
1229 | phy_start(pdata->phy_dev); | 1233 | phy_start(pdata->phy_dev); |
1230 | 1234 | ||
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 0fcb7503363d..c9c7650826c0 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -2998,8 +2998,11 @@ static const struct net_device_ops gem_netdev_ops = { | |||
2998 | .ndo_do_ioctl = gem_ioctl, | 2998 | .ndo_do_ioctl = gem_ioctl, |
2999 | .ndo_tx_timeout = gem_tx_timeout, | 2999 | .ndo_tx_timeout = gem_tx_timeout, |
3000 | .ndo_change_mtu = gem_change_mtu, | 3000 | .ndo_change_mtu = gem_change_mtu, |
3001 | .ndo_set_mac_address = eth_mac_addr, | ||
3002 | .ndo_validate_addr = eth_validate_addr, | 3001 | .ndo_validate_addr = eth_validate_addr, |
3002 | .ndo_set_mac_address = gem_set_mac_address, | ||
3003 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
3004 | .ndo_poll_controller = gem_poll_controller, | ||
3005 | #endif | ||
3003 | }; | 3006 | }; |
3004 | 3007 | ||
3005 | static int __devinit gem_init_one(struct pci_dev *pdev, | 3008 | static int __devinit gem_init_one(struct pci_dev *pdev, |
@@ -3161,10 +3164,6 @@ static int __devinit gem_init_one(struct pci_dev *pdev, | |||
3161 | dev->watchdog_timeo = 5 * HZ; | 3164 | dev->watchdog_timeo = 5 * HZ; |
3162 | dev->irq = pdev->irq; | 3165 | dev->irq = pdev->irq; |
3163 | dev->dma = 0; | 3166 | dev->dma = 0; |
3164 | dev->set_mac_address = gem_set_mac_address; | ||
3165 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
3166 | dev->poll_controller = gem_poll_controller; | ||
3167 | #endif | ||
3168 | 3167 | ||
3169 | /* Set that now, in case PM kicks in now */ | 3168 | /* Set that now, in case PM kicks in now */ |
3170 | pci_set_drvdata(pdev, dev); | 3169 | pci_set_drvdata(pdev, dev); |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index bee75fa87a9c..2abb5d3becc6 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -255,6 +255,7 @@ const char tulip_media_cap[32] = | |||
255 | 255 | ||
256 | static void tulip_tx_timeout(struct net_device *dev); | 256 | static void tulip_tx_timeout(struct net_device *dev); |
257 | static void tulip_init_ring(struct net_device *dev); | 257 | static void tulip_init_ring(struct net_device *dev); |
258 | static void tulip_free_ring(struct net_device *dev); | ||
258 | static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev); | 259 | static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev); |
259 | static int tulip_open(struct net_device *dev); | 260 | static int tulip_open(struct net_device *dev); |
260 | static int tulip_close(struct net_device *dev); | 261 | static int tulip_close(struct net_device *dev); |
@@ -502,16 +503,21 @@ tulip_open(struct net_device *dev) | |||
502 | { | 503 | { |
503 | int retval; | 504 | int retval; |
504 | 505 | ||
505 | if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) | ||
506 | return retval; | ||
507 | |||
508 | tulip_init_ring (dev); | 506 | tulip_init_ring (dev); |
509 | 507 | ||
508 | retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev); | ||
509 | if (retval) | ||
510 | goto free_ring; | ||
511 | |||
510 | tulip_up (dev); | 512 | tulip_up (dev); |
511 | 513 | ||
512 | netif_start_queue (dev); | 514 | netif_start_queue (dev); |
513 | 515 | ||
514 | return 0; | 516 | return 0; |
517 | |||
518 | free_ring: | ||
519 | tulip_free_ring (dev); | ||
520 | return retval; | ||
515 | } | 521 | } |
516 | 522 | ||
517 | 523 | ||
@@ -768,23 +774,11 @@ static void tulip_down (struct net_device *dev) | |||
768 | tulip_set_power_state (tp, 0, 1); | 774 | tulip_set_power_state (tp, 0, 1); |
769 | } | 775 | } |
770 | 776 | ||
771 | 777 | static void tulip_free_ring (struct net_device *dev) | |
772 | static int tulip_close (struct net_device *dev) | ||
773 | { | 778 | { |
774 | struct tulip_private *tp = netdev_priv(dev); | 779 | struct tulip_private *tp = netdev_priv(dev); |
775 | void __iomem *ioaddr = tp->base_addr; | ||
776 | int i; | 780 | int i; |
777 | 781 | ||
778 | netif_stop_queue (dev); | ||
779 | |||
780 | tulip_down (dev); | ||
781 | |||
782 | if (tulip_debug > 1) | ||
783 | printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", | ||
784 | dev->name, ioread32 (ioaddr + CSR5)); | ||
785 | |||
786 | free_irq (dev->irq, dev); | ||
787 | |||
788 | /* Free all the skbuffs in the Rx queue. */ | 782 | /* Free all the skbuffs in the Rx queue. */ |
789 | for (i = 0; i < RX_RING_SIZE; i++) { | 783 | for (i = 0; i < RX_RING_SIZE; i++) { |
790 | struct sk_buff *skb = tp->rx_buffers[i].skb; | 784 | struct sk_buff *skb = tp->rx_buffers[i].skb; |
@@ -803,6 +797,7 @@ static int tulip_close (struct net_device *dev) | |||
803 | dev_kfree_skb (skb); | 797 | dev_kfree_skb (skb); |
804 | } | 798 | } |
805 | } | 799 | } |
800 | |||
806 | for (i = 0; i < TX_RING_SIZE; i++) { | 801 | for (i = 0; i < TX_RING_SIZE; i++) { |
807 | struct sk_buff *skb = tp->tx_buffers[i].skb; | 802 | struct sk_buff *skb = tp->tx_buffers[i].skb; |
808 | 803 | ||
@@ -814,6 +809,24 @@ static int tulip_close (struct net_device *dev) | |||
814 | tp->tx_buffers[i].skb = NULL; | 809 | tp->tx_buffers[i].skb = NULL; |
815 | tp->tx_buffers[i].mapping = 0; | 810 | tp->tx_buffers[i].mapping = 0; |
816 | } | 811 | } |
812 | } | ||
813 | |||
814 | static int tulip_close (struct net_device *dev) | ||
815 | { | ||
816 | struct tulip_private *tp = netdev_priv(dev); | ||
817 | void __iomem *ioaddr = tp->base_addr; | ||
818 | |||
819 | netif_stop_queue (dev); | ||
820 | |||
821 | tulip_down (dev); | ||
822 | |||
823 | if (tulip_debug > 1) | ||
824 | printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", | ||
825 | dev->name, ioread32 (ioaddr + CSR5)); | ||
826 | |||
827 | free_irq (dev->irq, dev); | ||
828 | |||
829 | tulip_free_ring (dev); | ||
817 | 830 | ||
818 | return 0; | 831 | return 0; |
819 | } | 832 | } |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index e87986867ba5..1f61e42c641d 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -1536,32 +1536,15 @@ static void adjust_link(struct net_device *dev) | |||
1536 | static int init_phy(struct net_device *dev) | 1536 | static int init_phy(struct net_device *dev) |
1537 | { | 1537 | { |
1538 | struct ucc_geth_private *priv = netdev_priv(dev); | 1538 | struct ucc_geth_private *priv = netdev_priv(dev); |
1539 | struct device_node *np = priv->node; | 1539 | struct ucc_geth_info *ug_info = priv->ug_info; |
1540 | struct device_node *phy, *mdio; | ||
1541 | const phandle *ph; | ||
1542 | char bus_name[MII_BUS_ID_SIZE]; | ||
1543 | const unsigned int *id; | ||
1544 | struct phy_device *phydev; | 1540 | struct phy_device *phydev; |
1545 | char phy_id[BUS_ID_SIZE]; | ||
1546 | 1541 | ||
1547 | priv->oldlink = 0; | 1542 | priv->oldlink = 0; |
1548 | priv->oldspeed = 0; | 1543 | priv->oldspeed = 0; |
1549 | priv->oldduplex = -1; | 1544 | priv->oldduplex = -1; |
1550 | 1545 | ||
1551 | ph = of_get_property(np, "phy-handle", NULL); | 1546 | phydev = phy_connect(dev, ug_info->phy_bus_id, &adjust_link, 0, |
1552 | phy = of_find_node_by_phandle(*ph); | 1547 | priv->phy_interface); |
1553 | mdio = of_get_parent(phy); | ||
1554 | |||
1555 | id = of_get_property(phy, "reg", NULL); | ||
1556 | |||
1557 | of_node_put(phy); | ||
1558 | of_node_put(mdio); | ||
1559 | |||
1560 | uec_mdio_bus_name(bus_name, mdio); | ||
1561 | snprintf(phy_id, sizeof(phy_id), "%s:%02x", | ||
1562 | bus_name, *id); | ||
1563 | |||
1564 | phydev = phy_connect(dev, phy_id, &adjust_link, 0, priv->phy_interface); | ||
1565 | 1548 | ||
1566 | if (IS_ERR(phydev)) { | 1549 | if (IS_ERR(phydev)) { |
1567 | printk("%s: Could not attach to PHY\n", dev->name); | 1550 | printk("%s: Could not attach to PHY\n", dev->name); |
@@ -3629,10 +3612,12 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3629 | ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); | 3612 | ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); |
3630 | fixed_link = of_get_property(np, "fixed-link", NULL); | 3613 | fixed_link = of_get_property(np, "fixed-link", NULL); |
3631 | if (fixed_link) { | 3614 | if (fixed_link) { |
3632 | snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "0"); | 3615 | snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), |
3633 | ug_info->phy_address = fixed_link[0]; | 3616 | PHY_ID_FMT, "0", fixed_link[0]); |
3634 | phy = NULL; | 3617 | phy = NULL; |
3635 | } else { | 3618 | } else { |
3619 | char bus_name[MII_BUS_ID_SIZE]; | ||
3620 | |||
3636 | ph = of_get_property(np, "phy-handle", NULL); | 3621 | ph = of_get_property(np, "phy-handle", NULL); |
3637 | phy = of_find_node_by_phandle(*ph); | 3622 | phy = of_find_node_by_phandle(*ph); |
3638 | 3623 | ||
@@ -3643,7 +3628,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3643 | prop = of_get_property(phy, "reg", NULL); | 3628 | prop = of_get_property(phy, "reg", NULL); |
3644 | if (prop == NULL) | 3629 | if (prop == NULL) |
3645 | return -1; | 3630 | return -1; |
3646 | ug_info->phy_address = *prop; | ||
3647 | 3631 | ||
3648 | /* Set the bus id */ | 3632 | /* Set the bus id */ |
3649 | mdio = of_get_parent(phy); | 3633 | mdio = of_get_parent(phy); |
@@ -3657,7 +3641,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3657 | if (err) | 3641 | if (err) |
3658 | return -1; | 3642 | return -1; |
3659 | 3643 | ||
3660 | snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "%x", res.start); | 3644 | uec_mdio_bus_name(bus_name, mdio); |
3645 | snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), | ||
3646 | "%s:%02x", bus_name, *prop); | ||
3661 | } | 3647 | } |
3662 | 3648 | ||
3663 | /* get the phy interface type, or default to MII */ | 3649 | /* get the phy interface type, or default to MII */ |
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h index 16cbe42ba43c..611bdef2402b 100644 --- a/drivers/net/ucc_geth.h +++ b/drivers/net/ucc_geth.h | |||
@@ -1091,8 +1091,7 @@ struct ucc_geth_info { | |||
1091 | u32 eventRegMask; | 1091 | u32 eventRegMask; |
1092 | u16 pausePeriod; | 1092 | u16 pausePeriod; |
1093 | u16 extensionField; | 1093 | u16 extensionField; |
1094 | u8 phy_address; | 1094 | char phy_bus_id[BUS_ID_SIZE]; |
1095 | char mdio_bus[MII_BUS_ID_SIZE]; | ||
1096 | u8 weightfactor[NUM_TX_QUEUES]; | 1095 | u8 weightfactor[NUM_TX_QUEUES]; |
1097 | u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES]; | 1096 | u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES]; |
1098 | u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX]; | 1097 | u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX]; |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index c68808336c8c..e67d16c2e5f3 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -612,6 +612,7 @@ static struct ethtool_ops virtnet_ethtool_ops = { | |||
612 | .set_tx_csum = virtnet_set_tx_csum, | 612 | .set_tx_csum = virtnet_set_tx_csum, |
613 | .set_sg = ethtool_op_set_sg, | 613 | .set_sg = ethtool_op_set_sg, |
614 | .set_tso = ethtool_op_set_tso, | 614 | .set_tso = ethtool_op_set_tso, |
615 | .get_link = ethtool_op_get_link, | ||
615 | }; | 616 | }; |
616 | 617 | ||
617 | #define MIN_MTU 68 | 618 | #define MIN_MTU 68 |
@@ -739,6 +740,8 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
739 | goto unregister; | 740 | goto unregister; |
740 | } | 741 | } |
741 | 742 | ||
743 | netif_carrier_on(dev); | ||
744 | |||
742 | pr_debug("virtnet: registered device %s\n", dev->name); | 745 | pr_debug("virtnet: registered device %s\n", dev->name); |
743 | return 0; | 746 | return 0; |
744 | 747 | ||
diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h index d27813502953..6650f609ece4 100644 --- a/drivers/net/wireless/ath9k/ath9k.h +++ b/drivers/net/wireless/ath9k/ath9k.h | |||
@@ -587,8 +587,8 @@ struct ath9k_country_entry { | |||
587 | u8 iso[3]; | 587 | u8 iso[3]; |
588 | }; | 588 | }; |
589 | 589 | ||
590 | #define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg) | 590 | #define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val)) |
591 | #define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg) | 591 | #define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg)) |
592 | 592 | ||
593 | #define SM(_v, _f) (((_v) << _f##_S) & _f) | 593 | #define SM(_v, _f) (((_v) << _f##_S) & _f) |
594 | #define MS(_v, _f) (((_v) & _f) >> _f##_S) | 594 | #define MS(_v, _f) (((_v) & _f) >> _f##_S) |
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 4ca2aed236e0..139566cbbf65 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -701,6 +701,7 @@ struct ath_softc { | |||
701 | struct ath_hal *sc_ah; | 701 | struct ath_hal *sc_ah; |
702 | void __iomem *mem; | 702 | void __iomem *mem; |
703 | spinlock_t sc_resetlock; | 703 | spinlock_t sc_resetlock; |
704 | spinlock_t sc_serial_rw; | ||
704 | struct mutex mutex; | 705 | struct mutex mutex; |
705 | 706 | ||
706 | u8 sc_curbssid[ETH_ALEN]; | 707 | u8 sc_curbssid[ETH_ALEN]; |
@@ -751,4 +752,36 @@ int ath_get_hal_qnum(u16 queue, struct ath_softc *sc); | |||
751 | int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); | 752 | int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); |
752 | int ath_cabq_update(struct ath_softc *); | 753 | int ath_cabq_update(struct ath_softc *); |
753 | 754 | ||
755 | /* | ||
756 | * Read and write, they both share the same lock. We do this to serialize | ||
757 | * reads and writes on Atheros 802.11n PCI devices only. This is required | ||
758 | * as the FIFO on these devices can only accept sanely 2 requests. After | ||
759 | * that the device goes bananas. Serializing the reads/writes prevents this | ||
760 | * from happening. | ||
761 | */ | ||
762 | |||
763 | static inline void ath9k_iowrite32(struct ath_hal *ah, u32 reg_offset, u32 val) | ||
764 | { | ||
765 | if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) { | ||
766 | unsigned long flags; | ||
767 | spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); | ||
768 | iowrite32(val, ah->ah_sc->mem + reg_offset); | ||
769 | spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); | ||
770 | } else | ||
771 | iowrite32(val, ah->ah_sc->mem + reg_offset); | ||
772 | } | ||
773 | |||
774 | static inline unsigned int ath9k_ioread32(struct ath_hal *ah, u32 reg_offset) | ||
775 | { | ||
776 | u32 val; | ||
777 | if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) { | ||
778 | unsigned long flags; | ||
779 | spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); | ||
780 | val = ioread32(ah->ah_sc->mem + reg_offset); | ||
781 | spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); | ||
782 | } else | ||
783 | val = ioread32(ah->ah_sc->mem + reg_offset); | ||
784 | return val; | ||
785 | } | ||
786 | |||
754 | #endif /* CORE_H */ | 787 | #endif /* CORE_H */ |
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c index 34474edefc97..c38a00bbce64 100644 --- a/drivers/net/wireless/ath9k/hw.c +++ b/drivers/net/wireless/ath9k/hw.c | |||
@@ -437,6 +437,25 @@ static void ath9k_hw_set_defaults(struct ath_hal *ah) | |||
437 | } | 437 | } |
438 | 438 | ||
439 | ah->ah_config.intr_mitigation = 1; | 439 | ah->ah_config.intr_mitigation = 1; |
440 | |||
441 | /* | ||
442 | * We need this for PCI devices only (Cardbus, PCI, miniPCI) | ||
443 | * _and_ if on non-uniprocessor systems (Multiprocessor/HT). | ||
444 | * This means we use it for all AR5416 devices, and the few | ||
445 | * minor PCI AR9280 devices out there. | ||
446 | * | ||
447 | * Serialization is required because these devices do not handle | ||
448 | * well the case of two concurrent reads/writes due to the latency | ||
449 | * involved. During one read/write another read/write can be issued | ||
450 | * on another CPU while the previous read/write may still be working | ||
451 | * on our hardware, if we hit this case the hardware poops in a loop. | ||
452 | * We prevent this by serializing reads and writes. | ||
453 | * | ||
454 | * This issue is not present on PCI-Express devices or pre-AR5416 | ||
455 | * devices (legacy, 802.11abg). | ||
456 | */ | ||
457 | if (num_possible_cpus() > 1) | ||
458 | ah->ah_config.serialize_regmode = SER_REG_MODE_AUTO; | ||
440 | } | 459 | } |
441 | 460 | ||
442 | static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid, | 461 | static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid, |
@@ -668,7 +687,8 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc, | |||
668 | } | 687 | } |
669 | 688 | ||
670 | if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) { | 689 | if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) { |
671 | if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) { | 690 | if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI || |
691 | (AR_SREV_9280(ah) && !ah->ah_isPciExpress)) { | ||
672 | ah->ah_config.serialize_regmode = | 692 | ah->ah_config.serialize_regmode = |
673 | SER_REG_MODE_ON; | 693 | SER_REG_MODE_ON; |
674 | } else { | 694 | } else { |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 0e80990d8e84..3c04044a60bd 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -1336,6 +1336,7 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1336 | printk(KERN_ERR "Unable to create debugfs files\n"); | 1336 | printk(KERN_ERR "Unable to create debugfs files\n"); |
1337 | 1337 | ||
1338 | spin_lock_init(&sc->sc_resetlock); | 1338 | spin_lock_init(&sc->sc_resetlock); |
1339 | spin_lock_init(&sc->sc_serial_rw); | ||
1339 | mutex_init(&sc->mutex); | 1340 | mutex_init(&sc->mutex); |
1340 | tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); | 1341 | tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); |
1341 | tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet, | 1342 | tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet, |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index a611ad857983..847057d682b1 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -575,13 +575,17 @@ static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
575 | 575 | ||
576 | r = fill_ctrlset(mac, skb); | 576 | r = fill_ctrlset(mac, skb); |
577 | if (r) | 577 | if (r) |
578 | return r; | 578 | goto fail; |
579 | 579 | ||
580 | info->rate_driver_data[0] = hw; | 580 | info->rate_driver_data[0] = hw; |
581 | 581 | ||
582 | r = zd_usb_tx(&mac->chip.usb, skb); | 582 | r = zd_usb_tx(&mac->chip.usb, skb); |
583 | if (r) | 583 | if (r) |
584 | return r; | 584 | goto fail; |
585 | return 0; | ||
586 | |||
587 | fail: | ||
588 | dev_kfree_skb(skb); | ||
585 | return 0; | 589 | return 0; |
586 | } | 590 | } |
587 | 591 | ||
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 29dc735e1a20..124f660a0383 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -51,6 +51,7 @@ MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@sk | |||
51 | MODULE_DESCRIPTION("OPENPROM Configuration Driver"); | 51 | MODULE_DESCRIPTION("OPENPROM Configuration Driver"); |
52 | MODULE_LICENSE("GPL"); | 52 | MODULE_LICENSE("GPL"); |
53 | MODULE_VERSION("1.0"); | 53 | MODULE_VERSION("1.0"); |
54 | MODULE_ALIAS_MISCDEV(SUN_OPENPROM_MINOR); | ||
54 | 55 | ||
55 | /* Private data kept by the driver for each descriptor. */ | 56 | /* Private data kept by the driver for each descriptor. */ |
56 | typedef struct openprom_private_data | 57 | typedef struct openprom_private_data |
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index 81603f85e17e..c6d7cc76516f 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
@@ -2507,6 +2507,25 @@ static void radeon_reinitialize_QW(struct radeonfb_info *rinfo) | |||
2507 | 2507 | ||
2508 | #endif /* CONFIG_PPC_OF */ | 2508 | #endif /* CONFIG_PPC_OF */ |
2509 | 2509 | ||
2510 | static void radeonfb_whack_power_state(struct radeonfb_info *rinfo, pci_power_t state) | ||
2511 | { | ||
2512 | u16 pwr_cmd; | ||
2513 | |||
2514 | for (;;) { | ||
2515 | pci_read_config_word(rinfo->pdev, | ||
2516 | rinfo->pm_reg+PCI_PM_CTRL, | ||
2517 | &pwr_cmd); | ||
2518 | if (pwr_cmd & 2) | ||
2519 | break; | ||
2520 | pwr_cmd = (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2; | ||
2521 | pci_write_config_word(rinfo->pdev, | ||
2522 | rinfo->pm_reg+PCI_PM_CTRL, | ||
2523 | pwr_cmd); | ||
2524 | msleep(500); | ||
2525 | } | ||
2526 | rinfo->pdev->current_state = state; | ||
2527 | } | ||
2528 | |||
2510 | static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) | 2529 | static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) |
2511 | { | 2530 | { |
2512 | u32 tmp; | 2531 | u32 tmp; |
@@ -2558,6 +2577,11 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) | |||
2558 | /* Switch PCI power management to D2. */ | 2577 | /* Switch PCI power management to D2. */ |
2559 | pci_disable_device(rinfo->pdev); | 2578 | pci_disable_device(rinfo->pdev); |
2560 | pci_save_state(rinfo->pdev); | 2579 | pci_save_state(rinfo->pdev); |
2580 | /* The chip seems to need us to whack the PM register | ||
2581 | * repeatedly until it sticks. We do that -prior- to | ||
2582 | * calling pci_set_power_state() | ||
2583 | */ | ||
2584 | radeonfb_whack_power_state(rinfo, PCI_D2); | ||
2561 | pci_set_power_state(rinfo->pdev, PCI_D2); | 2585 | pci_set_power_state(rinfo->pdev, PCI_D2); |
2562 | } else { | 2586 | } else { |
2563 | printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n", | 2587 | printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n", |
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index bdca1f4b3a3e..8b65f289ee00 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -1324,14 +1324,13 @@ static int ecryptfs_write_headers_virt(char *page_virt, size_t max, | |||
1324 | } | 1324 | } |
1325 | 1325 | ||
1326 | static int | 1326 | static int |
1327 | ecryptfs_write_metadata_to_contents(struct ecryptfs_crypt_stat *crypt_stat, | 1327 | ecryptfs_write_metadata_to_contents(struct dentry *ecryptfs_dentry, |
1328 | struct dentry *ecryptfs_dentry, | 1328 | char *virt, size_t virt_len) |
1329 | char *virt) | ||
1330 | { | 1329 | { |
1331 | int rc; | 1330 | int rc; |
1332 | 1331 | ||
1333 | rc = ecryptfs_write_lower(ecryptfs_dentry->d_inode, virt, | 1332 | rc = ecryptfs_write_lower(ecryptfs_dentry->d_inode, virt, |
1334 | 0, crypt_stat->num_header_bytes_at_front); | 1333 | 0, virt_len); |
1335 | if (rc) | 1334 | if (rc) |
1336 | printk(KERN_ERR "%s: Error attempting to write header " | 1335 | printk(KERN_ERR "%s: Error attempting to write header " |
1337 | "information to lower file; rc = [%d]\n", __func__, | 1336 | "information to lower file; rc = [%d]\n", __func__, |
@@ -1341,7 +1340,6 @@ ecryptfs_write_metadata_to_contents(struct ecryptfs_crypt_stat *crypt_stat, | |||
1341 | 1340 | ||
1342 | static int | 1341 | static int |
1343 | ecryptfs_write_metadata_to_xattr(struct dentry *ecryptfs_dentry, | 1342 | ecryptfs_write_metadata_to_xattr(struct dentry *ecryptfs_dentry, |
1344 | struct ecryptfs_crypt_stat *crypt_stat, | ||
1345 | char *page_virt, size_t size) | 1343 | char *page_virt, size_t size) |
1346 | { | 1344 | { |
1347 | int rc; | 1345 | int rc; |
@@ -1351,6 +1349,17 @@ ecryptfs_write_metadata_to_xattr(struct dentry *ecryptfs_dentry, | |||
1351 | return rc; | 1349 | return rc; |
1352 | } | 1350 | } |
1353 | 1351 | ||
1352 | static unsigned long ecryptfs_get_zeroed_pages(gfp_t gfp_mask, | ||
1353 | unsigned int order) | ||
1354 | { | ||
1355 | struct page *page; | ||
1356 | |||
1357 | page = alloc_pages(gfp_mask | __GFP_ZERO, order); | ||
1358 | if (page) | ||
1359 | return (unsigned long) page_address(page); | ||
1360 | return 0; | ||
1361 | } | ||
1362 | |||
1354 | /** | 1363 | /** |
1355 | * ecryptfs_write_metadata | 1364 | * ecryptfs_write_metadata |
1356 | * @ecryptfs_dentry: The eCryptfs dentry | 1365 | * @ecryptfs_dentry: The eCryptfs dentry |
@@ -1367,7 +1376,9 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) | |||
1367 | { | 1376 | { |
1368 | struct ecryptfs_crypt_stat *crypt_stat = | 1377 | struct ecryptfs_crypt_stat *crypt_stat = |
1369 | &ecryptfs_inode_to_private(ecryptfs_dentry->d_inode)->crypt_stat; | 1378 | &ecryptfs_inode_to_private(ecryptfs_dentry->d_inode)->crypt_stat; |
1379 | unsigned int order; | ||
1370 | char *virt; | 1380 | char *virt; |
1381 | size_t virt_len; | ||
1371 | size_t size = 0; | 1382 | size_t size = 0; |
1372 | int rc = 0; | 1383 | int rc = 0; |
1373 | 1384 | ||
@@ -1383,33 +1394,35 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) | |||
1383 | rc = -EINVAL; | 1394 | rc = -EINVAL; |
1384 | goto out; | 1395 | goto out; |
1385 | } | 1396 | } |
1397 | virt_len = crypt_stat->num_header_bytes_at_front; | ||
1398 | order = get_order(virt_len); | ||
1386 | /* Released in this function */ | 1399 | /* Released in this function */ |
1387 | virt = (char *)get_zeroed_page(GFP_KERNEL); | 1400 | virt = (char *)ecryptfs_get_zeroed_pages(GFP_KERNEL, order); |
1388 | if (!virt) { | 1401 | if (!virt) { |
1389 | printk(KERN_ERR "%s: Out of memory\n", __func__); | 1402 | printk(KERN_ERR "%s: Out of memory\n", __func__); |
1390 | rc = -ENOMEM; | 1403 | rc = -ENOMEM; |
1391 | goto out; | 1404 | goto out; |
1392 | } | 1405 | } |
1393 | rc = ecryptfs_write_headers_virt(virt, PAGE_CACHE_SIZE, &size, | 1406 | rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat, |
1394 | crypt_stat, ecryptfs_dentry); | 1407 | ecryptfs_dentry); |
1395 | if (unlikely(rc)) { | 1408 | if (unlikely(rc)) { |
1396 | printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n", | 1409 | printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n", |
1397 | __func__, rc); | 1410 | __func__, rc); |
1398 | goto out_free; | 1411 | goto out_free; |
1399 | } | 1412 | } |
1400 | if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) | 1413 | if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) |
1401 | rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, | 1414 | rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, virt, |
1402 | crypt_stat, virt, size); | 1415 | size); |
1403 | else | 1416 | else |
1404 | rc = ecryptfs_write_metadata_to_contents(crypt_stat, | 1417 | rc = ecryptfs_write_metadata_to_contents(ecryptfs_dentry, virt, |
1405 | ecryptfs_dentry, virt); | 1418 | virt_len); |
1406 | if (rc) { | 1419 | if (rc) { |
1407 | printk(KERN_ERR "%s: Error writing metadata out to lower file; " | 1420 | printk(KERN_ERR "%s: Error writing metadata out to lower file; " |
1408 | "rc = [%d]\n", __func__, rc); | 1421 | "rc = [%d]\n", __func__, rc); |
1409 | goto out_free; | 1422 | goto out_free; |
1410 | } | 1423 | } |
1411 | out_free: | 1424 | out_free: |
1412 | free_page((unsigned long)virt); | 1425 | free_pages((unsigned long)virt, order); |
1413 | out: | 1426 | out: |
1414 | return rc; | 1427 | return rc; |
1415 | } | 1428 | } |
@@ -2208,17 +2221,19 @@ int ecryptfs_decode_and_decrypt_filename(char **plaintext_name, | |||
2208 | struct dentry *ecryptfs_dir_dentry, | 2221 | struct dentry *ecryptfs_dir_dentry, |
2209 | const char *name, size_t name_size) | 2222 | const char *name, size_t name_size) |
2210 | { | 2223 | { |
2224 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = | ||
2225 | &ecryptfs_superblock_to_private( | ||
2226 | ecryptfs_dir_dentry->d_sb)->mount_crypt_stat; | ||
2211 | char *decoded_name; | 2227 | char *decoded_name; |
2212 | size_t decoded_name_size; | 2228 | size_t decoded_name_size; |
2213 | size_t packet_size; | 2229 | size_t packet_size; |
2214 | int rc = 0; | 2230 | int rc = 0; |
2215 | 2231 | ||
2216 | if ((name_size > ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) | 2232 | if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) |
2233 | && !(mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) | ||
2234 | && (name_size > ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) | ||
2217 | && (strncmp(name, ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX, | 2235 | && (strncmp(name, ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX, |
2218 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) == 0)) { | 2236 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) == 0)) { |
2219 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = | ||
2220 | &ecryptfs_superblock_to_private( | ||
2221 | ecryptfs_dir_dentry->d_sb)->mount_crypt_stat; | ||
2222 | const char *orig_name = name; | 2237 | const char *orig_name = name; |
2223 | size_t orig_name_size = name_size; | 2238 | size_t orig_name_size = name_size; |
2224 | 2239 | ||
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index eb2267eca1fe..ac749d4d644f 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
@@ -620,7 +620,6 @@ int ecryptfs_interpose(struct dentry *hidden_dentry, | |||
620 | u32 flags); | 620 | u32 flags); |
621 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | 621 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, |
622 | struct dentry *lower_dentry, | 622 | struct dentry *lower_dentry, |
623 | struct ecryptfs_crypt_stat *crypt_stat, | ||
624 | struct inode *ecryptfs_dir_inode, | 623 | struct inode *ecryptfs_dir_inode, |
625 | struct nameidata *ecryptfs_nd); | 624 | struct nameidata *ecryptfs_nd); |
626 | int ecryptfs_decode_and_decrypt_filename(char **decrypted_name, | 625 | int ecryptfs_decode_and_decrypt_filename(char **decrypted_name, |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 5697899a168d..55b3145b8072 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -246,7 +246,6 @@ out: | |||
246 | */ | 246 | */ |
247 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | 247 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, |
248 | struct dentry *lower_dentry, | 248 | struct dentry *lower_dentry, |
249 | struct ecryptfs_crypt_stat *crypt_stat, | ||
250 | struct inode *ecryptfs_dir_inode, | 249 | struct inode *ecryptfs_dir_inode, |
251 | struct nameidata *ecryptfs_nd) | 250 | struct nameidata *ecryptfs_nd) |
252 | { | 251 | { |
@@ -254,6 +253,7 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | |||
254 | struct vfsmount *lower_mnt; | 253 | struct vfsmount *lower_mnt; |
255 | struct inode *lower_inode; | 254 | struct inode *lower_inode; |
256 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | 255 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; |
256 | struct ecryptfs_crypt_stat *crypt_stat; | ||
257 | char *page_virt = NULL; | 257 | char *page_virt = NULL; |
258 | u64 file_size; | 258 | u64 file_size; |
259 | int rc = 0; | 259 | int rc = 0; |
@@ -314,6 +314,11 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | |||
314 | goto out_free_kmem; | 314 | goto out_free_kmem; |
315 | } | 315 | } |
316 | } | 316 | } |
317 | crypt_stat = &ecryptfs_inode_to_private( | ||
318 | ecryptfs_dentry->d_inode)->crypt_stat; | ||
319 | /* TODO: lock for crypt_stat comparison */ | ||
320 | if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)) | ||
321 | ecryptfs_set_default_sizes(crypt_stat); | ||
317 | rc = ecryptfs_read_and_validate_header_region(page_virt, | 322 | rc = ecryptfs_read_and_validate_header_region(page_virt, |
318 | ecryptfs_dentry->d_inode); | 323 | ecryptfs_dentry->d_inode); |
319 | if (rc) { | 324 | if (rc) { |
@@ -362,9 +367,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
362 | { | 367 | { |
363 | char *encrypted_and_encoded_name = NULL; | 368 | char *encrypted_and_encoded_name = NULL; |
364 | size_t encrypted_and_encoded_name_size; | 369 | size_t encrypted_and_encoded_name_size; |
365 | struct ecryptfs_crypt_stat *crypt_stat = NULL; | ||
366 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL; | 370 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL; |
367 | struct ecryptfs_inode_info *inode_info; | ||
368 | struct dentry *lower_dir_dentry, *lower_dentry; | 371 | struct dentry *lower_dir_dentry, *lower_dentry; |
369 | int rc = 0; | 372 | int rc = 0; |
370 | 373 | ||
@@ -388,26 +391,15 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
388 | } | 391 | } |
389 | if (lower_dentry->d_inode) | 392 | if (lower_dentry->d_inode) |
390 | goto lookup_and_interpose; | 393 | goto lookup_and_interpose; |
391 | inode_info = ecryptfs_inode_to_private(ecryptfs_dentry->d_inode); | 394 | mount_crypt_stat = &ecryptfs_superblock_to_private( |
392 | if (inode_info) { | 395 | ecryptfs_dentry->d_sb)->mount_crypt_stat; |
393 | crypt_stat = &inode_info->crypt_stat; | 396 | if (!(mount_crypt_stat |
394 | /* TODO: lock for crypt_stat comparison */ | 397 | && (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES))) |
395 | if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)) | ||
396 | ecryptfs_set_default_sizes(crypt_stat); | ||
397 | } | ||
398 | if (crypt_stat) | ||
399 | mount_crypt_stat = crypt_stat->mount_crypt_stat; | ||
400 | else | ||
401 | mount_crypt_stat = &ecryptfs_superblock_to_private( | ||
402 | ecryptfs_dentry->d_sb)->mount_crypt_stat; | ||
403 | if (!(crypt_stat && (crypt_stat->flags & ECRYPTFS_ENCRYPT_FILENAMES)) | ||
404 | && !(mount_crypt_stat && (mount_crypt_stat->flags | ||
405 | & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES))) | ||
406 | goto lookup_and_interpose; | 398 | goto lookup_and_interpose; |
407 | dput(lower_dentry); | 399 | dput(lower_dentry); |
408 | rc = ecryptfs_encrypt_and_encode_filename( | 400 | rc = ecryptfs_encrypt_and_encode_filename( |
409 | &encrypted_and_encoded_name, &encrypted_and_encoded_name_size, | 401 | &encrypted_and_encoded_name, &encrypted_and_encoded_name_size, |
410 | crypt_stat, mount_crypt_stat, ecryptfs_dentry->d_name.name, | 402 | NULL, mount_crypt_stat, ecryptfs_dentry->d_name.name, |
411 | ecryptfs_dentry->d_name.len); | 403 | ecryptfs_dentry->d_name.len); |
412 | if (rc) { | 404 | if (rc) { |
413 | printk(KERN_ERR "%s: Error attempting to encrypt and encode " | 405 | printk(KERN_ERR "%s: Error attempting to encrypt and encode " |
@@ -426,7 +418,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
426 | } | 418 | } |
427 | lookup_and_interpose: | 419 | lookup_and_interpose: |
428 | rc = ecryptfs_lookup_and_interpose_lower(ecryptfs_dentry, lower_dentry, | 420 | rc = ecryptfs_lookup_and_interpose_lower(ecryptfs_dentry, lower_dentry, |
429 | crypt_stat, ecryptfs_dir_inode, | 421 | ecryptfs_dir_inode, |
430 | ecryptfs_nd); | 422 | ecryptfs_nd); |
431 | goto out; | 423 | goto out; |
432 | out_d_drop: | 424 | out_d_drop: |
diff --git a/fs/minix/inode.c b/fs/minix/inode.c index d1d1eb84679d..618865b3128b 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 1991, 1992 Linus Torvalds | 4 | * Copyright (C) 1991, 1992 Linus Torvalds |
5 | * | 5 | * |
6 | * Copyright (C) 1996 Gertjan van Wingerde (gertjan@cs.vu.nl) | 6 | * Copyright (C) 1996 Gertjan van Wingerde |
7 | * Minix V2 fs support. | 7 | * Minix V2 fs support. |
8 | * | 8 | * |
9 | * Modified for 680x0 by Andreas Schwab | 9 | * Modified for 680x0 by Andreas Schwab |
diff --git a/fs/ufs/super.c b/fs/ufs/super.c index e65212dfb60e..261a1c2f22dd 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c | |||
@@ -41,7 +41,7 @@ | |||
41 | * Stefan Reinauer <stepan@home.culture.mipt.ru> | 41 | * Stefan Reinauer <stepan@home.culture.mipt.ru> |
42 | * | 42 | * |
43 | * Module usage counts added on 96/04/29 by | 43 | * Module usage counts added on 96/04/29 by |
44 | * Gertjan van Wingerde <gertjan@cs.vu.nl> | 44 | * Gertjan van Wingerde <gwingerde@gmail.com> |
45 | * | 45 | * |
46 | * Clean swab support on 19970406 by | 46 | * Clean swab support on 19970406 by |
47 | * Francois-Rene Rideau <fare@tunes.org> | 47 | * Francois-Rene Rideau <fare@tunes.org> |
diff --git a/include/linux/dca.h b/include/linux/dca.h index b00a753eda53..9c20c7e87d0a 100644 --- a/include/linux/dca.h +++ b/include/linux/dca.h | |||
@@ -1,3 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the Free | ||
6 | * Software Foundation; either version 2 of the License, or (at your option) | ||
7 | * any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 | ||
16 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | ||
19 | * file called COPYING. | ||
20 | */ | ||
1 | #ifndef DCA_H | 21 | #ifndef DCA_H |
2 | #define DCA_H | 22 | #define DCA_H |
3 | /* DCA Provider API */ | 23 | /* DCA Provider API */ |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index c25068e38516..5a449b44ba33 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -62,7 +62,8 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb) | |||
62 | if (ct && ct != &nf_conntrack_untracked) { | 62 | if (ct && ct != &nf_conntrack_untracked) { |
63 | if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) | 63 | if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) |
64 | ret = __nf_conntrack_confirm(skb); | 64 | ret = __nf_conntrack_confirm(skb); |
65 | nf_ct_deliver_cached_events(ct); | 65 | if (likely(ret == NF_ACCEPT)) |
66 | nf_ct_deliver_cached_events(ct); | ||
66 | } | 67 | } |
67 | return ret; | 68 | return ret; |
68 | } | 69 | } |
diff --git a/kernel/signal.c b/kernel/signal.c index 2a74fe87c0dd..1c8814481a11 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1575,7 +1575,15 @@ static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info) | |||
1575 | read_lock(&tasklist_lock); | 1575 | read_lock(&tasklist_lock); |
1576 | if (may_ptrace_stop()) { | 1576 | if (may_ptrace_stop()) { |
1577 | do_notify_parent_cldstop(current, CLD_TRAPPED); | 1577 | do_notify_parent_cldstop(current, CLD_TRAPPED); |
1578 | /* | ||
1579 | * Don't want to allow preemption here, because | ||
1580 | * sys_ptrace() needs this task to be inactive. | ||
1581 | * | ||
1582 | * XXX: implement read_unlock_no_resched(). | ||
1583 | */ | ||
1584 | preempt_disable(); | ||
1578 | read_unlock(&tasklist_lock); | 1585 | read_unlock(&tasklist_lock); |
1586 | preempt_enable_no_resched(); | ||
1579 | schedule(); | 1587 | schedule(); |
1580 | } else { | 1588 | } else { |
1581 | /* | 1589 | /* |
diff --git a/net/core/dev.c b/net/core/dev.c index f1129706ce7b..e3fe5c705606 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2588,9 +2588,9 @@ static int process_backlog(struct napi_struct *napi, int quota) | |||
2588 | local_irq_disable(); | 2588 | local_irq_disable(); |
2589 | skb = __skb_dequeue(&queue->input_pkt_queue); | 2589 | skb = __skb_dequeue(&queue->input_pkt_queue); |
2590 | if (!skb) { | 2590 | if (!skb) { |
2591 | __napi_complete(napi); | ||
2592 | local_irq_enable(); | 2591 | local_irq_enable(); |
2593 | break; | 2592 | napi_complete(napi); |
2593 | goto out; | ||
2594 | } | 2594 | } |
2595 | local_irq_enable(); | 2595 | local_irq_enable(); |
2596 | 2596 | ||
@@ -2599,6 +2599,7 @@ static int process_backlog(struct napi_struct *napi, int quota) | |||
2599 | 2599 | ||
2600 | napi_gro_flush(napi); | 2600 | napi_gro_flush(napi); |
2601 | 2601 | ||
2602 | out: | ||
2602 | return work; | 2603 | return work; |
2603 | } | 2604 | } |
2604 | 2605 | ||
@@ -2671,7 +2672,7 @@ void netif_napi_del(struct napi_struct *napi) | |||
2671 | struct sk_buff *skb, *next; | 2672 | struct sk_buff *skb, *next; |
2672 | 2673 | ||
2673 | list_del_init(&napi->dev_list); | 2674 | list_del_init(&napi->dev_list); |
2674 | kfree(napi->skb); | 2675 | kfree_skb(napi->skb); |
2675 | 2676 | ||
2676 | for (skb = napi->gro_list; skb; skb = next) { | 2677 | for (skb = napi->gro_list; skb; skb = next) { |
2677 | next = skb->next; | 2678 | next = skb->next; |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 6659ac000eeb..7985346653bd 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -463,6 +463,7 @@ err: | |||
463 | static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, | 463 | static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, |
464 | struct net_device *dev) | 464 | struct net_device *dev) |
465 | { | 465 | { |
466 | struct net *net = container_of(qp->q.net, struct net, ipv4.frags); | ||
466 | struct iphdr *iph; | 467 | struct iphdr *iph; |
467 | struct sk_buff *fp, *head = qp->q.fragments; | 468 | struct sk_buff *fp, *head = qp->q.fragments; |
468 | int len; | 469 | int len; |
@@ -548,7 +549,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, | |||
548 | iph = ip_hdr(head); | 549 | iph = ip_hdr(head); |
549 | iph->frag_off = 0; | 550 | iph->frag_off = 0; |
550 | iph->tot_len = htons(len); | 551 | iph->tot_len = htons(len); |
551 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMOKS); | 552 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS); |
552 | qp->q.fragments = NULL; | 553 | qp->q.fragments = NULL; |
553 | return 0; | 554 | return 0; |
554 | 555 | ||
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index ed4d79a9e4a6..058a5e4a60c3 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -528,14 +528,14 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff) | |||
528 | if (!ipv6_ext_hdr(nexthdr)) { | 528 | if (!ipv6_ext_hdr(nexthdr)) { |
529 | return -1; | 529 | return -1; |
530 | } | 530 | } |
531 | if (len < (int)sizeof(struct ipv6_opt_hdr)) { | ||
532 | pr_debug("too short\n"); | ||
533 | return -1; | ||
534 | } | ||
535 | if (nexthdr == NEXTHDR_NONE) { | 531 | if (nexthdr == NEXTHDR_NONE) { |
536 | pr_debug("next header is none\n"); | 532 | pr_debug("next header is none\n"); |
537 | return -1; | 533 | return -1; |
538 | } | 534 | } |
535 | if (len < (int)sizeof(struct ipv6_opt_hdr)) { | ||
536 | pr_debug("too short\n"); | ||
537 | return -1; | ||
538 | } | ||
539 | if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) | 539 | if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) |
540 | BUG(); | 540 | BUG(); |
541 | if (nexthdr == NEXTHDR_AUTH) | 541 | if (nexthdr == NEXTHDR_AUTH) |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 3c575118fca5..e9ac7a12f595 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -452,6 +452,7 @@ err: | |||
452 | static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, | 452 | static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, |
453 | struct net_device *dev) | 453 | struct net_device *dev) |
454 | { | 454 | { |
455 | struct net *net = container_of(fq->q.net, struct net, ipv6.frags); | ||
455 | struct sk_buff *fp, *head = fq->q.fragments; | 456 | struct sk_buff *fp, *head = fq->q.fragments; |
456 | int payload_len; | 457 | int payload_len; |
457 | unsigned int nhoff; | 458 | unsigned int nhoff; |
@@ -551,8 +552,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, | |||
551 | head->csum); | 552 | head->csum); |
552 | 553 | ||
553 | rcu_read_lock(); | 554 | rcu_read_lock(); |
554 | IP6_INC_STATS_BH(dev_net(dev), | 555 | IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS); |
555 | __in6_dev_get(dev), IPSTATS_MIB_REASMOKS); | ||
556 | rcu_read_unlock(); | 556 | rcu_read_unlock(); |
557 | fq->q.fragments = NULL; | 557 | fq->q.fragments = NULL; |
558 | return 1; | 558 | return 1; |
@@ -566,8 +566,7 @@ out_oom: | |||
566 | printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n"); | 566 | printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n"); |
567 | out_fail: | 567 | out_fail: |
568 | rcu_read_lock(); | 568 | rcu_read_lock(); |
569 | IP6_INC_STATS_BH(dev_net(dev), | 569 | IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); |
570 | __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); | ||
571 | rcu_read_unlock(); | 570 | rcu_read_unlock(); |
572 | return -1; | 571 | return -1; |
573 | } | 572 | } |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index d3467e563f02..5cee2bcbcece 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -188,9 +188,9 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net, | |||
188 | } | 188 | } |
189 | 189 | ||
190 | nt = netdev_priv(dev); | 190 | nt = netdev_priv(dev); |
191 | ipip6_tunnel_init(dev); | ||
192 | 191 | ||
193 | nt->parms = *parms; | 192 | nt->parms = *parms; |
193 | ipip6_tunnel_init(dev); | ||
194 | 194 | ||
195 | if (parms->i_flags & SIT_ISATAP) | 195 | if (parms->i_flags & SIT_ISATAP) |
196 | dev->priv_flags |= IFF_ISATAP; | 196 | dev->priv_flags |= IFF_ISATAP; |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 94de5033f0b6..37e3d5ef7e3f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -752,6 +752,8 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) | |||
752 | skb_copy_queue_mapping(frag, first); | 752 | skb_copy_queue_mapping(frag, first); |
753 | 753 | ||
754 | frag->do_not_encrypt = first->do_not_encrypt; | 754 | frag->do_not_encrypt = first->do_not_encrypt; |
755 | frag->dev = first->dev; | ||
756 | frag->iif = first->iif; | ||
755 | 757 | ||
756 | pos += copylen; | 758 | pos += copylen; |
757 | left -= copylen; | 759 | left -= copylen; |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 90ce9ddb9451..f4935e344b61 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -726,7 +726,7 @@ nf_conntrack_in(struct net *net, u_int8_t pf, unsigned int hooknum, | |||
726 | NF_CT_ASSERT(skb->nfct); | 726 | NF_CT_ASSERT(skb->nfct); |
727 | 727 | ||
728 | ret = l4proto->packet(ct, skb, dataoff, ctinfo, pf, hooknum); | 728 | ret = l4proto->packet(ct, skb, dataoff, ctinfo, pf, hooknum); |
729 | if (ret < 0) { | 729 | if (ret <= 0) { |
730 | /* Invalid: inverse of the return code tells | 730 | /* Invalid: inverse of the return code tells |
731 | * the netfilter core what to do */ | 731 | * the netfilter core what to do */ |
732 | pr_debug("nf_conntrack_in: Can't track with proto module\n"); | 732 | pr_debug("nf_conntrack_in: Can't track with proto module\n"); |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index cb78aa00399e..ed6d873ad384 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1780,6 +1780,7 @@ ctnetlink_create_expect(struct nlattr *cda[], u_int8_t u3, u32 pid, int report) | |||
1780 | goto out; | 1780 | goto out; |
1781 | } | 1781 | } |
1782 | 1782 | ||
1783 | exp->class = 0; | ||
1783 | exp->expectfn = NULL; | 1784 | exp->expectfn = NULL; |
1784 | exp->flags = 0; | 1785 | exp->flags = 0; |
1785 | exp->master = ct; | 1786 | exp->master = ct; |
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index a1edb9c1adee..f3fd154d1ddd 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -859,7 +859,7 @@ static int tcp_packet(struct nf_conn *ct, | |||
859 | */ | 859 | */ |
860 | if (nf_ct_kill(ct)) | 860 | if (nf_ct_kill(ct)) |
861 | return -NF_REPEAT; | 861 | return -NF_REPEAT; |
862 | return -NF_DROP; | 862 | return NF_DROP; |
863 | } | 863 | } |
864 | /* Fall through */ | 864 | /* Fall through */ |
865 | case TCP_CONNTRACK_IGNORE: | 865 | case TCP_CONNTRACK_IGNORE: |
@@ -892,7 +892,7 @@ static int tcp_packet(struct nf_conn *ct, | |||
892 | nf_log_packet(pf, 0, skb, NULL, NULL, NULL, | 892 | nf_log_packet(pf, 0, skb, NULL, NULL, NULL, |
893 | "nf_ct_tcp: killing out of sync session "); | 893 | "nf_ct_tcp: killing out of sync session "); |
894 | nf_ct_kill(ct); | 894 | nf_ct_kill(ct); |
895 | return -NF_DROP; | 895 | return NF_DROP; |
896 | } | 896 | } |
897 | ct->proto.tcp.last_index = index; | 897 | ct->proto.tcp.last_index = index; |
898 | ct->proto.tcp.last_dir = dir; | 898 | ct->proto.tcp.last_dir = dir; |
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 4c8d9f45ce09..905fda582b92 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -111,7 +111,8 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, | |||
111 | if (sctp_addip_enable) { | 111 | if (sctp_addip_enable) { |
112 | auth_chunks->chunks[0] = SCTP_CID_ASCONF; | 112 | auth_chunks->chunks[0] = SCTP_CID_ASCONF; |
113 | auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK; | 113 | auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK; |
114 | auth_chunks->param_hdr.length += htons(2); | 114 | auth_chunks->param_hdr.length = |
115 | htons(sizeof(sctp_paramhdr_t) + 2); | ||
115 | } | 116 | } |
116 | } | 117 | } |
117 | 118 | ||
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index e28e2b8fa436..092ae6faccca 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -102,3 +102,13 @@ config LIB80211_CRYPT_CCMP | |||
102 | 102 | ||
103 | config LIB80211_CRYPT_TKIP | 103 | config LIB80211_CRYPT_TKIP |
104 | tristate | 104 | tristate |
105 | |||
106 | config LIB80211_DEBUG | ||
107 | bool "lib80211 debugging messages" | ||
108 | depends on LIB80211 | ||
109 | default n | ||
110 | ---help--- | ||
111 | You can enable this if you want verbose debugging messages | ||
112 | from lib80211. | ||
113 | |||
114 | If unsure, say N. | ||
diff --git a/net/wireless/lib80211_crypt_ccmp.c b/net/wireless/lib80211_crypt_ccmp.c index db428194c16a..2301dc1edc4c 100644 --- a/net/wireless/lib80211_crypt_ccmp.c +++ b/net/wireless/lib80211_crypt_ccmp.c | |||
@@ -337,6 +337,7 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
337 | pos += 8; | 337 | pos += 8; |
338 | 338 | ||
339 | if (ccmp_replay_check(pn, key->rx_pn)) { | 339 | if (ccmp_replay_check(pn, key->rx_pn)) { |
340 | #ifdef CONFIG_LIB80211_DEBUG | ||
340 | if (net_ratelimit()) { | 341 | if (net_ratelimit()) { |
341 | printk(KERN_DEBUG "CCMP: replay detected: STA=%pM " | 342 | printk(KERN_DEBUG "CCMP: replay detected: STA=%pM " |
342 | "previous PN %02x%02x%02x%02x%02x%02x " | 343 | "previous PN %02x%02x%02x%02x%02x%02x " |
@@ -346,6 +347,7 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
346 | key->rx_pn[3], key->rx_pn[4], key->rx_pn[5], | 347 | key->rx_pn[3], key->rx_pn[4], key->rx_pn[5], |
347 | pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]); | 348 | pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]); |
348 | } | 349 | } |
350 | #endif | ||
349 | key->dot11RSNAStatsCCMPReplays++; | 351 | key->dot11RSNAStatsCCMPReplays++; |
350 | return -4; | 352 | return -4; |
351 | } | 353 | } |
diff --git a/net/wireless/lib80211_crypt_tkip.c b/net/wireless/lib80211_crypt_tkip.c index 7e8e22bfed90..c36287399d7e 100644 --- a/net/wireless/lib80211_crypt_tkip.c +++ b/net/wireless/lib80211_crypt_tkip.c | |||
@@ -465,12 +465,14 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
465 | pos += 8; | 465 | pos += 8; |
466 | 466 | ||
467 | if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { | 467 | if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { |
468 | #ifdef CONFIG_LIB80211_DEBUG | ||
468 | if (net_ratelimit()) { | 469 | if (net_ratelimit()) { |
469 | printk(KERN_DEBUG "TKIP: replay detected: STA=%pM" | 470 | printk(KERN_DEBUG "TKIP: replay detected: STA=%pM" |
470 | " previous TSC %08x%04x received TSC " | 471 | " previous TSC %08x%04x received TSC " |
471 | "%08x%04x\n", hdr->addr2, | 472 | "%08x%04x\n", hdr->addr2, |
472 | tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); | 473 | tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); |
473 | } | 474 | } |
475 | #endif | ||
474 | tkey->dot11RSNAStatsTKIPReplays++; | 476 | tkey->dot11RSNAStatsTKIPReplays++; |
475 | return -4; | 477 | return -4; |
476 | } | 478 | } |
@@ -505,10 +507,12 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
505 | * it needs to be recalculated for the next packet. */ | 507 | * it needs to be recalculated for the next packet. */ |
506 | tkey->rx_phase1_done = 0; | 508 | tkey->rx_phase1_done = 0; |
507 | } | 509 | } |
510 | #ifdef CONFIG_LIB80211_DEBUG | ||
508 | if (net_ratelimit()) { | 511 | if (net_ratelimit()) { |
509 | printk(KERN_DEBUG "TKIP: ICV error detected: STA=" | 512 | printk(KERN_DEBUG "TKIP: ICV error detected: STA=" |
510 | "%pM\n", hdr->addr2); | 513 | "%pM\n", hdr->addr2); |
511 | } | 514 | } |
515 | #endif | ||
512 | tkey->dot11RSNAStatsTKIPICVErrors++; | 516 | tkey->dot11RSNAStatsTKIPICVErrors++; |
513 | return -5; | 517 | return -5; |
514 | } | 518 | } |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 1e728fff474e..31b807af3235 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -1908,6 +1908,11 @@ static int nl80211_get_mesh_params(struct sk_buff *skb, | |||
1908 | if (err) | 1908 | if (err) |
1909 | return err; | 1909 | return err; |
1910 | 1910 | ||
1911 | if (!drv->ops->get_mesh_params) { | ||
1912 | err = -EOPNOTSUPP; | ||
1913 | goto out; | ||
1914 | } | ||
1915 | |||
1911 | /* Get the mesh params */ | 1916 | /* Get the mesh params */ |
1912 | rtnl_lock(); | 1917 | rtnl_lock(); |
1913 | err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params); | 1918 | err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params); |
@@ -2017,6 +2022,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info) | |||
2017 | if (err) | 2022 | if (err) |
2018 | return err; | 2023 | return err; |
2019 | 2024 | ||
2025 | if (!drv->ops->set_mesh_params) { | ||
2026 | err = -EOPNOTSUPP; | ||
2027 | goto out; | ||
2028 | } | ||
2029 | |||
2020 | /* This makes sure that there aren't more than 32 mesh config | 2030 | /* This makes sure that there aren't more than 32 mesh config |
2021 | * parameters (otherwise our bitfield scheme would not work.) */ | 2031 | * parameters (otherwise our bitfield scheme would not work.) */ |
2022 | BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32); | 2032 | BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32); |
@@ -2061,6 +2071,7 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info) | |||
2061 | err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask); | 2071 | err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask); |
2062 | rtnl_unlock(); | 2072 | rtnl_unlock(); |
2063 | 2073 | ||
2074 | out: | ||
2064 | /* cleanup */ | 2075 | /* cleanup */ |
2065 | cfg80211_put_dev(drv); | 2076 | cfg80211_put_dev(drv); |
2066 | dev_put(dev); | 2077 | dev_put(dev); |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 3e1057f885c6..d190092c3b6e 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <time.h> | 11 | #include <time.h> |
12 | #include <unistd.h> | 12 | #include <unistd.h> |
13 | #include <sys/stat.h> | 13 | #include <sys/stat.h> |
14 | #include <sys/time.h> | ||
14 | 15 | ||
15 | #define LKC_DIRECT_LINK | 16 | #define LKC_DIRECT_LINK |
16 | #include "lkc.h" | 17 | #include "lkc.h" |
@@ -464,9 +465,22 @@ int main(int ac, char **av) | |||
464 | input_mode = set_yes; | 465 | input_mode = set_yes; |
465 | break; | 466 | break; |
466 | case 'r': | 467 | case 'r': |
468 | { | ||
469 | struct timeval now; | ||
470 | unsigned int seed; | ||
471 | |||
472 | /* | ||
473 | * Use microseconds derived seed, | ||
474 | * compensate for systems where it may be zero | ||
475 | */ | ||
476 | gettimeofday(&now, NULL); | ||
477 | |||
478 | seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1)); | ||
479 | srand(seed); | ||
480 | |||
467 | input_mode = set_random; | 481 | input_mode = set_random; |
468 | srand(time(NULL)); | ||
469 | break; | 482 | break; |
483 | } | ||
470 | case 'h': | 484 | case 'h': |
471 | printf(_("See README for usage info\n")); | 485 | printf(_("See README for usage info\n")); |
472 | exit(0); | 486 | exit(0); |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 830d9eae11f9..273d73888f9d 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -843,7 +843,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) | |||
843 | default: | 843 | default: |
844 | continue; | 844 | continue; |
845 | } | 845 | } |
846 | if (!sym_is_choice(sym) || mode != def_random) | 846 | if (!(sym_is_choice(sym) && mode == def_random)) |
847 | sym->flags |= SYMBOL_DEF_USER; | 847 | sym->flags |= SYMBOL_DEF_USER; |
848 | break; | 848 | break; |
849 | default: | 849 | default: |
@@ -856,28 +856,49 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) | |||
856 | 856 | ||
857 | if (mode != def_random) | 857 | if (mode != def_random) |
858 | return; | 858 | return; |
859 | 859 | /* | |
860 | * We have different type of choice blocks. | ||
861 | * If curr.tri equal to mod then we can select several | ||
862 | * choice symbols in one block. | ||
863 | * In this case we do nothing. | ||
864 | * If curr.tri equal yes then only one symbol can be | ||
865 | * selected in a choice block and we set it to yes, | ||
866 | * and the rest to no. | ||
867 | */ | ||
860 | for_all_symbols(i, csym) { | 868 | for_all_symbols(i, csym) { |
861 | if (sym_has_value(csym) || !sym_is_choice(csym)) | 869 | if (sym_has_value(csym) || !sym_is_choice(csym)) |
862 | continue; | 870 | continue; |
863 | 871 | ||
864 | sym_calc_value(csym); | 872 | sym_calc_value(csym); |
873 | |||
874 | if (csym->curr.tri != yes) | ||
875 | continue; | ||
876 | |||
865 | prop = sym_get_choice_prop(csym); | 877 | prop = sym_get_choice_prop(csym); |
866 | def = -1; | 878 | |
867 | while (1) { | 879 | /* count entries in choice block */ |
868 | cnt = 0; | 880 | cnt = 0; |
869 | expr_list_for_each_sym(prop->expr, e, sym) { | 881 | expr_list_for_each_sym(prop->expr, e, sym) |
870 | if (sym->visible == no) | 882 | cnt++; |
871 | continue; | 883 | |
872 | if (def == cnt++) { | 884 | /* |
873 | csym->def[S_DEF_USER].val = sym; | 885 | * find a random value and set it to yes, |
874 | break; | 886 | * set the rest to no so we have only one set |
875 | } | 887 | */ |
888 | def = (rand() % cnt); | ||
889 | |||
890 | cnt = 0; | ||
891 | expr_list_for_each_sym(prop->expr, e, sym) { | ||
892 | if (def == cnt++) { | ||
893 | sym->def[S_DEF_USER].tri = yes; | ||
894 | csym->def[S_DEF_USER].val = sym; | ||
895 | } | ||
896 | else { | ||
897 | sym->def[S_DEF_USER].tri = no; | ||
876 | } | 898 | } |
877 | if (def >= 0 || cnt < 2) | ||
878 | break; | ||
879 | def = (rand() % cnt) + 1; | ||
880 | } | 899 | } |
881 | csym->flags |= SYMBOL_DEF_USER; | 900 | csym->flags |= SYMBOL_DEF_USER; |
901 | /* clear VALID to get value calculated */ | ||
902 | csym->flags &= ~(SYMBOL_VALID); | ||
882 | } | 903 | } |
883 | } | 904 | } |